Create objects based on variables

  • Hello guys!

    I have this game, in wich you earn itens based on the amount of points you have. Those items are displayed at the bottom of the screen, side by side.

    For example, player has earned 30 little ores, they are all displayed at bottom of the screen.

    Problem is, I cannot think an easier way to do this. Let's say that he has 20 ores... Am I suposed to create 20 events for it?

    My game is using a resolution of 800x600. The variable that controls the amount of items that the player won so far is called "Points".

    To summarize, what I want to do is something like this:

    For each point on "Points", spawn object "Ore2" at position Ore1 + 10 pixels, then, repeat until 30.

    Glad if you could help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I recomend you check the "space blaster game" example that comes with C2 <img src="smileys/smiley1.gif" border="0" align="middle" />

    there's a missile object that is a tiled background, and it's width changes everytime you pick another missile. might help you find a similar way of dealing with your ores <img src="smileys/smiley2.gif" border="0" align="middle" />

  • Wow, that worked quite well! didn't though of that.

    Anyway, what if I want to implement a flash like effect, acting as a feedback to the payer, indicating that he earned an item?

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