Jump to content

Tower Defense, place tower mechanic


Faces
 Share

Recommended Posts

Im currently in the process of developing a top down tower defense shooter. My question is how would you guys go about having a player click a something (seems a button would be prudent) which would select the appropriate tower (a sprite) and maybe on mousePointer.isDown place the sprite at that location.  I am not new to programming, but a bit new to phaser. After a thorough read of the docs and examples provided online, this is the area I am struggling to figure out. Once the sprite is in game its gg. But allowing the player to place it is the issue I am having. 

 

Thanks in advance!

Link to comment
Share on other sites

Does this example help?

https://phaser.io/examples/v2/input/drag

If not, there are other examples here:

https://phaser.io/examples/v2/category/input

 

Otherwise, I think trying to list the things you want to accomplish would help. I'd guess you want to do something like

1) click on structure

2) drag structure to map

3) leave structure in map

 

Most of that is just a combination of the tutorials that I linked, so hopefully you figure it out

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...