Query about Push and Pull

0 favourites
  • 5 posts
From the Asset Store
Push the Box Puzzle Game likes Sokoban made with Illustrator
  • Please go through attached link :-

    drive.google.com/open

    We have created a Sprite called "Box_PushPull" for our push & pull requirement but strangely the push and pull function only works when the object become larger than "68x68". The right Green-box is larger than 68x68 thus its working as per the requirement. Both the green box are the same object but copied. We somehow achieved to move the small green box by changing the origin point from center but the result is not reliable.

  • This is because of Player.Y > Box_PushPull.Y in event 5 and 11. The y of both sprites is the y position of the origin of the sprites. If you make the Box smaller the y value increase, because the origin of the box gets nearer to the bottom of the Viewport/Layout. Eventually Box_PushPull.y is greater then Player.Y when the Box is small enough.

  • Thanks for your update.Could you please help us to crack it?

  • It depends. The easiest would be to use:

    + System: Player.Y+Player.Height÷2 > Box_PushPull.Y

    Now you compare the bottom of the Player sprite with the middle(origin) y-position of the box. But if both sprites not at a same level you have to adapt it again. For example the Player and box are not the same level and the box origin is lower than the player bottom then it won't work again.

    But it depends what you want. Maybe you won't that the box is movable if player and box aren't level.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you very much because of you I finally cracked it.

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