8 Directional Movement and Freeze Player

Get help using Construct 2

Post » Mon Nov 04, 2013 10:02 pm

Hi

I have 2 issues at the moment.

(a) I'm struggling with my player movement and i cant figure out the solution. I want the player to face the same direction when moving up and down the layout. So if he is moving left and then you press on keyboard up or down , he is still facing left moving up or down and vice versa if moving right. The same movement you typically get in beat em ups.

(b) Second issue is how do i freeze the character for example during dialogue so pressing on keyboard has no effect to player animation or movement. After the dialogue i then want to enable keyboard input back to normal.

Hope all this makes sense!

cheers
B
6
S
2
G
1
Posts: 4
Reputation: 1,062

Post » Mon Nov 04, 2013 10:31 pm

for B you could use a boolean
B
19
S
6
G
3
Posts: 197
Reputation: 4,154

Post » Tue Nov 05, 2013 9:48 pm

Thank you Yonda for your reply but unfortunately hasn't really helped me since i know nothing about boolean's. I will read through the tutorials, forums and stuff and see if any of it makes sense. I am new to construct
and i am learning with each challenge my game demo brings up.
B
6
S
2
G
1
Posts: 4
Reputation: 1,062

Post » Tue Nov 05, 2013 9:53 pm

Going trough tutorials is a good idea cause we wont be able to help you much until you learn the basics. GL
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
89
S
30
G
22
Posts: 1,985
Reputation: 20,099

Post » Wed Nov 06, 2013 1:07 am

Answer A) On keyboard press UP - set player animation to "walk up"
On keyboard press Down - set player animation to "walk down"

etc.

Answer B)When your game triggers your dialogue event eg: when the player goes up to a NPC and presses a button to talk, you would simply use

Player - (8 direction - set enabled = false)

this disables all input control on the 8 direction movement on the player until you call another action (like when he's done talking to the NPC - to enable it again.

Player - (8 direction - set enabled = True)
B
87
S
44
G
16
Posts: 1,005
Reputation: 17,938

Post » Sat Nov 09, 2013 10:04 am

Hi Guys

Thanks for the advice. I am reading as many tutorials as i can but it literally is like learning a new language and i am impatient, haha. Justifun thanks for pointing me in the right direction ( is that a pun?). i will try your solution to question (b). With regards to (A) i have attached a link to example capx to illustrate my issue. As you can see the player when moving right can move up and down at the same angle i.e right but when player moves left and you press up and down, he still moves right. Funny thing is if you disable the events 10 to 14 then player moves correctly with events 5 to 9. You will see what i mean when you play the test and then disable the vents 10 to 14. I am hoping it will be a simple solution to you C2 experts.

cheers

dropbox.com/s/hq7vkalq533woat/WALK%20TEST.capx
B
6
S
2
G
1
Posts: 4
Reputation: 1,062

Post » Sat Nov 09, 2013 10:26 am

Your "Sprite2 within 0 degrees of 180" event hasn't got any actions attached to it, so it does nothing.

You probably want to put the events below it as subevents of this event.

These are very very basic things you'd learn if you follow the tutorials.

Right now there are two events for on down arrow pressed overwriting eachother. so only the last one is called.LittleStain2013-11-09 10:26:37
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Nov 09, 2013 10:34 am

By the way, your is within degrees won't work anyway for your sprite2 isn't rotated anywhere.

Anyway, there is no need to make a mirrored walkanimation unless it will be completely different from the non-mirrored. Within C2 either the mirroring is done automatic or you can just set your sprite mirrored when the direction of movement changes.

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 41 guests