Constant PowerUps

Get help using Construct 2

Post » Mon Apr 07, 2014 2:00 pm

Space is down, every 0.7 seconds, spawn bullet blah blah blah.
How do I make it that when the Player collides with the power up, the time changes to 0.6 and stays like that until the game is restarted or another power up is collected and brought down another o.1? Been annoying for ages now and I need to sort it. :evil:
B
3
Posts: 11
Reputation: 201

Post » Mon Apr 07, 2014 2:39 pm

Use a global variable, Space is down , every (global variable) , do something , on collision with powerup , decrease global variable by what ever you want.
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Mon Apr 07, 2014 2:44 pm

I don't understand what you mean, I want to be able to change the time from 0.7 down by 0.1 every time I collide with a PowerUp making the bullet spawn rate from the Players character spawn bullets faster but I don't see how I would able to use a Global Variable to change time of delay for bullet spawning.
B
3
Posts: 11
Reputation: 201

Post » Mon Apr 07, 2014 4:36 pm

Sorry I was not more specific and actually you need two variable's. A object variable and a global.

space key is down
(subevent) object variable greater than 0--->subtract 1 from object variable
(subevent) object variable =0------->spawn bullet
------->set object variable to global variable


on collision between player and powerup---->destroy powerup
----> subtract from global variable
---->set object variable to global variable

Play around with your initial settings , set your object and global variable's the same initially and subtract from your global an amount that gives you the speed increase that you want , remember 60 ticks per second or what ever your fps is. So if you start with 60 and then subtract 10 every time you hit a powerup your spawn rate will increase as per powerup's. You might want to clamp your global variable so as not to go below a certain number . Hope this will help and is more clear !
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Mon Apr 07, 2014 4:42 pm

Oh and if you restart your level make sure you set your global to its initial state or it will start off at it's last setting .
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Tue Apr 08, 2014 8:31 am

I have my powerups working but I have my powerups set so that:
(Global Variable - EnemyDeath) = 10 ---> Create object PowerUp on layer "Background"
Set Bullet Speed to random(10-80)
Add 1 to Enemy Death {to stop them spawning repeatedly}
But how can I make this so it's every 10 enemy deaths spawn a PowerUp without spamming them and needing to add another just to to them spamming? I'm sure there is a more efficient way.
Basically, just make so for every 10 enemy deaths, spawn a single powerup.

Thanks for your help so far btw!
B
3
Posts: 11
Reputation: 201

Post » Tue Apr 08, 2014 10:07 am

Make 2 events

1) Enemy=destroyed & Global Variable EnemyDeath<10 | add value 1 to Global variable EnemyDeath & destroy enemy
2) Enemy=destroyed & Global Variable EnemyDeath>9 | Spawn power ups at enemy & Set GlobalVariable EnemyDeath = 0 & Destroy enemy
It's time for me to return the favor :)
B
32
S
9
G
9
Posts: 132
Reputation: 5,370

Post » Tue Apr 08, 2014 10:12 am

here is one way (but then again I've not read all the previous posts so I might be missing something important )

using latest beta - download found at bottom of most screens

edit - I am sure the two posts above weren't there before :) - Oh well, it still might be useful ?
You do not have the required permissions to view the files attached to this post.
Last edited by RamPackWobble on Tue Apr 08, 2014 10:53 am, edited 1 time in total.
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Tue Apr 08, 2014 10:14 am

How much powerups can we make?
~Everyone can make GAMEs~
B
57
S
12
G
1
Posts: 414
Reputation: 5,936

Post » Tue Apr 08, 2014 11:07 am

ikke2902;
I did what you said to the exact same but the PowerUps don't seem to spawn,
I looked at it during debug and it seems that one has spawned and is moving off screen very very fast but I'm not sure. I used the On Destroyed for the enemy being detected as destroyed but I'm not sure if it might be the global variable messing up.
B
3
Posts: 11
Reputation: 201

Next

Return to How do I....?

Who is online

Users browsing this forum: Lancifer and 30 guests