So i need a way to click on a tower and buy it with a certain amount of money and then place it using grid system…
now sadly I cant use @hihilogic info/example
link?
to my game?
would you want to do a click to select and click to place or click and drag
NA NI
click to select and then click to place seems like it would be easier but i dont want it to be placed on the (road) just the (play area) and again grid system
that part of if it’s on the road or not should be easy
For this you need to split it up into two things, the selection and the placement.
Selection:
- there needs to be an indication of what is selected
- when a new object is selected, all other objects should be deselected
Placement:
- needs to detect if it is a place-able tile(for example, whether there is a road or not)
- can only place if there is enough money
- needs to spawn the tower inside the square correctly
- needs to subtract the money after the tower is placed
for the selection part i could have a number for each tower and then use a filter to decide which tower i want to place
yes that sound like it would work
now for the placement part i dont know how that’s going to work in the block coding anyways in theory it is decently simple
could you make an example for it
This is my own game that I made
buying towers logic is all in the spawner and button_buyTower objects
There is some extra stuff in there with the selection part cause I used one object type
I saw that a lot of people are using grid based placement, the TD game I started working on you can place them anywhere, even on top of other towers, but they move out of the way. I need to make a failsafe cause they can bug out and fly around when you place them within the road, lol.
Also I haven’t had much of an issue with a purchasing system. What I have installed is that you click on a tower and it spends the money when you place it, then you can upgrade each tower individually by sending messages to a money counter that keeps track of income and outcome, like gaining money from Windmills and enemy kills and spends money on upgrades and tower purchases.
that sounds pretty cool : )
what happens if the screen is full and you place a tower down?
I haven’t tried it, but you probably won’t gain enough money to get there yet.
That REALLY sounds like a challenge
The game breaks after wave 6 so idk if you can, lol. I’ve yet to fix that.
basically whatever tower you click on sends a message and attaches it to the selector and then click on the grid pay area you want to place i ton