Main forum > GLBasic - en

Not wanting pixel perfect collision

<< < (2/2)

StevetS:

--- 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:

https://www.gamedev.net/forums/topic/592791-index-to-2d-coordinates/

--- 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:

erico:
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:
https://sites.google.com/view/fuedhq/burger-lord?authuser=0

Navigation

[0] Message Index

[*] Previous page

Go to full version