How do I input WASD controls in a platform behavior

Get help using Construct 2

Post » Tue Mar 18, 2014 7:59 pm

I've tried many things, but the player doesn't move. The action runs, it's setted mirrored and not mirrored, but the character movement doesnt work

Any suggestion?
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Tue Mar 18, 2014 10:35 pm

That's pretty basic,
Add an event:
on A key is down, player simulate platform pressing left.
Image
B
71
S
28
G
12
Posts: 515
Reputation: 12,284

Post » Tue Mar 18, 2014 11:25 pm

Yes, that's pretty basic and Ive already tried this way, obviously. Unfortunately, the character do not move. Somehow he get stuck.

Like I said, the action runs, he flip to both sides, but doesn't move.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Tue Mar 18, 2014 11:35 pm

It'd be a lot easier figure it out if you could post a screenshot of your events or better yet upload a capx we can look at. Not much we can do otherwise.
B
32
S
9
G
4
Posts: 198
Reputation: 5,079

Post » Wed Mar 19, 2014 12:10 am

Ahr Ech wrote:It'd be a lot easier figure it out if you could post a screenshot of your events or better yet upload a capx we can look at. Not much we can do otherwise.


Sure, here it is.
Image
obs: Only the Jump works.

Thanks.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Wed Mar 19, 2014 12:24 am

Ah, you'll want to change "on A pressed" and "on D pressed" to "key is down" events. The platform behavior's left and right movement only triggers as long as it has a continuous signal.
B
32
S
9
G
4
Posts: 198
Reputation: 5,079

Post » Wed Mar 19, 2014 1:06 am

lol, that's all?

And why works like that? that's weird.

Well, thank you very much!
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Wed Mar 19, 2014 1:24 am

kossglobal wrote:lol, that's all?

And why works like that? that's weird.

Well, thank you very much!


On key pressed is only true at the moment you pressed the key (the next tick it'll be false even if you didn't released it)
Key is down however is true when the key is down (I mean if you maintain the key it'll stay true, but will be false when the key is not down), the left and right movement on the platform behavior needs to be continiusly applied when you want it to move (since there is no "Stop walking" command, the fact it isn't going left means it stops going to the left for exemple)

Kind of ankward to explain, I hope you understood.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Wed Mar 19, 2014 1:59 am

Yes, I understand. That's why there's no need to keep pressing the key to jump. :D

Thanks!
B
56
S
21
G
3
Posts: 602
Reputation: 6,612


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 2 guests