#1✎ 1YossiManthere is a way to check if pixel is turn on or off?
because I don't find another way to make walls and obstacles in the game, and in that way I will know if the player standing on pixel...
thank you!
Posted
#2✎ 123SamAmazing PageHiddenAchievementsGreat PageHiddenAchievementsGood PageHiddenAchievementsWelcome!
There are many ways to know if a player tries to stand on a wall/obstacle (this is called "collision detection"!)
If your walls and obstacles are sprites, functions like SPCOL and SPHITSP should do the trick :)
Otherwise, I think you would have to write your own code for collision detection.
Thankfully, you're not the first person to ask about this.
I found a thread here that gives a code example for collision with BG tiles: https://old.smilebasicsource.com/forum?fpid=10102#post_10102
I also found this video about sprite collision, made by the SmileBASIC developers: https://www.youtube.com/watch?v=scr1gsOG3q4
Collision detection can be a bit tricky for beginners, so if you still have troubles, let us know!
Posted