Jump to content

Tower Defense, place tower mechanic


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?


If not, there are other examples here:



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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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