I think you are right and wrong at the same time zenassem, no offense.
Quote: "
The error I get is an invalid object # at line 74. I have some questions. First what is p suppose to be equal to? Because You have it incrementing in an if command that can't ever be true.
Quote: "
IF Score = Score + 10
"
"
Score can Equal score + 10, Because score starts off as 0, and when the snake (Object 1) collides with the food (Object f) 10 is added to score, as so.
Quote: "
`Food
FOR f = 106 to 3000
MAKE OBJECT CUBE f,10
POSITION OBJECT f,RND(145),0,RND(145)
COLOR OBJECT f,Green
WAIT RND(1000)
NEXT f
`Collision With Food
IF OBJECT COLLISION(P,f) = 1
Score = Score + 10
HIDE OBJECT f
ENDIF
"
Quote: "
also don't understand why that if condition is at the top of your code where nothing yet has a value; the code will never get a chance to execute so why the if condition?
"
I agree, It was stupid of me to put this If Condition at the top of the program, because it will never get a chance to run.
Quote: "
what is p suppose to be equal to?
"
The Pronumeral P stands for Player, and makes the tail of the snake.
This FOR NEXT loop inside the IF ENDIF Condition still needs to be tweaked, and this will happen soon.
P is object 2 to 100, Because i think that there is a small chance that someone will eat 100 peices of food in this game of snake, especially because the snake level is quite small and you will probably bump into the walls or yourself along 25 - 50.
So you See, Whenever a peice of food is eaten 10 is added to the score and a new peice of tail is made.
So Zenassem, I have changed the code accordingly, and i hope you agree with me that these problems have been fixed.
'sept there are still some problems, like when i run it now the error doesn't come up but the walls are all out of place and the snake doesn't move, But i'll try to figure this one out myself.
Anyways,
Thanks Alot Zenassem,
Cya Later,
Axelman
CURRENT PROJECT: Enemy At The Gates