How do I upgrade a tower

Get help using Construct 2

Post » Tue Jul 29, 2014 4:55 am

So I have been at this for about a week and I can't come up with anything so if anyone could help me it would be greatly appreciated. I need to be able to select a tower and spawn another object that I can select and upgrade that towers stats or I could select a button at the top of my screen that will upgrade a specific tower's stats. I am fine with either but I would prefer the first one. Everything I have tried seems to be failing. I have tried on touch of spawned object and money is > cost spawn object and it will not spawn at all. I also have the problem where when I touch the spawned tower it deletes the previous tower and takes the amount of the tower away from my money. Any help would be greatly appreciated to stop these things cause I have no idea what else to do. Below is what I have for a tower so far. Thanks again.
You do not have the required permissions to view the files attached to this post.
Posts: 27
Reputation: 504

Post » Tue Jul 29, 2014 5:52 am

I have yet to work with turrets so maybe someone more knowledgeable will be able to help you out, but I could think of a way to help you out a bit.

I would recommend using a variable when the player selects a tower, so that the player can only select one tower at a time.

On Touched Gunner1
VarGunner = 0
{VarGunner set to 1
Create (your sprites for the upgrades) at Gunner1.x, Gunner1.y} (Any location you want)

On Touched UpgradeButton
VarGunner = 1

Money > YourTowerUpgradeCost
{Create (upgraded tower) at Gunner1.x, Gunner1.y
Destroy Gunner1
Money variable - YourTowerUpgradeCost}

Money < YourTowerUpgradeCost
MoneySprite flash for 1 second (Just an indication to let the player know that they don't have enough money to upgrade)
Posts: 693
Reputation: 20,637

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests