Glennroh's Recent Forum Activity

  • Families also have instance variables so use them, when an enemy collides you do family.damage, and the hp of the enemy is family.hp.

    I didnt understand at first but then i realised when i clicked the enemy1 sprite it had the family.damage variable i created. thanks, a whole lot easier to work now!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • -My game has a player in the middle and enemies spawns in waves that does dmg when collides with player

    -I want to use Families for enemies cause of many different enemytypes with different dmg, hp etc. to prevent creating a "enemy collision with player" event for every single one.

    -I got Dmg and HP variables for every enemy and i want the family to recognize each enemy hp and dmg when they collide with player.

    Im bad at explaining here but appreciate input :)

  • Glennroh, I think you're on the right track there, with your formula like: [round((cost*0.95)+1)]

    I'd make a little table of cost and DMG points you want to hit and then come up with your formula. Test it in a spreadsheet and then code it. Maybe that's an OCD approach, but to me it's good for more complex situations and tuning sets of values.

    Good tip :)

    Btw i have done it right all the way, just did the "set value" instead of "add value". But ye a table is good for balancing

  • Brainless Way

    - USE ARRAY

    when Tower Level = 1 :

    Tower Damage = array_tower.At(0,1)

    Upgrade Cost = array_tower.at(1,1)

    when Tower Level = 2 :

    Tower Damage = array_tower.At(0,2)

    Upgrade Cost = array_tower.at(1,2)

    I couldnt understand the brainless way, could you give me the way with brain :)?

  • Now i want make a diminishing return on the cost increase, anyone knows how to do that?

    Please explain?

    -Tower upgrade cost 1g at start

    -when upgraded it should scale upwards in price but with diminishing returns (so its not just multiplying itself to very high numbers)

    -Im fiddling with formulas like [round((cost*0.95)+1)] but im completely new to coding and construct itself (and math apparently), so what am i doing wrong ?

  • You can use another variable i.e. 'cost' to replace the '1' and say Gold greater equal to Cost. Then on the right side actions AFTER you have set the damage and subtracted the gold, you set 'cost' to a value for next time, if the gold taken only increases by 1 for each level then you set 'cost' to self+1. Also remember to subtract 'cost' from Gold on the right side.

    Thanks alot i got it to work :)

    Now i want make a diminishing return on the cost increase, anyone knows how to do that?

  • when press (upgrade )

    - Gold Add = -(tower dmg)

    - Tower Damage = Tower Damage + 1

    upgrade 1 = -1gold, dmg=2

    upgrade 2 = -2gold, dmg=3

    upgrade 3 = -3gold, dmg=4

    Im not quite sure what you mean here but thanks for the answer. Here is an image of Code

  • Hi,

    Im making a Tower Defence

    -Tower does 1dmg

    -When i press (upgrade dmg sprite), Tower increase +1 dmg/-1 Gold

    -When i press (upgrade dmg sprite) again, Tower increase +1 dmg/-2 Gold, and so forth.

    How do i make this possible?

    I will post image of Code later

Glennroh's avatar

Glennroh

Member since 6 Jan, 2019

None one is following Glennroh yet!

Trophy Case

  • 5-Year Club
  • Email Verified

Progress

6/44
How to earn trophies