Advertisement

Snake?

Started by March 28, 2001 11:45 AM
10 comments, last by MasterBlaster 23 years, 10 months ago
I''m a beginner and working on a snake game, it works fine. I''m using array''s for the body and heard that it could also be done with pointers. My question is can somebody send/show/give me the source of a snake game using pointers, for learning and comparsion?? ThankX, --------------------------- MasterBlaster(CodeFighters) ---------------------------
---------------------------MasterBlaster(CodeFighters)---------------------------
You want the whole game? T.S.

  struct SnakePiece{int x;int y;};//5 piece snake...SnakePiece* Snake1 = new SnakePiece[5];delete[] Snake1;  


Magmai Kai Holmlor
- The disgruntled & disillusioned
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Advertisement
You could quite easily store the snake body with pointers. In this case you want to take a look at using a linked list (a way of storing data that uses pointers to link together a list of data).

Your favorite search engine (just search for "linked list") will turn up a better explanation of it than I could hope to provide here.

Alan
"There will come a time when you believe everything is finished. That will be the beginning." -Louis L'Amour
How about Introduction to linked lists?

(will open in new window)

=======================
Game project(s):
www.fiend.cjb.net
=======================Game project(s):www.fiend.cjb.net
Well, my snake game doesnt use pointers, I made I long time ago before I knew of them.... but you can find it at my website:

Ciphersoftware website

Edited by - Ciphersoftware on March 29, 2001 2:21:54 AM
Ciphersoftware website

Support the open source community

Thank you all for the info!

I only get incurrupt files from the site of Ciphersoftware...so I''m unable to download the pong of Ciphersoftware to bad maby he can fix this or send me te zip.

---------------------------
MasterBlaster(CodeFighters)
---------------------------
---------------------------MasterBlaster(CodeFighters)---------------------------
Advertisement
You can''t download anything? I''m not having a problem. Could you kindly tell me the error message you recieve when trying to download one of my programs? Thanks.

PS. If anyone else is encountering problems downloading applications from my site, please inform me, Thanks

Ciphersoftware website

Support the open source community

Ciphersoftware website

Support the open source community

Wel after clicking the link I get to the Tripod download with the link of the download after clicking that one I goes to the Tripod section again but with a ''?1'' added to the link. This seems not to end. I also gave it a try to d/l it using an a manager (GoZila and FlashGet) they get a html file.

This the link I tryed:
http://justin-todd.tripod.com/games/worms.zip
after clicking it went:
http://justin-todd.tripod.com/games/worms.zip?1?
http://justin-todd.tripod.com/games/worms.zip?1?1?
http://justin-todd.tripod.com/games/worms.zip?1?1?1?
etc.





---------------------------
MasterBlaster(CodeFighters)
---------------------------
---------------------------MasterBlaster(CodeFighters)---------------------------
Weird, it seems to work for me, but Ive ran into this problem before. All I did was went back to the games page, clicked the link again, and then I clicked the other link. Im using explorer. I''ll try to figure out the problem, but if you really want to see how I made it, theres a link to the main source file. The ''core game'' is about 10 lines of code I believe.

Thanks a lot

Ciphersoftware website

Support the open source community

Ciphersoftware website

Support the open source community

Hi all...
I guess you like snake games so enter my page:
www.angelfire.com/games2/gamedevzone
and then click Downloads
there you''ll find some amazing games which i made and between them one amazing SNAKE game... if you''d like to get the code just mail me...

This topic is closed to new replies.

Advertisement