I need help with a scoring system

Discussion and feedback on Construct 2

Post » Mon Jun 26, 2017 12:26 am

I'm trying to make enemies drop power-ups every 10 points without having to use more actions and events.
B
17
S
3
Posts: 23
Reputation: 873

Post » Mon Jun 26, 2017 12:59 am

Obviously I don't know exactly how your game works but you can do something similar to :
Global variable for Score (which you probably already have)
Global variable for DropCount, which starts at 0.
As you add 1 to Score, add 1 to DropCount.
When DropCount hits 10, drop an item, set DropCount to 0.
Depending on how your game works, the drop event could be a pick of the nearest enemy, or one that was just destroyed etc.
B
47
S
18
G
84
Posts: 2,273
Reputation: 49,800

Post » Tue Jun 27, 2017 8:54 pm

How can code the nearest enemy instead of on destroyed?
B
17
S
3
Posts: 23
Reputation: 873

Post » Tue Jun 27, 2017 9:06 pm

If you want the nearest enemy to player, create an event using the enemy, select Pick nearest/furthest from the list and then set the x,y co-ordinates to player.x,player.y
B
47
S
18
G
84
Posts: 2,273
Reputation: 49,800

Post » Wed Jun 28, 2017 7:39 pm

This should be posted in the "How do I?" section of the forums.
B
8
Posts: 11
Reputation: 324

Post » Fri Jun 30, 2017 1:13 am

Thanks plinkie
B
17
S
3
Posts: 23
Reputation: 873

Post » Fri Jun 30, 2017 1:38 am

Okay so i got another question. I have an weapon power up pickup spawning from the enemy correctly now. My player shoots a bullet from from image 1 and that bullet is a sprite. Now i have made 2 more bullets as sprites. I have an enemy dropping the power up for the bullet. How would i put the new bullet sprite to spawn after getting the powerup?
B
17
S
3
Posts: 23
Reputation: 873

Post » Fri Jun 30, 2017 2:05 am

Put the new bullet sprite as one of the animation frame for the bullet. Create a variable called powerup. after the player gets the powerup, set the powerup variable to 1. If powerup=1 then set frame to 1(the new bullet sprite that spawn after getting the powerup)
B
3
Posts: 4
Reputation: 187

Post » Sat Jul 01, 2017 2:54 am

I did all that but the new bullet sprite wont continue shooting. It shoots one of the new bullets then it returns to the original bullet.
B
17
S
3
Posts: 23
Reputation: 873


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests