Hovering

Get help using Construct 2

Post » Wed Apr 17, 2013 9:22 am

I have a character that can fly (infinite double jumps), I want to be able to press space to hover in the character's current position (while in air) and press space again to stop.

I would also like for the player to not be able to move while hovering.

I've made a global variable for being on the floor that is set to zero and I have the variable set to 1 (for on the floor) when the character is on the floor.

Thank you in advance for the help.
B
3
S
1
G
1
Posts: 8
Reputation: 441

Post » Wed Apr 17, 2013 9:32 am

And where is the problem ? You just told us what you have done :D

But here: Instance Variable should be better than a global variable. Make it on the player.
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Wed Apr 17, 2013 10:10 am

No, I only made a variable that determines that the player is on the ground.

I can't make the character hover when it's in the air.

I want to stop all movement on the player so that it only floats in the position that the space key was pressed.
B
3
S
1
G
1
Posts: 8
Reputation: 441

Post » Wed Apr 17, 2013 10:13 am

[QUOTE=DannyMirage] No, I only made a variable that determines that the player is on the ground.

I can't make the character hover when it's in the air.

I want to stop all movement on the player so that it only floats in the position that the space key was pressed.[/QUOTE]

Lol I couldn't quote because of the link.
B
3
S
1
G
1
Posts: 8
Reputation: 441

Post » Wed Apr 17, 2013 10:51 am

So you give the player a instance variable like Hover 0=1 not 1= yes

And in your move events you aks if he hover.

Example:
On Key w
And
Sprite.Hover != 0
->do it.

if you just added the movement behaivor you do:

->Every tick
--> if hoover = 1
---> disable movement
--> else
---> enable movement
B
15
S
6
G
6
Posts: 512
Reputation: 5,550


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest