Syncronize the movement of an animated sprite

Get help using Construct 2

Post » Sat Sep 01, 2012 5:46 pm

I am going mad with this trouble!

I am building an adventure game that will be played by school childrens.
I have to add some animated monsters inside the levels.
They have to move from left to right (for example 300 px) and after goes back.
Each animation is about 20 frames.
I need this in loop.
Here an example:


http://www.dysotek.net/html5/animation.jpg


I need the same function too for a vertical movement (up to down), where the animations aren't flipped images (straight view and back view).

Till now I tried:

1) sine behavior (wave: sawtooth and reversed sawtooth)
2) sine behavior (wave: sine)
3) simulate control

I can't syncronize well the movement with the animations, in order to use the right animation only when the monster is run to right and the left animation only when the monster is run to left.
For example I am getting trouble like dephase position of the monster animation.

This is one of the codes that I have used:

http://www.dysotek.net/html5/sine.jpg


Do you have built functions like this?
Can you help me?
Thanks!dysotek2012-09-01 17:49:53
B
11
S
3
G
1
Posts: 13
Reputation: 1,873

Post » Sun Sep 02, 2012 5:09 am

Here is a simple but very nice example of implementing patrolling monsters using platform behavior and collisions. It should get you quickly to where you want to be:

PLATFORMER: Enemy control with platform behavior

When you understand that, I highly recommend JohnnySix's Patrolling Example in the arcade.
B
29
S
11
G
12
Posts: 281
Reputation: 11,888

Post » Fri Sep 07, 2012 6:54 pm

Thanks kittiewan!
The patrolling system of the First example works fine on my game (at least for the horizontal movements)
B
11
S
3
G
1
Posts: 13
Reputation: 1,873


Return to How do I....?

Who is online

Users browsing this forum: farfetchd83, mjj1990 and 3 guests