Skip to main content
gamedev.net
🔒 Locked

Snake

Started by Mavster 30 replies 1.7k views
Original Post
Mavster
Mavster
I was just woundering about how difficult it would be to make a snake game like the good old ones. I've done programming for several years, but not that many games, and most of it was in VB and Delphi. So I was think about mabe doing snake as a way to learn C++. So if any of u guys have any comments, inputs or tips about the subject, I'd be happy to hear them. Cheers Mavster Edited by - Mavster on 6/27/00 10:13:33 AM
Muzzafarath
Muzzafarath
If you''ve programmed for several years, a snake game shouldn''t be that hard. Was that what you wanted to hear ?

- Muzzafarath

Mad House Software
The Field Marshals
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
farmersckn
farmersckn
boy, i have to tell you, that''s what i did for my final in C.S. and i spent so much time on it i''ve practically MEMORIZED the code... i could write it in my sleep, almost... so if you have any questions, like, "what''s a good method for keeping track of the postitions of things and stuff", or just about anything, e-mail me, or post them here.
farmersckn

Sometimes even chickens need to eat... Don't bang your head against a wall just to enjoy the good feeling when you stop.
Yesterday is the past, tomorrow is the future. Today is a gift, that is why we call it the present.
Indeterminatus
Indeterminatus
Just get a good documentation of C++, read it and then start coding

Your game should be very simple (hey...it is SNAKE! Snake IS simple ) so don''t spend too much time on music and such stuff.
You don''t need map routines, you don''t need a menu, you don''t really need a GUI...so don''t waste the time on coding useless stuff!

The first thing you have to get running is the snake moving around properly. Then you could implement a simple "collision-detection" system, that means that the game ends as soon as the snake bites in its own tail ...
The next step to do is to implement apples, mice, or whatever you want your snake to eat
Randomly spread that food over the screen and let the snake collect them.
The last thing to do is make the screen look nice and implement the scoring system.

But you can add some "new" features:

* Detect the "value" of the food. The snake doesn''t grow as much on eating an apple than on eating a mouse (for example)
* If you implement a mouse, what about letting it run around the screen? It sure is very funny to try to catch that mouse!

That''s all I can think of at the moment. I hope you can need that stuff anyway

Yours,

Indeterminatus

--consuetudo est quasi altera natura hominum...
Indeterminatus--si tacuisses, philosophus mansisses--
Buster
Buster
A snake game would be easy.
Gladiator
Gladiator
Snake was my first game ever and it took me less than an hour to write... And when I started game programming (2 months ago?!?) I had been programming for like 2 years or so in variety of languages... and I was just starting off with C/C++... So hey.. grab a few tuts from the net and buckle up... you''ll have your snake in no time... if you''re a fast learner.. If you need help with anything, we''ll be around.. so just drop us a line and you''re gonna get an answer.. most likely

..-=ViKtOr=-..
Indeterminatus
Indeterminatus
I wish you good luck! You''ll see: You''ll have the game very fast!

Yours,

Indeterminatus

--consuetudo est quasi altera natura hominum...
Indeterminatus--si tacuisses, philosophus mansisses--
Mavster
Mavster
Thanx for your response guys. Will get started on the game in one of the comming days. Have a book on C++ which looks good.

I''ll post a msg up here if I run into any trouble. Might even post a link where u guys can get it when it is finished, if any of u should be bored enough to want to play it.

Cheers

Mavster
Indeterminatus
Indeterminatus
Sup! I''m looking forward to seeing what you''ve actually done!
It sure is fun to play, and I can compare "your" Snake with "mine"...

Yours,

Indeterminatus

--si tacuisses, philosophus mansisses--
Indeterminatus--si tacuisses, philosophus mansisses--
Jaxks
Jaxks
How does your snake move. Does it "only" 4 directions in that case I won´t see much trouble.
But does anyone make game where snake does round curves i´ve seen one and believe that´s harder to make.
Btw check game named Boabite3d(Im not sure is it available anywhere else than Finland)
Rapier
Rapier
Now that sounds like fun. I suddenly feel moved to have a go at writing Snake myself. *laughs*

It will be interesting to see the differences between our approaches.




--== Rapier ==--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Save the whales, feed the hungry, free the mallocs!
--== Rapier ==--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Save the whales, feed the hungry, free the mallocs!
POINT
POINT
well if everyone else is writing one, i am too!

/me falls into a trance remembering the good ''ole days
CoiN
CoiN
GameDev should do a ''Who can write the best snake game'' Competition

Magicdude
Magicdude
Man, I never made a snakes game, heh, never thought it would be easy though
dog135
dog135
Heh, I remember writting one in 7th grade. Probably 2 pages of code MAX.

In HS I helped write a Tron type game. That''s fun to. We even had robot players.

E:cb woof!
E:cb woof!
Rapier
Rapier
Well, Mavster... Seems you have given us all something to do with our copious free time. *lol*

Point: Damned fine idea. *grins*

Coin: Indeed they should, but there is nothing stopping us doing it anyway, is there? What say we upload our versions to the showcase when we are done?

Magicdude: Why do I get the feeling that it isnt going to be as easy as we all think it is? *Laughs*



--== Rapier ==--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Save the whales, feed the hungry, free the mallocs!
--== Rapier ==--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Save the whales, feed the hungry, free the mallocs!
STVOY
STVOY
Well Now,

I once found Snake, Worms or as I like to call it
Nibbles coded in Turbo Pascal. It ran great. You
could choose your color, name or even choose
form exisiting characters. It had many colorful
and interseting levels to choose from and was actually
quite simply written. It was only about 330 to 590 lines.
I''ll ahve to find it for you when I have time.
You would probably find it a good resource anyway.

STVOY

Mega Moh Mine!!
POINT
POINT
quote:

I once found Snake, Worms or as I like to call it
Nibbles



worms, nibbles? am i thinking of the right game here? Worms was more like Scorched Tanks (absolute classic amiga game - which i did 90% of a remake of a few months back...), and i never heard of nibbles before...

i am thinking of the game where you control a snake on a 2d grid and collect targets which make your tail longer, the aim is to get the biggest tail.

if this aint the game you guys are thinking of, well, this rules too!
Rapier
Rapier
Point: Yeah, thats the game I am thinking of. The version I originally saw was on the C64, and as well as collecting targets, you could try nipping off your opponents tail (it was a 2 player game), but only if you got the bottom half of it. If you bit the upper half of your opponent, well, it was kinda like Tron Light Cycles.

STVOY: I would be intrested in seeing that version, if you could find it. For inspiration, dontcha know. *s*



--== Rapier ==--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Save the whales, feed the hungry, free the mallocs!
--== Rapier ==--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Save the whales, feed the hungry, free the mallocs!
ByteMe95
ByteMe95
Come on, who doesn''t know what Nibbles is???
I think Nibbles comes with every version of DOS, but maybe they dont ship it out anymore I''m not sure. Either way, it is the same Snake game that you guys are talking about. Nibbles comes with DOS as a basic file, Nibbles.BAS and you run it by running it through the BASIC compiler DOS comes with if im not mistaken.

Worms on the other hand is absolutely nothing like snake or nibbles, but the worms im thinking of is with groups of 4 fighting each other in a turn-based style using all kinds of weapons (Grenades, bazooka, missles, etc...)

Hope I cleared things up a bit
ByteMe95::~ByteMe95()My S(h)ite

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.