Sprite pushing another sprite

0 favourites
From the Asset Store
Push the Box Puzzle Game likes Sokoban made with Illustrator
  • Hi,

    I want to create a player who is able to push a ball from one direction and can not push it from the other direction, How can i do it?

    And how can i change the animation of the player during collision to be "Pushing animation" instead of "Running"?

    Thanks in advance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No one can help? <img src="smileys/smiley6.gif" border="0" align="middle" />

  • use physics and add from one side a invisible wall hmmmm

    a little hard

    post capx and ill help ya

  • kbdmaster

    Here is the capx file.

    .capx file

    I want the player to push a ball from one direction only and while he is pushing the ball its animation will changing from "running" to "pushing".

    Can u help me with that?

    Thanks in advance.

  • ANY IDEA? <img src="smileys/smiley3.gif" border="0" align="middle" />

  • Please help me, I tried applying physics to a solid object and set impulse to it while it's on collision with the player, but still it doesn't work perfectly.

    <img src="smileys/smiley5.gif" border="0" align="middle" />

    I also set animation to pushing during that collision but it doesn't work :(

  • I registered on forum just to give you the answer, and I WILL :) I think i know how it SHOULD be done, but:

    1) Its just my first few hours with construct so me naAb :P

    2) Please if you post your 'anything' on public and ask for help, be so kind and rename some objects (to 'player', 'ball' etc) and maybe add some comments on events sheet, where exactly you need help. (I know, i know, the ball, pushing, running and so on... :P)

    ps. Sorry on my whining in first post, will try to post answer asap when im done (if anything comes out)

  • Thanks vjadro :) and u r right about the comments and renaming objects, I will rename and add comments on my future posts.

  • Check this dl.dropbox.com/u/51959257/pinky_ball.capx

    facing=0 (player facing there ->)

    facing=1 (player facing there <-)

    Hittin ball from left to right will push it, from right to left not.

    ps. If thats not what ur askin for, feel free to ask little more precise :P

  • Thanks vjadro 4 ur help, but what i want exactly is:

    1. the player should be able to push the ball(Rock) from left to right slowly

    2. the player's animation should be changed from running to pushing during the pushing of the pall

    3. the player should not be able to push the ball from right to left or from the top.

    I tried to do some steps on this capx file, but the player's animation didn't change from running to pushing, don't know why! <img src="smileys/smiley19.gif" border="0" align="middle"> .

    So can u help me with that.

    Thanks again. <img src="smileys/smiley1.gif" border="0" align="middle">

  • Thanks Yann 4 ur help and comments, but while the player is pushing the ball only the first frame from the pushing animation is active. Can't we make it as a loop playing the whole pushing animation frames?

  • redownload (:

    I set the animation to pingpong so you have a nice back&forth movement

  • Yann, i've looked at X < ball.x and facepalmed so much it realy hurts :/

    Thank you for remembering that long ago i had a brain... :P

    nowfus@my little example (Yann gives the answer, i was hoping to give just hint so you can make it on ur own)

    1. the player should be able to push the ball(Rock) from left to right slowly

    Event sheet->ball on collision with player->ball set bullet speed to (how much you wish).

    I understood it like you want to kick ball, not move it :P In my example setting speed to 15 should do the trick. (Also, you dont need to use here 'bullet' behaviour. I just clicked it and seen that it worked). Then when 'isPushing=false' set bullet speed to 0;

    2. the player's animation should be changed from running to pushing during the pushing of the pall

    Here was my mistake, cose i didnt checked it. In my example where the comment said you just need to add push animation, you will need to set isPushing=true. After that go to Player Custom Movement group and add your animation like other events there with isPushing=true statement. isPushing is a player variable that i've missed.

    3. the player should not be able to push the ball from right to left or from the top.

    This was already implemented in my example (yep, Yann example is faaar more wise).

    Yann

    I am new to C2, just started, and in example you've made i found answers for some questions i had, thanks (i.e. finally i know why people are adding an invincible clones)

  • That's perfect Yann. Million thanks 4 ur help <img src="smileys/smiley42.gif" border="0" align="middle" /> .

    I didn't know where to use the ping pong before.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)