Computer Science Canada

[FP] Snakem 2

Author:  rhomer [ Mon May 31, 2004 8:31 pm ]
Post subject:  [FP] Snakem 2

Here is my Snake Game. Please Enjoy!


If you voted worse than VERY GOOD in my poll, please tell me what i can do to make it better.

Author:  Paul [ Mon May 31, 2004 8:59 pm ]
Post subject: 

Before u hand it in, (if you haven't already), add a nifty intro and ending screen.
Also I don't like the fact that if your moving in one direction and you press the opposite directional button, you die.

Author:  rhomer [ Mon May 31, 2004 10:29 pm ]
Post subject: 

I added in a nifty Intro AND ending.

Author:  alikhan [ Tue Jun 01, 2004 8:16 pm ]
Post subject: 

i said it just plain sux because the game did not work i got an error
sorry dont mean to hurt ur feelings

Author:  Tony [ Tue Jun 01, 2004 8:20 pm ]
Post subject: 

alikhan : you should have posted what error you got, because game works for me

Author:  the_short1 [ Thu Jun 03, 2004 8:00 pm ]
Post subject: 

hes right.,.. .. it does have an error!!!




in ur intro... u have

exit when hasch to stop animation if u press a key..
.

well.... hasch just returns true is theirs a char in the keyboard buffer that has not be read..


right afterwords u have it to get the speed

well.... for instance i pressed the letter 'e' to end animation...

well when u went get speed

it already had 'e' in buffer...then i tyoped 5...

then the error was..


wrong type becuase get speed returned 'e5' whereass it wanted a int not a string

for one why did u go 'noecho' cnat see what u type... not cool!!

ok...


this is how u fix:

to exit animation go:

code:

var blah : char
if hasch then
getch (blah)
exit
end if

this will take that 'character' that u pressed to stop animation, and remove it from keyboard buffer and put it into variable blah
then when u get the input from user, that character is not already there!

and that will solve problem


tony... the only way not to get the error is to hit 'enter' to stop animation... that way there u wont have a text string in front of number!


hope that helps



also... when i pressed a directional button it din't always move... it was delayed... and that sucked cuz i died cuz of that..
.

i press up... it does nothin... i press up again.. nothing... then almost hitting wall now... i press up... o finally it works!

maybe put ur character movement in a process so its not delayed like that and it will check for movement 100% of the time... not every ten seconds!

Author:  rhomer [ Thu Jun 03, 2004 8:11 pm ]
Post subject: 

Ya sorry about that i didnt notice that...here's it works...

Author:  alikhan [ Fri Jun 04, 2004 7:02 pm ]
Post subject: 

the short is right about how the movement is delayed. i did not look over your code so i dont know how you r doing it
my suggestion use Input.KeyDown. Sory i did not mention the problem earlier. i shall vote again. no offence taken for the first post i hope.

Author:  bugzpodder [ Tue Jun 08, 2004 4:43 pm ]
Post subject: 

cant get it to work, got stuck on the page when i try to enter the size...


: