How do I create a solid with events?

0 favourites
  • 5 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • If this is covered somewhere else, let me know where to find it:

    How do I create a solid with events?

    Situation: top down with a big (the "wall") and small square (the player).

    I tried: if the player is on the left of BigSquare, check if it is overlapping and if so, place it at BigSquare.BBoxLeft.

    If the player is below BigSquare: check if it is overlapping and if so, place it at BigSquare.BBoxBottom

    I also did this with the other 2 sides.

    But this doesn't work, because I think it checks both (all) conditions. I think it should ignore the 2nd check, if it is on the left side and vice versa.

  • Well i guess you can do wait 0.0 set oldx and oldy to current x and current y

    then trigger on player overlap wall, if oldx is less than the wall's x, it means the player came from the left so set the player'S position to like wall.x - ( wall.width/2 + payer.width/2 ) to put the player at the edge of the wall on the left or seomthing

    You can do anything you want

  • Thanks for the reply. This will help me to experiment.

    I am wondering if there is a shorter efficient way to do this (for educational purposes).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As always, I don't know if I understand this correct, but you could use ' is overlaping at offset' . Therewith you can find out if something is left, right, up ,down of your player.

    I made a litte example:

    drive.google.com/uc

  • hi Asmodean, thanks for your example! This will also help me.

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