Score and new sprite

Discussion and feedback on Construct 2

Post » Sat Jul 30, 2016 6:40 pm

hi guys

I want to design a level with some sprites that are my coins and i want to when the player collect 4 coins ( or a variable number ) some new sprites ( enemy ) come to level


Have a great day/night
Posts: 7
Reputation: 166

Post » Sun Jul 31, 2016 12:42 pm

You just set up a globar variable named "score". Then you add these events and actions:
Player - On collision with another object (Coin):
- System: Add to variable (score): 1
- Coin: Destroy
System - Compare variable (score): = 4
- System: Create object (enemy)

Mind that though that if you didn't have any enemy created in the game before, it will throw an error (it's a limitation in HTML5). You'll have to create a dummy, empty layout (no event sheet needed for that one) and place an enemy there before you can create it. To put it simple: if the object wasn't added on any layout before, it can't be created.
Posts: 1,561
Reputation: 21,065

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests