Dungeon Crawler Movement

Get help using Construct 2

Post » Tue Sep 20, 2011 7:57 am

Hi all,

I was messing around with Dabbijo's simple rpg movement and I'm having trouble of stopping the character's movement when you hit down either of the W, A, S, D keys. The character runs until you release the key and I'm having trouble of stopping that movement. Instead, what I want to happen is the character to move once in either direction, stops and waits for another key button press.

Here is the screen:


Here is the .capx:
http://dl.dropbox.com/u/42350288/rpgtest2.capx

Thanks for any replies!huyngo2011-09-20 07:59:32
B
2
G
1
Posts: 5
Reputation: 460

Post » Thu Nov 07, 2013 7:34 pm

link dead :(
B
27
S
7
G
3
Posts: 299
Reputation: 4,521

Post » Thu Nov 07, 2013 8:48 pm

If I understand it correct, you hold down for instant W and you want the character to move 32 pixel forward?

If that's the case you should use "On key pressed" If you want to make it so the player can hold down the button and then it moves. You should add a small delay on how many times it can happen every cycle. You can do that by adding a every X second or every X ticks.

And you don't really need a "on released", you can just add an else to the keys.

So:

If W is down
   Set character move forward = true
Else
   Set character move forward = false

There shouldn't be any need for the part where you move at 0 and 0 angle.



B
40
S
10
G
2
Posts: 1,149
Reputation: 6,497


Return to How do I....?

Who is online

Users browsing this forum: Timedoor Indones and 29 guests