Use 8Direction behavior to walk backwards

Get help using Construct 2

Post » Tue Dec 03, 2013 8:48 pm

In using the 8Direction behavior, I want to add a feature where the character will walk backwards by holding down an additional key (ie: shift).
I've tried several different iterations with only one moderate working example.

Right now, I have it set up as follows:

- KEYBOARD: Shift is down
-- Sprite: Set mirrored

That, obviously, reverses the image while the directional controls remain the same.
If I added the use of Sprite: 8Direction Reverse, it acts as if it can't make up its mind on whether to keep moving ahead or to change directions.

Basically, I'm trying to get it to where holding right will cause the character to move left, etc. while the shift key is down.

Alternatively, I could set it where I use Simulate Controls, but I'd like to see if there's something I'm overlooking and if there's an easier way.

I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 777
Reputation: 14,830

Post » Tue Dec 03, 2013 9:33 pm

try this:


1.3 means it runs at 30% of normal max speed, 2 would mean it runs at the same speed as going forward.
Edit: you probably need to use custom controls and swap them when holding shift for it to work like you want.

ofc what you also can do is:
default controls off

simulate controls
key "up" is down:
- shift is down: simulate down
- else: simulate up

for each direction

and

on shift pressed: set mirrored, maybe lower the speed
on shift released: set not mirrored, restore to former speedmindfaQ2013-12-03 21:58:59
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Tue Dec 03, 2013 9:58 pm

Yeah, I think that's what I'll do. If only to ensure that I know what I'm plugging into my game. What you have there kinda makes sense, but I guess the Custom Controls would be a better bet.
Thank you for your input and help, though! :D
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
139
S
22
G
8
Posts: 777
Reputation: 14,830

Post » Tue Dec 03, 2013 10:00 pm

Yeah I think simulating the controls directly is the more direct way, else you could run into some unwanted collisions maybe.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786


Return to How do I....?

Who is online

Users browsing this forum: David181, Google [Bot] and 19 guests