i need help with simple collision
i need help with simple collision
so im trying to make a game where i need collisions. not the the really advanced polygon colliders needing a harvard student to figure out, like im just trying to detect if a ball is touching the paddle in a pong game. please help
Re: i need help with simple collision
You can search this forum or any dev blog for AABB collisions. In your case, pretend the ball is actually a square and the paddle is a rectangle and you'll get an idea, noting AABB assumes both objects are square-ish.
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Idle gridiron. Set team orders then idle and watch: https://togfox.itch.io/idle-gridiron
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Idle gridiron. Set team orders then idle and watch: https://togfox.itch.io/idle-gridiron
Re: i need help with simple collision
Or you can use love.physics module for collisions, but this is more difficult to start with.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Re: i need help with simple collision
You can safely approximate the shape of the ball with its bounding rectangle, and the same for the paddle(s).
This becomes a rectangle-to-rectangle collision which is a great thing to learn about (the AABB thing that TogFox is talking about).
Check out these links, in this order:
This becomes a rectangle-to-rectangle collision which is a great thing to learn about (the AABB thing that TogFox is talking about).
Check out these links, in this order:
Who is online
Users browsing this forum: Google [Bot] and 3 guests