Animation Triggers For 8 Direction Movement?

Discussion and feedback on Construct 2

Post » Fri Jan 24, 2014 8:54 pm

@Pixel perfick
What about the actual jump command?
I have never been able to set up a smooth jump using these movements.
You way of explaining the variables and animations helped me alot and im now using your method,But what about the jump.This is the part of custom movements i dont understand,it also is hard to implement jump with 8 direction movements.Whats the best way to make a jump feature for a game like Streets Of Rage.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Fri Jan 24, 2014 9:08 pm

Add 8 animations to Sprite which also has 8 dir motion


walk0
walk1
walk2
walk3
walk4
walk5
walk6
walk7

These should each have the frames for the directional movement.


Then: (simplistic approach)

every tick

sprite set animation:

"walk"&ceil(8*(1+Sprite.8Direction.MovingAngle/360)-0.5)%8

play from current frame



Voila ....
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Fri Jan 24, 2014 11:49 pm

@lennaert @Pixel perfick thank you guys for help,it means alot.Im sure there are people that will hit the same walls im hitting so your help is always a great thing.
One thing i would love to know how to do is implement JUMP in this 8 direction behaviour.Do you know how to make this happen?RookieDev2014-01-24 23:50:54
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Sat Jan 25, 2014 12:18 am

[QUOTE=RookieDev] lennaert Pixel perfick thank you guys for help,it means alot.Im sure there are people that will hit the same walls im hitting so your help is always a great thing.
One thing i would love to know how to do is implement JUMP in this 8 direction behaviour.Do you know how to make this happen?[/QUOTE]


Sure, in my example, below the every tick, you could add any type of condition with a variable or on key press ... or, use your imagination.

examples:

A variable indicating speed could determine, if the "walk" animations should be done, or "run" if a certain speed is set.

Pressing a certain key could indicate that the walk animation should not be used, but another, jump for instance.



Another approach,is simply have 8 animations named animation0 to animation7. (instead of walk0 to walk7)

And use

jump up    - animation0
jump right - animation1
walk right - animation2
right down - animation3
duck       - animation4
left down - animation5
walk left - animation6
jump left - animation7


For jump ofc, you would need to implement some mchanic to get a jump going.
lennaert2014-01-25 00:21:28
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Sat Jan 25, 2014 2:57 am

@lennaert I actually mean how to get the jump started in a 8 direction or custom movement.
I do not know how to make a smooth jump,I only have one jump frame so its not that complicated.I really just dont know how to make my character jump.Its kinda given to us in the Platformer Behaviour.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Sat Jan 25, 2014 8:16 am

Tried adding physics ?

Simply apply impulse at an upward angle, and the gravity wwill pull it down again.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Sun Jan 26, 2014 5:00 am

@Lennaert i tried this method and it makes my character shake while walking,I also tried to make a smooth impulse and it did not work correctly,I must be doing something wrong.

Im really just trying to find out the right steps to take to make my character jump.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

Post » Sun Jan 26, 2014 6:50 am

Sorry not been around over the weekend

In a streets of rage type game as long as there is no platforming involved you can give the impression of a "jump" simply by having your animation frames origin points lower than the base of your sprite, this would have an added benefit of keeping your Y position constant,but your character going up...

As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,270

Post » Sun Jan 26, 2014 1:18 pm

[QUOTE=Pixel perfick] Sorry not been around over the weekend

In a streets of rage type game as long as there is no platforming involved you can give the impression of a "jump" simply by having your animation frames origin points lower than the base of your sprite, this would have an added benefit of keeping your Y position constant,but your character going up...

[/QUOTE]

thats actually a good approach :) might require a couple eextra frames for smoothness, but should work decent :)
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Sun Jan 26, 2014 8:54 pm

@Pixel perfick @lennaert there will be platforming availible to the player.
Thats why i need to know.I actually want him to jump.
He will be walking down a wide street and cars will be on the sides of the road for the player to jump onto.
Ive seen no games on C2 with this effect.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,378

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests