Log In  


Cart #romihisoki-0 | 2024-10-07 | Code ▽ | Embed ▽ | No License


Hello everyone.
First of all, I apologise if my code is a mess. I am learning to code and although stuff sometimes work, I don't fully understand why.

I am doing a game with a procedural map where there are buildings, and each building might or might not be a level. When generating the buildings I attach a level object to it if it is a level and I am printing underneath the ones that are levels, as well as the x and y coordinates and what level number it is.

The game is meant to have the following objects and relationships
Player (obvious)
A Building object > a level object > a combos object > multiple combos objects

is not in this simplified version (as I tried to remove all the clutter to resolve this problem)

The issue I am currently having is that, although I have drawn the bounding boxes according to the collision function, I can't seem to collide and print to the screen which level is the object I collided with.



1st thing that seems wrong with your code is that the col function assumes objects a and b to be of size 8x8 pixels, that's clearly not the case for the buildings.


Thank you. That was it... the most stupid thing is, I had fixed it in the other function for drawing the hitboxes...
I wasn't born to code, but I'll get there



[Please log in to post a comment]