Help plz ,8 way movement isometric style hack N slash

Get help using Construct 2

Post » Wed Jan 07, 2015 5:07 am

trying to build a 8 way movement with arrow keys but my issue is switching from upleft to upright , and going to like right then rightdown rotating clockwise and counter sometimes it hangsup

you can see how i'm trying to achieve this in my project but i thought there might be an easier way and i'm not fully understanding how it should be programmed


I currently dont have the UP and the LEFT or RIGHT animations yet but i was just toying around with what i got so far
You do not have the required permissions to view the files attached to this post.
B
10
S
1
Posts: 97
Reputation: 700

Post » Thu Jan 08, 2015 6:25 pm

I recommend creating a player base (an arrow graphic or whatever you prefer)

Add 8-direction walking behaviour to this player base.
Add a variable to this base, and create events which check the angle of your player base.
In the end you could set variables (0-8 or up, down etc.... whatever you prefer) based on the current walking angle.

That's not that complicated.

Ones you're done with that.

Simply PIN your player drawing (animation) to the player base.
Then simply check the player base variable to set the animation accordingly.

With that, there's no need to check any button pressed at any given time.



I found this tutorial which should help you through this process in more detail:
https://www.scirra.com/tutorials/413/di ... -animation
B
40
S
8
G
3
Posts: 159
Reputation: 3,024

Post » Sat Jan 10, 2015 1:02 am

I dont fully understand and the tutorial is helping some but not sure what do put for angles i assume like 45 degrees should work, thanks Everade. I'm trying to figure this on my own as you said this isn't complicated but i'm still fairly new in learning things on construct
B
10
S
1
Posts: 97
Reputation: 700

Post » Sat Jan 10, 2015 1:55 am

Awesome I got it and here is my post of what i got so far! Thanks Everade
You do not have the required permissions to view the files attached to this post.
B
10
S
1
Posts: 97
Reputation: 700

Post » Sat Jan 10, 2015 11:24 am

I've made some small improvements to your code and:

- Edited Origin of player sprite so the player base is at the feet of the player sprite (since it should be the players actual position on the ground in case you walk into solid objects)
- Added a stone as a solid object editing it's collision polygons. So you're colliding with the stone with your feet location properly

The "trigger once" will be important as soon as you've added an animation to the character. Otherwise the animation will restart every tick (so you will think the animation will not work but it's actually just restarting the animation about 60 times per second)

I recommend to download the Z-Sorter plugin from Rex.
Using this plugin allows you to automatically change the z-order of your player sprite (or anything else that's moving) based on their Y position on the layout.

So right now in the example i've sent you you will notice that it looks correct if you walk BEHIND the Stone.
But as soon as you walk in front of it your character will still be behind the rock.
Using Z-Sorter plugin will help you to get this properly done ;)
http://c2rexplugins.weebly.com/rex_zsorter.html



Personal tip:
In case some animations are visually exactly the same (for example walking left or right).
Do not create another animation for it... this will only steal resources which isn't required.
You could simply MIRROR the animation instead using an event.
You do not have the required permissions to view the files attached to this post.
B
40
S
8
G
3
Posts: 159
Reputation: 3,024

Post » Sun Jan 11, 2015 4:40 am

OK here is my template character i got all the animated sprites now .... so what im trying to do now is when i release a movement key have a last check for the position change or some how have my character stand in position he was last moving in. Thanks for the recomendation i'll try that Z-order and i'll also check the file that you fixed so kindly for me . i plan on buying construct 2 soon so using an extra code shouldnt matter to me. but its nice to see when i can reduce resources like you said ive only toyd around with construct for about a few months total between both of my projects

thanks a bunch! if you got skype i'd love to chat with you too if you dont mind
You do not have the required permissions to view the files attached to this post.
B
10
S
1
Posts: 97
Reputation: 700

Post » Sun Jan 11, 2015 5:02 pm

There you go

However no skype, i have way to much to do for myself.
I'm a beginner myself, i can't teach you much anyways ;)
You do not have the required permissions to view the files attached to this post.
B
40
S
8
G
3
Posts: 159
Reputation: 3,024

Post » Wed Jan 14, 2015 3:55 am

WOW i finally lookd at the work thats great and i learned , thanks a ton for the help
B
10
S
1
Posts: 97
Reputation: 700


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests