GLBasic forum

Main forum => GLBasic - en => Topic started by: Armoured on 2009-Oct-13

Title: A question about sprites and their collisions
Post by: Armoured on 2009-Oct-13
Hi,
What is the best way to check a collision of one sprite with a background part?

Thanks
Title: Re: A question about sprites and their collisions
Post by: Moru on 2009-Oct-13
What sort of background part are we talking about? If it's a Zelda top-down type of background of blocks then I would keep an array with values and block depending of if the value is bigger than a certain value. For example the sprite for grass has number 1, sprite for gravel is number 2, water is 3 and forest is 4, if the player is walking on a tile that has a number below or equal to 2 we have no collision, if it's above 2 we block the player from this tile.