gfxgfxFreeBASIC Games Directory Forumgfxgfx
gfx gfx
gfx
Welcome, Guest. Please login or register. May 28, 2017, 02:30:48 AM

Login with username, password and session length
14.09.2014 - Check the results of our latest game dev competition here: http://games.freebasic.net/forum/index.php?topic=606.0
gfx
gfx
*
gfxgfx
gfxgfx gfxgfx
gfxgfx Home Help Search Login Register   gfxgfx
gfx gfx
gfx
Pages: [1]
Print
Author Topic: Snake  (Read 4500 times)
hd_
Recruit
**
Posts: 35


View Profile
« on: February 25, 2008, 05:56:19 AM »

Simple snake game:

Features (exaggerated):
-Super elite modern cell shading techniques!
-Fast paced action!
-Multiplayer action extends the fun for everyone!
-All new complexicated obstacles!
-Bonus foods!

Screenshot:
new:


old:


My Top score:
All previous top scores are invalid.

Download:
Snake 0.2.1 [NEW]
Snake 0.2
...old...

What's new:
-Source code cleaned up.
+Multiplayer (single computer).
 -Can be set so that snakes die when the collide.
 -Can be set so that snakes die when they collide into dead snakes.
 -When multiple snakes collide at the same time, and snake_snake_collision is true, then they both die.
 -When multiple snakes reach an item at the same time, they both receive the same points for it.
-bonus items.
-obstacles.
-The bug which caused keys to sometimes not get detected is now fixed.

Future plans:
-computer opponents.
-graphics updates
-menus
-obstacle editor which also allows you to set up where the next food should spawn, and where and when the next bonus should spawn. (sort of like a mission editor or something)

Distant future plans:
-network multiplayer

Other Notes:
Quote
-SDL_GL_SetAttribute(16,1): 16 is the code for SDL_GL_SWAPCONTROL, not a part of the SDL headers supplied with FB (they are old). SDL_GL_SWAPCONTROL sets vsync.
-Adding SDL_Delay() to the time wasting while loop stops your program from hogging resources.
-The examples demonstrating SDL+GL+FB show the use of SDL_DOUBLEBUF flag- however SDL tuts suggest NOT to use this, and to SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER,1)
« Last Edit: February 25, 2008, 05:17:24 PM by hd_ » Logged
nkk_kan
Forum Howler
****
Gender: Male
Posts: 186

Let's rocK~!

nkk_kan
View Profile WWW Email
« Reply #1 on: February 25, 2008, 07:13:39 AM »

excellent! two player adds life to the game! Tongue

one tiny thing...
Quote
-Can be set so that snakes die when the collide.
 -Can be set so that snakes die when they collide into dead snakes.
how do you set this?
also some more info in readme would help Tongue
Logged

hd_
Recruit
**
Posts: 35


View Profile
« Reply #2 on: February 25, 2008, 03:54:48 PM »

You have to set it in the code, main.bas:
players.snake_snake_collision=0
players.dead_snake_collision=0

Set it to how you want.

Just so so you know, you can set it to single player or up to 8 players through the code as well, in main.bas. It's pretty simple, the arguments are:
players.addPlayer("NAME",RED,GREEN,BLUE,X,Y,DIRECTION)
Direction is either SNAKE_UP, SNAKE_DOWN, SNAKE_LEFT, SNAKE_RIGHT.

Also, you can change the size of the play field by changing HCELLS and WCELLS (they are #defines).

I will try get menus into the next version Tongue


edit:
*Facepalm* - whoops, food can land on the obstacles Tongue I didn't test the obstacles too thoroughly last night (just whacked them in and shipped it Tongue). I upload the new version when I get a chance.
« Last Edit: February 25, 2008, 03:59:59 PM by hd_ » Logged
Lachie Dazdarian
Double dipper
Administrator
Forum Sage
*****
Gender: Male
Posts: 1255


lachie13
View Profile WWW Email
« Reply #3 on: February 25, 2008, 04:50:39 PM »

Very nice work. Only, the white line with dark edges had a strange charm to it.

Any chance to code a computer opponent?

And yes, you really need menus if you are aiming to release a proper game. I also recommend you to compile some sort of challenge mode whose properties the player won't be able to change. Otherwise, you'll get a very customizable toy and not a game.

Also, did you try to experiment with the background, like making it shaded? You know, like the blue background in Adigun's Pixel Craft program. Don't know if it would work, but maybe you should do some tests just to see. Same thing with the snakes' body going more and more dark as it goes away from the head. Well, at least to some extent. Experiment!
Logged

"Things like Basic and Free Basic provide much-needed therapy and a return to sanity and a correct appreciation of people. The arrogant folk really hate a word like 'Basic' - fine, and good riddance." ~ pragmatist
hd_
Recruit
**
Posts: 35


View Profile
« Reply #4 on: February 25, 2008, 05:10:19 PM »

I uploaded the fixed version.

Quote
Very nice work. Only, the white line with dark edges had a strange charm to it.
You are right, in 0.2.1 there are now 2 exes: '2playerSnake.exe' and '1playerSnake.exe'. 1 player snake has the screen size reduced and the colour set back to white Wink But of course in multiplayer, not everyone can be white- it's confusing enough as it is Tongue

Quote
Any chance to code a computer opponent?
Yes Smiley I was thinking it might be cool if I set up the framework for it, then others could have a go at writing their own ai. Then there could be a battle Tongue

Quote
And yes, you really need menus if you are aiming to release a proper game. I also recommend you to compile some sort of challenge mode whose properties the player won't be able to change. Otherwise, you'll get a very customizable toy and not a game.
I agree here as well, lots of tiny factors can change the number of points you can easily score, so a mode where nothing can be changed is necessary for top score tracking.

Quote
Also, did you try to experiment with the background, like making it shaded? You know, like the blue background in Adigun's Pixel Craft program. Don't know if it would work, but maybe you should do some tests just to see. Same thing with the snakes' body going more and more dark as it goes away from the head. Well, at least to some extent. Experiment!
I haven't yet Tongue I will see what I can come up with Wink
Logged
Pages: [1]
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Cerberus design by Bloc
Valid XHTML 1.0! Valid CSS!
gfx
gfxgfx gfxgfx