Reduce instance speed

For questions about using Classic.

Post » Sat Feb 04, 2012 4:01 pm

Hello there, I'm new to Construct and have been following the beginners tutorial for the best part of the morning as well as messing around with the working capx file for the altered and commented version of Ghost Shooter.

It's only a quick question really (and one that I've not been able to find an answer for) but is it possible to, once a condition is met, reduce the speed of an instance incrementally. I was trying to see if I could get a monster/ghost to gradually slow down with every bullet that collided with it.

I tried 'Set speed' but that doesn't quite have the desired effect :S. I'm a little confused how the Global variable 'MonsterSpeed' affects the speed of the monsters as well. Do the terms 'Monster' and 'Speed' correspond to the object and speed property respectively?

Thanks in advance!
Posts: 1
Reputation: 457

Post » Sat Mar 03, 2012 4:26 am

Global variable means all monsters will read from the same one, as global variables span through all layouts and objects as a single value.

Try a private variable MonsterSpeed for each Monster (add it to one, and the others will have it), then have an Always event to set that monsters speed to its own version of MonsterSpeed value. Then when the bullet hits that monster, give an even to subtract speed from MonsterSpeed for it.

I can post a quick .cap if you'd like.Jayjay2012-03-03 04:26:20
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
Posts: 2,082
Reputation: 14,914

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests