Computer Science Canada Snake help please |
Author: | jrblast [ Thu Dec 01, 2005 7:27 pm ] |
Post subject: | Snake help please |
Well, im making a snake game, i dont have computer sciences, but my friends do (class was full, so i didnt get it ![]() o, and so far i have a tail, but its just a straight one |
Author: | [Gandalf] [ Thu Dec 01, 2005 9:36 pm ] |
Post subject: | |
Oi... indent your code. Look up flexible arrays, and make your snake game grid-based. Store the last location (on the grid if you are using one of each 'part' of the snake in the flexible array, and add an element when you 'eat' something. Also, when properly used, you should only have one View.Update in your program. Your use of it in this case is strange, g2g The code is exceptional for 1 week of experience, great job! |
Author: | jrblast [ Thu Dec 01, 2005 9:43 pm ] |
Post subject: | |
[Gandalf] wrote: Oi... indent your code. Look up flexible arrays, and make your snake game grid-based. Store the last location (on the grid if you are using one of each 'part' of the snake in the flexible array, and add an element when you 'eat' something.
Also, when properly used, you should only have one View.Update in your program. Your use of it in this case is strange, g2g The code is exceptional for 1 week of experience, great job! ![]() ok, ill try that, thanks, but, i may have found another way, ill try that first...but ill look up the flexible array anyways, perhaps it might prove useful another time ![]() ![]() |
Author: | jrblast [ Thu Dec 01, 2005 10:13 pm ] |
Post subject: | |
:S i dont understand the flexible array hting, with the bonds and the blah blah blah, lol, perhaps in time i will ![]() o, and anyone know why you cant edit posts??? i dont like having to double post...and possibly tripple ![]() |
Author: | AzureFire [ Thu Dec 01, 2005 11:17 pm ] |
Post subject: | |
Here's my advice. Going from Turing to a REAL programming language is freaking hard. And since you didn't get the compsci course learn the basics of turing then move on to something less restricting, like C or C++. But that's just my opinion. |
Author: | jrblast [ Fri Dec 02, 2005 11:11 am ] |
Post subject: | |
AzureFire wrote: Here's my advice. Going from Turing to a REAL programming language is freaking hard. And since you didn't get the compsci course learn the basics of turing then move on to something less restricting, like C or C++. But that's just my opinion.
well i do eventualy want to, but i like turing for now, its nice and simpele ![]() |
Author: | Mr. T [ Fri Dec 02, 2005 8:38 pm ] | ||
Post subject: | Alex's Opinion | ||
Here's sample code showing how a flexible array works. Try figuring out the components that make it function.
Good Luck. |
Author: | Cervantes [ Sat Dec 03, 2005 8:18 am ] |
Post subject: | |
AzureFire wrote: Here's my advice. Going from Turing to a REAL programming language is freaking hard. And since you didn't get the compsci course learn the basics of turing then move on to something less restricting, like C or C++. But that's just my opinion.
There are plenty of other languages out there than Java and C++. I suggest learning Ruby after Turing. Link! |
Author: | MysticVegeta [ Sat Dec 03, 2005 12:53 pm ] |
Post subject: | |
I would have to say, Ruby is pretty good. First looked confusing to me, but when you get the hang of it, there are so useful predefined functions availabe, reducing the requirement of a loop. ![]() |
Author: | jrblast [ Sat Dec 03, 2005 8:18 pm ] |
Post subject: | |
ok, well ill go on to ruby after turing i guess, hopefully by next semester ![]() ![]() Well, i think ill give up on this for now perhaps in a week ill pick it up again, ty everyone |
Author: | jrblast [ Sun Dec 04, 2005 1:10 am ] |
Post subject: | |
pardon the second double post, but IM DONE!!! (i know i said i wouldnt continue till like next week, but i just didnt have the will power lol) suddenly i figured it out lmao!!! i decided well ill just give it a tail of a set length of 1 then that will be that, wont be snake but w/e, so i made tailx and taily get the values of x and y at the end of the loop, then i put in in a flexible array (thanks to pwned for that script which led to my understanding of it) and IM DONE!!! |
Author: | [Gandalf] [ Sun Dec 04, 2005 1:44 pm ] |
Post subject: | |
Indeed... Why not post it? You don't like PHP's syntax? Well, from what I have seen, it looks a lot like C++/Java syntax which a lot of languages stem out from. It's not the only option, but it would be good to get used to ![]() |
Author: | jrblast [ Sun Dec 04, 2005 6:02 pm ] |
Post subject: | |
[Gandalf] wrote: Indeed... Why not post it?
You don't like PHP's syntax? Well, from what I have seen, it looks a lot like C++/Java syntax which a lot of languages stem out from. It's not the only option, but it would be good to get used to ![]() i will get used to the syntax because i need to, but for now :@:@:@:@:@:@:@:@:@ lol, o, and anyone know a way to use the Play.Sound function but without pausing the script? anyways, ty again especialy pwned and gandalf |
Author: | [Gandalf] [ Sun Dec 04, 2005 6:29 pm ] |
Post subject: | |
I've always done it so that if I want two different sounds playing at the same time, I have them in different formats - works for Turing. For example, you can have a background mp3 running while playing a wav of an explosion. |
Author: | jrblast [ Sun Dec 04, 2005 8:01 pm ] |
Post subject: | |
erm, im talking specificaly about the Music.Play and Music.Sound commands, the ones that play musical notes and headache frequencies...Is there a way to play that without pausing the program? btw, heres the new source, still gonna upgrade it a bit etc... |
Author: | ZeroPaladn [ Mon Dec 05, 2005 10:08 am ] |
Post subject: | |
lolz i tried playing at speed 1 and i died right on the spot. anyways, this game if freaking fun! (score 43 btw :p) good job with so little turing experience. i cant even make pong (the collision detection annoys me, and i have no patience) and ive taken 2 comp sci classes and been with turing for 3 years... |
Author: | jrblast [ Wed Dec 07, 2005 6:54 pm ] |
Post subject: | |
ZeroPaladn wrote: lolz i tried playing at speed 1 and i died right on the spot. anyways, this game if freaking fun! (score 43 btw :p) good job with so little turing experience. i cant even make pong (the collision detection annoys me, and i have no patience) and ive taken 2 comp sci classes and been with turing for 3 years...
i think theres a collision detection guide on this forum, could be helpful to check it ou? besides, pong wouldnt be easy because of the angles and stuff, bleh! i couldnt make it either...i think, maybe i can get some ideas by looking at the asteroid game that comes with turing ![]() |