How to “build” on a selected tile, Tower Defense style?

Not favoritedFavorited Favorited 0 favourites
  • 2 posts
From the Asset Store
🙌 Battle Defense Sound Pack comes with 525 high-quality sound effect
  • Currently I don’t have a file worth sharing, and am open to tackling this a different way, but the hope was this behavior:

    In a tower defense game, many of the terrain squares are buildable locations. Currently, they are square “Wall” sprites.

    The user clicks on a Wall, and a popup offers them towers to click on. If they have enough Gold, clicking on a tower deducts the cost, places the tower on that wall/replaces the Wall, and then closes the store popup.

    I was wondering if it could work easily with some form of getting a UID for a wall when you click on it, or getting and storing the xy coordinates of the wall you clicked on, but I’m not sure. Any thoughts on the best way to handle that sort of thing?

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If every wall is a separate sprite instance, then you can simply save its UID in a global variable:

    Set LastClickedWall to Wall.UID

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)