How do I add and substract movement speed?

Get help using Construct 2

Post » Sat Apr 19, 2014 10:23 am

hello everyone
its my first post here and a first game (platformer) im working on.
i wish to put some objects on the map that will upon interacting, change the player's movement speed.
say, you go into mud, it's -50 speed, on ice you would gain +50 speed, a power-up would add 20 movement speed etc.. it's ok if i set movement speed manually for every "zone" a player is in, but what if im in the mud, and having predefined speed for that place on the map, than i take a power-up, how can i add +speed?
hope you understand what im trying to make.
thanks in advance :)
B
4
Posts: 12
Reputation: 224

Post » Sat Apr 19, 2014 10:33 am

If I'm understanding correctly, then something like this should work:

When power up used- Set player max speed to self.platform.maxspeed+50

Where "when power up used" is whatever event you have when a power up is used
B
23
S
4
G
1
Posts: 71
Reputation: 8,346

Post » Sat Apr 19, 2014 10:38 am

thank you very much, i think that will work!
B
4
Posts: 12
Reputation: 224

Post » Sat Apr 19, 2014 10:39 am

No problem!
B
23
S
4
G
1
Posts: 71
Reputation: 8,346

Post » Sat Apr 19, 2014 10:58 am

is there a way i could see movement speed displayed on HUD, cause i've tried setting textbox to display my speed every tick but i get an error "this parametar requires a string, not a number"?
B
4
Posts: 12
Reputation: 224

Post » Sat Apr 19, 2014 11:09 am

Every Tick: Set text: player.platform.speed (With no quotation marks!!!!)

Should work fine
B
23
S
4
G
1
Posts: 71
Reputation: 8,346

Post » Sat Apr 19, 2014 11:17 am

nah, i still get the same message.. :(
B
4
Posts: 12
Reputation: 224

Post » Sat Apr 19, 2014 11:23 am

Hmmm, I just tested it and it works for me. Does it look just like this: https://www.dropbox.com/s/bydpaq7iubmfdwf/Untitled.png

If you want you can upload the capx???
B
23
S
4
G
1
Posts: 71
Reputation: 8,346

Post » Sat Apr 19, 2014 11:30 am

uh sory, i was using the wrong object, "textbox" from "form controls", instead of "text" from "general", it works now!
god, it's hard to be a newbie :)
B
4
Posts: 12
Reputation: 224

Post » Sat Apr 19, 2014 11:32 am

however, i would like it not to show number like 330.94752349572, just the whole number
B
4
Posts: 12
Reputation: 224

Next

Return to How do I....?

Who is online

Users browsing this forum: Armench, dop2000, Jackriduk, kiki4construct and 23 guests