Main forum > GLBasic - en

Not wanting pixel perfect collision

<< < (2/2)


--- Quote from: Moru on 2021-May-17 ---You could also use the array for the map data instead of the sprite/box collision. Just convert the screen coordinates of your player and compare to the map data to decide of there is a collision or not. This should also have the added benefit of being pretty fast compared to sprite collision tests.

Example of what I mean:

--- End quote ---

Ah! Never thought of that!  Checking against the object type in the array would be a really simple check as all objects of a certain type are grouped together ranges.   :booze:

On Burger Lord I check a single player coordinate against the platform array, just like MORU said.
In fact it is very similar to boxcoll but I prefer doing it by hand and in my case it is actually a "line" collision as I donĀ“t need the height of box to collide.

Here is the game I have this system running:


[0] Message Index

[*] Previous page

Go to full version