New games every week!
JSE - Thoughts : Collision Detection Blog
25th May 2021
There are a lot of things to collide... hmm...

Thoughts within..

-=-=-

Michael Fernie brought it up in a recent comment.
Suggestions for future additions would be basic 2d collision checks. I think most games would use it.


Yep, sure would.
I've been letting this one fester away on the back burner for a while.

Since I'm not "Handling Sprites" it actually makes this process a little harder.
It'd be easy to move sprite n to position x,y, then ask the language "is it colliding?", but without sprite functionality, we're going to have to do things a little more manually, and that tends to overcomplicate things a little.

Currently I'm thinking about assigning shapes to Symbols, to act as bounding boxes.
Draw a ball, give it a circle shape.
Draw a spike, give it a cross shape.
Draw a crate, give it a rectangle.
etc..

But that's only Symbols. Text won't have those shapes, nor will any of the actual shape commands.
Hmm..

Then there's scaling and rotation to work out, too.

IsColliding(Rect,X,Y,W,H,Rot,ScaleX,ScaleY,Oval,X,Y,W,H,Rot,ScaleX,ScaleY)
seems an awfully convoluted command.
Even with "shapes" added to the symbols, you'd still end up with..
IsColliding(1,Rot,ScaleX,ScaleY,2,Rot,ScaleX,ScaleY)

Hmm..

I'm not sure what the best fit for commands might be, here.
If you'd like to chip in with your thoughts, please do so in the comments below.
Thanks!
Views 162, Upvotes 9  
Jse , Thoughts
New games every week!
Site credits : This was all done by Jayenkai
(c) Jayenkai 2023 and onwards, RSS feed

Blog - JSE - Thoughts : Collision Detection - AGameAWeek