# How do I Push object in 4 direction

0 favourites
• 7 posts
From the Asset Store
112 High-Quality destruction sounds for videogames
• Hello,

i want the player (blue block) to push object in 4 direction (up, down, left, right) to 32 pixels

i don't know if i have to set the behavior of the player and the object to 4 direction, or only one of them

i'm sure the player must be a 4 direction (behavior) but i'm not sure for the object, i'm really stuck

and for the mouvement i want the object to move like this

here is a capx example

``````https://www.dropbox.com/s/44vx73p31aeboz8/push_in_4_direction.capx?dl=0[/code:1zk3l9jt]
thank you very much``````
• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• I think you have to use lerp expression.

lerp(a, b, x) - Linear interpolation of a to b by x. Calculates a + x * (b - a). )

• thank you,

so in A i set the sprite in his curent position and for B the final position ? and for x ? speed ?

should i use it in set position to (action) ?

• I tried with the "lerp" expression but I'm doing something wrong. Maybe someone else will help you with this. In the meantime you can check this tutorial and try to integrate it in your scene:

Subscribe to Construct videos now

I think you should use the solid behavior for all of your sprites.

• Thank you anty21ro this tutorials are so good, i think i'm okey with the player mouvement

but the push action, i can't solve it yet

• I dont understand this way of 'moving'.

Say, from that position, i press 1 down, 2 left, 1 up.

What will happen on the second press left ?

What will happen on the up ?

• Here's one way to do it without lerping.

https://dl.dropboxusercontent.com/u/700 ... ction.capx

Families could have come in handy, but since you don't seem to have a license, I went without.

• 7 posts