How do I Animate a Position Change

Get help using Construct 2

Post » Sat Apr 05, 2014 6:51 pm

Hello I'm doing my very first game and i have a problem:

I have a key event that makes some objects changing positions (100px in Y or X, for example) but they do it in one tic, and I wanna animate the change, I tried to put an animation so on the key event firts play the animation and then change the position, but then my objects firsts made the change position and then the animation or vyceversa, and allways with a ugly "jump" effect....

anyone knows what could I do?

thanks
B
17
S
2
G
1
Posts: 35
Reputation: 1,102

Post » Sun Apr 06, 2014 3:21 am

It's a little hard to answer without more specifics. If the movement and the animation events are triggered by the same Condition, u need to define a separate condition to trigger the animation event after.

Is the animation suppose to happen before, during, or after the move?
what behavior are you using to move the sprites?
Is the move random 100px or do you know the position the sprite will stop on in advance?
Is the animation looping?
If I understand you correctly, and the animation is not looping, it could work like this

Some Condition > Sprite Play Animation
Sprite On Finished>Sprite set position

On finished refers to the animation and needs to be a sub event of the initial condition.

Try to be more specific and answer the above questions and I'll try to give you a better solution.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Sun Apr 06, 2014 10:57 am

TheDom wrote:It's a little hard to answer without more specifics. If the movement and the animation events are triggered by the same Condition, u need to define a separate condition to trigger the animation event after.

Is the animation suppose to happen before, during, or after the move?
what behavior are you using to move the sprites?
Is the move random 100px or do you know the position the sprite will stop on in advance?
Is the animation looping?
If I understand you correctly, and the animation is not looping, it could work like this

Some Condition > Sprite Play Animation
Sprite On Finished>Sprite set position

On finished refers to the animation and needs to be a sub event of the initial condition.

Try to be more specific and answer the above questions and I'll try to give you a better solution.


Oh! First of all, thanks for answering!!

Second, sorry for being not as specific as the question needs, the problem is that english is not my mother language and sometimes is hard to me to find the proper words to expres some technical things, sorry, really.

I think that your answer will help me, but anyway I will try to explain my situation a little further:

this is the thing, more or less:
I have several objects that move alike, but let's focus on the player

You can only move up and down in some specific pixels (93, but let's say 100px), so when you push up, you change your Y position in yourYposition + 100, and when you push down the same but -100.

In my test game by the moment, you just "appear" 100px up or down, and what I want is that the player "moves" 100px up or down, and is important for me that it happens in just one key presion. (like if you where on a menu, and you navigate up or down between the selecting options).

In my very first thought I think about making an animation, so when you click up, you play the animation witch emulates the transition for the position change, and then make the position change somethink like

When CLICK UP ->Player animation "up"
Player move on angle 270 - 100px.

But it doesn't work properly....

Now I will try what you answered me and let you know about the result

regards, and many many thanks you!!
B
17
S
2
G
1
Posts: 35
Reputation: 1,102

Post » Sun Apr 06, 2014 11:23 am

Message: VIKINGS can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I understand what he wants but have no idea how to do it myself, I've just decided to just let the player "jump" since in my game it's in smaller increments(20px I think) so it doesn't look to weird.
Anyway, what he wants Dom, imagine every FPS you've ever played for example, in those games when you see an object(lets take a human for this example) move from point A to point B, you see him walking/runing there, right? And this transition from point A to B while playing a walk animation can be a smooth and as slow as the dev wants, pixel by pixel. What happens to him is the animation plays in point A and then the object just dissapears from A and appears in B. Like in Flappy Bird for example.
Hope I'm explaining it better.

I think the "How to make a platformer" tutorial could help you Arlys if you're trying to make a walking/runing transition, but for other objects/movements I have no idea mate, sorry.

www.scirra.com / tutorials / 253 / how-to-make-a-platform-game (delete the spaces between /)
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Sun Apr 06, 2014 1:49 pm

is this a platformer? or a top down? What behavior are you using to move object or player? Need to know to provide solution.

Why don't you PM me the capx.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Sun Apr 06, 2014 2:37 pm

Hello!

I found a solution that works for me, maybe is not the best, but by the moment it will be enought.
Image

TheDom, by the moment I don't wan't to bother you more with this issue, but thanks for being so kind!!!

regards
B
17
S
2
G
1
Posts: 35
Reputation: 1,102


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 22 guests