How do I update all of an objects bullet speeds?

Get help using Construct 2

Post » Sun Jul 19, 2015 11:07 pm

I'm still learning how to use this program so I've decided to just modify the beginners tutorial game. I have this problem where only the newly created monsters are having their bullet speed updated overtime. So if a monster spawns and I have monster bullet speed set at 110 then that's how it spawns while the ones already spawned stay at 80. Anyone know what I'm doing wrong here?
B
7
Posts: 16
Reputation: 293

Post » Mon Jul 20, 2015 5:31 am

Are you changing the bullet speed through events? It stands to reason that if older monsters aren't affected by those events (e.g. if events only run for when a new monster is spawned) then they'll remain unchanged. Can't really say for certain without seeing how the events are set up, though.
B
57
S
25
G
19
Posts: 302
Reputation: 13,829

Post » Mon Jul 20, 2015 5:55 am

The Monster's speed is set when the new monster in created. After that, the monster's speed is not updated. If you want all monster's speed to update, you can use an event on Every Tick (either use the one already made or make a new one) and do the action: Monster > Set Movement speed > to MonsterSpeed. Since no particular Monster was "picked", this will apply to all Monsters. In the case where one was created, it also gets "picked", so the next action only sets the speed for that Monster.
B
10
S
2
Posts: 33
Reputation: 710

Post » Fri Jul 24, 2015 1:12 am

tgfcoder wrote:The Monster's speed is set when the new monster in created. After that, the monster's speed is not updated. If you want all monster's speed to update, you can use an event on Every Tick (either use the one already made or make a new one) and do the action: Monster > Set Movement speed > to MonsterSpeed. Since no particular Monster was "picked", this will apply to all Monsters. In the case where one was created, it also gets "picked", so the next action only sets the speed for that Monster.


Thanks so much I can't believe I didn't realize that!
B
7
Posts: 16
Reputation: 293

Post » Fri Jul 24, 2015 8:51 am

I would approach this differently. I would create a Global Variable called "Speed" and set its value to e.g 400.

Then i'll create a condition saying "every tick" > set playersprite bullet speed to ""Speed". (It should get its speed value from the global variable we created.)

Now you can create multiple objects or whatever and link their bullet speed to the global speed variable. Now whenever you want to change the speed. Just create a condition and set the 'speed' variable value to something else. This way you can change the speed of multiple objects at once without any trouble.

hope this helps you.
B
11
S
1
Posts: 27
Reputation: 598


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests