0 Favourites

how to make collition between 2 sprites (couldent find tut)

  • hi everyone. i tried to find tutorials about how to make collision between 2 sprites. can someone tell me how to do that or give me a tutorial?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Every object you create on the layout has a collision box, you can edit the size and shape of the collision box of the sprite objects.

    You use collisions to trigger events. Enemy on collision with player triggers damage.. or anything like that.

    Try reading the manual: https://www.scirra.com/manual/121/event-sheets

  • I think you can also add a behavior that will make it solid, so nothing can pass through it. It should be in the attributes if needed

    The collision box is editable and there are events "on collision" so you can decide what happens when the two objects touch

  • Every object you create on the layout has a collision box, you can edit the size and shape of the collision box of the sprite objects.

    You use collisions to trigger events. Enemy on collision with player triggers damage.. or anything like that.

    Try reading the manual:

    i didnt succes to do it. if its not clear i just want the player object wont pass through the wall object. (in top down shooter game)

    for example if i have 2 sprites: player , wall

    i wrote in the event sheet: player- on collition with another object (i chose wall) - add collitions enbaled

    and it didnt work.

    so i wrote in the event sheet : when start of liyout set player solid behaviour enbaled

    and when start of layout set wall solid behaviour enbaled

    and it didnt work too.

  • You don't need to add a event for that. Just add the solid behavior to both player and wall sprite and they won't move past each other.

    If you set both behaviors and it's still not working try cheking if the player is not moving too fast. Moving too many pixels per second may make the player pass through thin objects.

    But if you try all this and it's still not workig try to upload your .capx file so qe can take a better look on what you're doing

  • You don't need to add a event for that. Just add the solid behavior to both player and wall sprite and they won't move past each other.

    If you set both behaviors and it's still not working try cheking if the player is not moving too fast. Moving too many pixels per second may make the player pass through thin objects.

    But if you try all this and it's still not workig try to upload your .capx file so qe can take a better look on what you're doing

    thank you for the help. becouse the forum rules i cant send you the file. can i send it to you on your site? (ray-ki.deviantart.com)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
Sprite Font Generator - v3
368 112,290
RetroDaddy's avatar
RetroDaddy
Unread hot topic
167 14,489
DMT2005's avatar
DMT2005
Unread sticky
1 Favourites
C2 Games made with CocoonIO
136 89,818
minhcuong's avatar
minhcuong