How to approach my game idea

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Brotein
Prole
Posts: 2
Joined: Tue Nov 19, 2024 12:21 pm

How to approach my game idea

Post by Brotein »

Hi, I just found out about love and I will be watching some tutorials in order to understand how to make games with it.

I always wanted to re-create a flash game that I loved called dottie.

Image here:
firefox_ETGPPL3Oka.png
firefox_ETGPPL3Oka.png (204.68 KiB) Viewed 1467 times
Basically when you click on start here, your curso becomes a dot, if you touch any wall or obstacle you explode.

I would like to know how you would approach collision detection.

I have a basic knowledge of how it works for platformers, but in this case, I don't know how to to approach it properly.

In my mind there are 2 layers, the back layer and the front layer, the front layer is where I place all the obstacles and walls etc.

But how do I check if the dot is hitting anything?

Also should I use SVGs instead of images for scalability?

Thanks a lot.
User avatar
pgimeno
Party member
Posts: 3711
Joined: Sun Oct 18, 2015 2:58 pm

Re: How to approach my game idea

Post by pgimeno »

Well, these are no ordinary platformer collisions for sure! I've been thinking about some possibilities but in the end, my conclusion is that using a collision bitmap as an ImageData object would work best (or maybe use the alpha of the top layer directly), via ImageData:getPixel. Other options I've considered and rejected are polygons and love.physics shapes.

One problem is the mobile parts. But the fact that the player is a dot plays to your advantage here: if you use a Transform object for handling position and rotation of each mobile part, you can also use inverseTransformPoint to see where the dot is relative to it, and check for collisions accordingly (separately from the main track).
Brotein
Prole
Posts: 2
Joined: Tue Nov 19, 2024 12:21 pm

Re: How to approach my game idea

Post by Brotein »

Thanks a lot for the answer. Actually I think that to make things easier, I am going to opt for black and white and put some retro shaders on to make it more old style.

With this I think I can also check the color itself, so if anything is black, then it's a collision point.
User avatar
dusoft
Party member
Posts: 778
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: How to approach my game idea

Post by dusoft »

pgimeno wrote: Tue Nov 19, 2024 11:18 pm Well, these are no ordinary platformer collisions for sure! I've been thinking about some possibilities but in the end, my conclusion is that using a collision bitmap as an ImageData object would work best (or maybe use the alpha of the top layer directly), via ImageData:getPixel. Other options I've considered and rejected are polygons and love.physics shapes.

One problem is the mobile parts. But the fact that the player is a dot plays to your advantage here: if you use a Transform object for handling position and rotation of each mobile part, you can also use inverseTransformPoint to see where the dot is relative to it, and check for collisions accordingly (separately from the main track).
Why wouldn't polygons work here? This is exactly area where polygons work well AFAIK.
User avatar
pgimeno
Party member
Posts: 3711
Joined: Sun Oct 18, 2015 2:58 pm

Re: How to approach my game idea

Post by pgimeno »

dusoft wrote: Fri Nov 22, 2024 6:02 pm Why wouldn't polygons work here? This is exactly area where polygons work well AFAIK.
Looking at the concentric circles, it seems it would need a LOT of segments to get an accurate representation, and checking could become slow, especially compared to the simpler pixel-oriented checking that is possible in this case.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], prostokiriuha and 6 guests