How do I push up and down

  • Hello,

    I need advice. I want to create a game based on the principle SOKOBAN game. I have no problem to program the push and pull. Solid box is then pulled along the platform ground. Likewise, I have no problem using physics program push and pull the object.

    I can not, however, advise that box that I want to pull the pull and I as a player to him could bring all sides and move in that direction. What behavior will set the player (8 direction, plaform?) What has to be programmed?

    Thank you for any advice.

    Regards

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi chcteacher !

    I'd like to help you, but I have difficulties to understand this sentence :

    I can not, however, advise that box that I want to pull the pull and I as a player to him could bring all sides and move in that direction.

    Regards

  • I am sorry for my English.

    I want to create a game SOKOBAN. On the surface I want to give a box, which I'll pushes the player. Box will move in a direction in which the player pushes.

    en.wikipedia.org/wiki/Sokoban

  • No problem, I'm not a native English either.

    So, you can move the box using events, but you don't manage to make the player push and pull the box? Is that it? Would it be possible to see how you programmed your events?

  • If you look at the image layout, so I need to get a box to exit the position.

    Box I want to move in space layout. Up, down, left, right.

    Now I have set:

    BOX- a solid platform

    Player- platform

    Now I can move to the left and to the right. I need a box to up move and down move, like in the game SOKOBAN.

    drive.google.com/file/d/0B2f9uToDb5FHS0RTMEZqOEkzZTQ/view

    drive.google.com/file/d/0B2f9uToDb5FHTkJfNkFzZ3lvdFE/view

  • Alright! First, you can remove the Platform behavior from your box, because you won't use it for up and down movements. Then, that's how I would advise you to proceed :

    Condition : Prekryti is overlapping Box
                          Condition : Player.X < Box.X  AND Right Arrow is down
                                               Action : Set Box.X to Player.X + distance(Player.X,0,Box.X,0)
                          Condition : Player.X > Box.X  AND Left Arrow is down
                                                Action : Set Box.X to Player.X - distance(Player.X,0,Box.X,0)
                          Condition : Player.Y < Box.X  AND Down Arrow is down
                                                Action : Set Box.Y to Player.Y + distance(0,Player.Y,0,Box.y)
                          Condition : Player.Y > Box.Y  AND Up Arrow is down
                                                Action : Set Box.Y to Player.Y - distance(0,Player.Y,0,Box.y)[/code:3f5cn4jx]
    
    That should work.
  • Hello good afternoon I've tried to do the sokoban with your code but I can not get it, help me otherwise Thanks

    To try it does not move

    I have been searching the forums but there are not many answers to this topic

    I would like to use 8direction

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