I was caught playing Slither during class. My punishment was to program the game in small basic.
I now have a row of balls and if the first ball rolls over the small dots. The dots will disappear and you will gain a point. The if statements that checks if the big ball is on the small dot is this:
If (foodX[x] - SnakeHeadX) < precision And (foodX[x] - SnakeHeadX) > -precision And (foodY[x] - SnakeHeadY) < precision And (foodY[x] - SnakeHeadY) > -precision Then
This if statement is in a for loop
For x = 1 To 500
So I get my points but when the big Ball his x value is and y value are smaller then 20 I also get points. Something that it is not meant to be.
This is the scenario ( The @ is the big ball )
---------------------------------------------------------------------------------------------
|@ *
|
| *
| *
| * *
|
| *
---------------------------------------------------------------------------------------------
As you can see the big ball does not touch small dots. But I do gain points. Why is it True then? And how do I fix it?