How do I make upgrades add more than 1 to variable.

0 favourites
  • 6 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Basically I am still learning and would like to create a guide for my self.

    Lets say I have a sprite called (egg) if I click on (egg) it adds 1 egg to the global variable or local variable (whichever one will work for this)

    After I have 10 eggs I can buy my second sprite (chicken) which would add 1 egg per second to my global or local variable.

    Now my problem is that even if i buy 10 chickens I am only still receiving 1 egg per second instead of 10.

    How can I change that so that I get more eggs per second.

    I have tried the "for each" but cannot select variables only sprites.

  • Instead of adding 1 to egg add chicken 'count' to egg

  • Instead of adding 1 to egg add chicken 'count' to egg

    Not sure what you mean by this. Sorry I am a complete noob.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Now my problem is that even if i buy 10 chickens I am only still receiving 1 egg per second instead of 10.

    For this, right now you probably have "add 1 to eggs", where you clicked on "add to" and when the field popped up you left it as 1.

    Instead of adding 1 to eggs you want to add 1 egg per chicken, correct? So add the number of chickens to the number of eggs. If chickens is already a variable somewhere just put the variable in the field. If chickens are sprites then use the count expression which will count the number of instances in the project of chickens (so be wary of ones off the screen and such). Can't remember if the expression is chickens.count or count("chickens")...

  • Worked like a charm. My brain stopped working and I only figured I could use numbers instead of other variables. Thank you very much sir.

  • Worked like a charm. My brain stopped working and I only figured I could use numbers instead of other variables. Thank you very much sir.

    You are welcome. Any field like that you can use any variable or expression

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