PDA

View Full Version : My snake



vasanth
05-26-2002, 10:13 AM
Here is a snake game made by me.. Have a look.. and please post back your sugestions...

incognito
05-26-2002, 10:16 AM
That is so freaking nice, congrats man, that's really good, too long huh?

vasanth
05-26-2002, 10:24 AM
Yep... But there are many bugs. Hope some of you can find more....

incognito
05-26-2002, 10:28 AM
and for this you used..........[enter programming languages here]

vasanth
05-26-2002, 10:30 AM
i Just used c++ Do you wana look at my source...

incognito
05-26-2002, 10:35 AM
Yes but it's going to make me cry I know it........because that must be really hard.......used a lot of arrays huh?

vasanth
05-26-2002, 10:38 AM
Well yes i used 4 array of each 1000 in size to store each position of the snake....

Weall then another snake of color black follows it to erase its tail.. That is how it works.. I have attached the source... Have a look..

PS:- The code is not yet all structured.. I have used a lot og GOTO instead of loops and stuff... So dont write back saying th source is not strutured because i know it is bad...

incognito
05-26-2002, 10:40 AM
Nice........for some reason I thought the codes would be longer.

vasanth
05-26-2002, 10:47 AM
Well it is not that long.. But you can still make it shot if you do it right.. And did you notice the bug.. When the snake runs over itself.. It dosent loose.. Well that is one bug.. I actually did a function hit() to take care of this.. but only work if i dont use kbhit() if i use kbhit() then the bug appears.. But without using kbhit() i cannot make the snake move itself.. See if anyone can solve this please........

Xterria
05-26-2002, 10:54 AM
sweeet game. I'm impressed!

vasanth
05-26-2002, 10:58 AM
Thanx...


it would be great if you guys can help me solve the problem i mentioned above..

Commander
05-26-2002, 11:04 AM
cool game man.....I like the way the snake reverses it's direction!

vasanth
05-26-2002, 11:07 AM
Thanx man


LOL but i was considering the reverse as a bug.. But thanx any way...

vasanth
05-26-2002, 08:56 PM
i see people only downloading my source but no reviews....

Vicious
05-26-2002, 09:27 PM
VERY NICE!!!
This is exactly what im tryin to acomplish.

I cant get the project to compile...
It says BGI graphics wont run under windows...

How did you compile it?

Oh and if you can tell me how you learned to use Graphics.h
i would be sooo happy

vasanth
05-26-2002, 11:56 PM
Ok the problem you are facing is you are trying to compile it is VC++ or some other compiler.. COmpile in in compilers like Turbo c++ ot the ones that support BGI library and thos which compile dos programs.. I think VC++ and Borland Builder have an option to compile dos programs try it...


And i learned to use BGI color library "graphics.h" by looking at the definition in the help and playing around with its functions....



Any more doubts?????

Vicious
05-27-2002, 12:12 AM
Well... Graphics.h was like made for borland....

and... I cant figure it out!! I tried a Dos app and still errors!?

Vicious
05-27-2002, 12:13 AM
Please help me if you can... I dont want to be stuck in ASCII forever :(

I would be sad and i wouldnt sare my crap if I had some...

vasanth
05-27-2002, 01:49 AM
Then compile it using a borland compiler...

I dint get your question ASCII???????

dbaryl
05-27-2002, 02:16 AM
Originally posted by vasanth
i see people only downloading my source but no reviews.... 245 points, woo-hoo! :D Let's see, for the reviews:

It's a neat game for it's size, thought it was quite interesting. A couple of thigs to improve on though:

1. sometimes as the snake goes across the apple the apple disappears but is not *eaten*. This happens then you go over the right-most part of the apple. In his case, you have to come back and walk over the empty spot to *eat* the apple.

2. Not sure how this should be done, but isn't the smake supposed to die when it runs into it's own body? Right now the only way it happens if oyu run into the wall. I was able to make some interesting loops with the snake at a bigger length, (past 100 points)...

Oh well, back to playing snake :)

vasanth
05-27-2002, 04:14 AM
Ok thanx.. I will look into those problems...

Gades
05-27-2002, 05:38 AM
Really nice piece of code.


Comments about the game:

1) I'd try to change the bip noise, it's annoying

2) maybe a bigger apple would be nicer. I've got problems to see that little thing on my 17"

3) good luck trying to solve that bug with hitting back the snake ;)


Comments about the code:

1) uauh, I thought it'd be much more complex than what you've done

2) I wouldn't know how to start if I wanted to do it by myself

3) I use Turbo C++ version 4.5 and I've got the same error you guys were talking about; so I couldn't compile it myself

Nice job :cool:

vasanth
05-27-2002, 07:07 AM
Ok i get your problem... Well you are using Borland 4.5 which i think compiles 32bit programs.. To compile my program use Turbo c++ v 3.0 or 3.5.. Well here is the link to download it

Still if does not work.. message me.. I aill mail you my compiler.. It will be just 3.5 MB....

And thanx for your coments.. I am workin on it... Well the code can still get smaller if you structure it properly...

vasanth
05-27-2002, 07:09 AM
Ok i get your problem... Well you are using Borland 4.5 which i think compiles 32bit programs.. To compile my program use Turbo c++ v 3.0 or 3.5.. Well here is the link to download it.. I guess my code is not ANSI standard.... May be it is because i leant c using this compiler...

http://www.siamcom.co.th/downloads/TC30.zip

Still if does not work.. message me.. I aill mail you my compiler.. It will be just 3.5 MB....

And thanx for your coments.. I am workin on it... Well the code can still get smaller if you structure it properly...

vasanth
05-27-2002, 07:12 AM
Many have downloaded the source .. I am sure for many it compiled... For thos who did get it compiled.. please post here.. So we can know what the problem is.....

alpha561
05-27-2002, 07:27 AM
Here I was thinking you'd posted a picture of your pet snake when it was your game!

Commander
05-27-2002, 07:36 AM
I played with the hiehest speed for 5 seconds!!!! :D go me :D

vasanth
05-27-2002, 08:49 AM
5 seconds with the highest speed... WOW.. i was not able to sustain even 2 seconds... Thats great....


And do you guys think i should make a key for manualy lengthning and shortening of the snake.. Like the speed is controlled...

vasanth
05-27-2002, 11:47 AM
ok guys thisthread is almost closed.. Have a look at the new thread My new advanced snake.. to download the latest i have odnt with a lot more features

pode
05-30-2002, 12:33 PM
just 1 more how what part of the code is the function
for how to make it move by itself?

vasanth
05-31-2002, 01:32 AM
kbhit();

Fountain
06-06-2002, 05:01 PM
smooth, nice and very nice

I love the way that darn snake moves.

im gonna llok at the source now..


NICE job

vasanth
06-07-2002, 04:45 AM
thanx.. I took an entire day to complete it..