Two-key - diagonal walk

Get help using Construct 2

Post » Fri Jun 07, 2013 12:52 am

Here is the test level link:

https://dl.dropboxusercontent.com/u/172450407/New%20project/index.html

I have found 3 ways to make the Up-Left (W+A) animation to trigger, but it stays stuck in the first frame. I cannot, for the life of me, figure out how to get it to play from keyboard triggers.

Here are the movement events as they sit now:

B
6
S
1
Posts: 62
Reputation: 532

Post » Fri Jun 07, 2013 12:57 am

Maybe add a second condition to the "Letter is down" event, where it checks to see that the animation isn't already playing?

(that way it won't restart the animation every tick?)
B
201
S
52
G
30
Posts: 897
Reputation: 36,621

Post » Fri Jun 07, 2013 3:02 am

It does this even if "Every Tick" isn't the method used, but I will give it a shot.

**Update: No dice.

The animation doesn't move past the first frame no matter how I do it. *shrug*Wigriff2013-06-07 03:04:56
B
6
S
1
Posts: 62
Reputation: 532

Post » Fri Jun 07, 2013 3:16 am

[QUOTE=Wigriff] Here is the test level link:

https://dl.dropboxusercontent.com/u/172450407/New%20project/index.html

I have found 3 ways to make the Up-Left (W+A) animation to trigger, but it stays stuck in the first frame. I cannot, for the life of me, figure out how to get it to play from keyboard triggers.

Here are the movement events as they sit now:

[/QUOTE]

This doesn't work either. I have tried about 10 other ways as well, and they all end up with the first frame of the "UpLeft" animation frozen on the first frame. *shrug*

OP: We will get this worked out eventually. lol

B
6
S
1
Posts: 62
Reputation: 532

Post » Fri Jun 07, 2013 8:05 am

All events fire every tick, except for trigger events.
You don't really need "Every tick" event.

That is what is happening, it actually says in your image "(play from beginning)" Which fires 30 to 60 times a second. Your animation restarts every tick.
B
201
S
52
G
30
Posts: 897
Reputation: 36,621

Post » Fri Jun 07, 2013 10:46 pm

I think I'm going to redo it all from the ground up using the Diablo example, but having key controls instead of point-and-click mouse controls. I don't know if it will work or not, and it will take awhile, so I will have to wait until I get off work tonight to try. I'll post the results.
B
6
S
1
Posts: 62
Reputation: 532

Post » Sat Jun 08, 2013 12:03 am

Solved!

First, set up your character animations like this:



0 = right
1 = down-right
2 = down
3 = down-left
4 = left
5 = up-left
6 = up
7 = up-right

You will do this for both idle and running animations, obviously.

Then set up events like this:



The first set controls your key movements. The bottom commands control the animations.

For idle: "idle"&self.a

For running: ceil(8*(1+Player.8Direction.MovingAngle/360)-0.5)%8
                             and
             "run"&self.a
B
6
S
1
Posts: 62
Reputation: 532

Previous

Return to How do I....?

Who is online

Users browsing this forum: chcteacher, Televangelist and 27 guests