[SOLVED]How do I add to behavior properties?

Get help using Construct 2

Post » Wed Apr 22, 2015 2:42 pm

Hello World,

If I use behaviors like platform and bullet, how can I add to the values I initially set?
For example let's say the platform behavior of an object has max speed 300 initially. Then I want to have an event every x seconds add +10 to max speed. So I use system event every x seconds then set max speed action and then what do I write there...? Because I don't want it to just set a new max speed, I want it to add to the current max speed, or acceleration or whatever I choose.

If I wasn't clear enough let me know guys and I'll be glad to clarify myself.

Thank you everyone.
Last edited by VIKINGS on Thu Aug 06, 2015 12:51 pm, edited 1 time in total.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Wed Apr 22, 2015 2:45 pm

You would add the value to the sprites platform.maxspeed value:

Sprite.Platform.MaxSpeed + amountToAdd

All of the properties of a behavior are accessed by typing the name of the object, then a period (.) connecting the behavior, then a period connecting the property name.
B
38
S
12
G
11
Posts: 331
Reputation: 7,712

Post » Wed Apr 22, 2015 2:51 pm

Great, exactly what I wanted to know. Thank you very much.:D
B
21
S
11
G
6
Posts: 414
Reputation: 5,335


Return to How do I....?

Who is online

Users browsing this forum: newt and 12 guests