Hi everybody,
I had written this game long back but it was very primitive.
I've refined it a bit using curses library.
Check it out and let me know your feedback and suggestions.
btw, the game is to sort the numbers in ascending order
code for makefile
regardsCode:all: jigsort jigsort: main.o jigsort.o clist.o gcc main.o jigsort.o clist.o -o jigsort -lncurses main.o: main.c gcc -c main.c jigsort.o: jigsort.c gcc -c jigsort.c clist.o: clist.c gcc -c clist.c clean: rm -rf *o jigsort *jig
maverix
OS: Windows XP SP2
Compiler: Dev-C++
No graphics
Libraries: Normal
Language: C++
Type:Text Based
This is really my first game because I haven't had my computer for the last two months.
Anyways, this is another guessing game...nothing special, although I did add a score list that keeps track of who beat the game and in how long. Just simple file i/o.
The download contains the compiled application and the source file.
Download:http://huggiestutorials.bravehost.co...#37;20Game.rar
Last edited by RazzTheKid; 06-05-2008 at 12:52 AM.
I just sorted out some webspace to host my stuff; after sitesled kept deleting my old account for direct linking files and not sending anyone to my site
Anyway theres several games for download, a couple of javacript games to play in yer browser, plus some demos and other stuff I have made. Most of the stuff comes with the source too. Anyway, here you go:
http://grundez.googlepages.com/Index.html
OS: Windows XP SP3
Compiler: Dev-C++
Libraries: WinBGIm
Language: C++
Type:simple graphic shooter
source code attatched
unable to upload compiled version to this post
link to download compiled version:
simple game
Atlantis
Screenshot: http://dwks.theprogrammingsite.com/m...antis-ss-1.png
Download: http://dwks.theprogrammingsite.com/myprogs/atlantis.htm
Thread: http://cboard.cprogramming.com/showt...wpost&t=106713
I just thought I'd mention Atlantis here. Atlantis is a board game that I've been writing in C++ recently. It's a clone of the (physical) board game Escape from Atlantis.
Atlantis uses the SDL, and so it runs on Windows and Linux. (In fact, I have compiled binaries for both -- see the download link above.) It's not as efficient as it could be, but on an 800MHz processor it runs at 30FPS without using all of the processor (about 80%, and I've played it before on a 400MHz one. (Being a board game, if it's a little slow, it's not much of a problem.)
Right now there isn't an AI, unfortunately. Play yourself or find someone else.
Anyway, if you like it, tell me what you think in the thread above.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
The first game I ever finished completely, RockPaperScissors with sound! Not very good, but an upgraded version will appear in DarkRPG, eventually.
An upgraded version of the second game I made, Lemonade Stand also with sound.
Both are WINDOWS XP only. Compiled in Dev-C++ 4.9.9.2
Hatman Approves!
Here is an updated version of my Dungeons and Dragons 4th Edition full game.
If anybody has a problem of me not posting the code please feel free to ask for it. I 'll just post a .rar file (rename .c file) which contains the folder with the .exe (dd.exe) and the images+sounds.
I hope it is obvious how to play. Some instructions might be missing..
If you want a quick start press Load Game and type "quick".
And I have to mention that the game is underdevelopment. I tried to debug the current version and it doesn't seem to have any serious bug (I hope).
Enjoy and report bugs
EDIT: Hmm it exceeds the maximum file. Oh, well go here http://uploading.com/files/KSYHRSL5/dd4E.rar.html
Last edited by C_ntua; 12-22-2008 at 01:31 PM.
Ya know, this is a good thread, but a little to slow moving. I mean, 3 years, still sticked, and only 8 pages? I'm gonna throw one out here:
See how good you can count Mississippis.Code:Operating system: Any Compiler: MinGW, but it should work for any Graphics Library: stdio.h Other Libraries: Description: Reflex
Type-ins are back! Visit Cymon's Games at http://www.cymonsgames.com for a new game every week!
Game Title: Dwarf Caretaker
Version: 0.5
Operating System: XP
Compiler: Code::Blocks w/ Mingw
Graphics Library: Console
Description: A sort of sim game (very) loosely based on the world sim game, Dwarf Fortress. This is my first real project that isn't out of a book or tutorial, so despite how simple (and boring...) it currently is, I'm rather proud of it. The code is probably horribly written, and once I've gotten a few other things cleaned up I may rewrite it completely to make use of some of the things I've learned along the way.
Download: v0.6 - Includes source files, README Guide and compiled EXE
Comments, critisism, advice, bug reports, etc. should be sent to [email protected], thank you!
I'm apparently not allowed to attach .zip files to my posts, so the source code is attached as separate files, and the pre-compiled version with the guide is avaliable via the zip file above. I know I'm not supposed to use outside links, but since I can't upload exe, zip or rtf files I don't see any other way to make them available. There is a discussion topic for my game here.
[EDIT]: I almost forgot, there are quite a few Dwarf Fortress reference in the game that may not make any sense to someone who hasn't played it. My appologies, but it was originally intended for the DF community, and besides, if you haven't played Dwarf Fortress at least once you should go play it now anyways.
v0.4 Update:
- Bug Fix - Ale was free
- Bug Fix - "Opponent" was spelled wrong
- NEW - Waiting now makes you hungry/thirsty and passes the time.
- NEW - You can now choose how difficult you want a fight to be. At the moment, easy is the same as moderate unless you have at least 3 toughness.
v0.5 Changes:
- NEW - Complete re-write to clean up code and make future developement easier.
- NEW - Winning a sparring match now increases toughness by 0.5 and happiness by 15, losing causes a loss of 15 happiness, and win or lose you get hungry and thirsty.
- NEW - When quiting you can choose to save and exit, exit without saving, or not exit at all.
- NEW - Heavy and Light work have been combined into "Work", and are options given to you after choosing to work.
v0.6 Update:
- BUG FIX - Player can die of starvation and dehydration again.
- NEW - The maximum damage to any wound is increased by 1 for every 3 levels of toughness..
- NEW - Death screen asking if you want to quit or restart.
- NEW - ASCII art title screen!
- NEW - Renamed and added choices to eat, drink and work to better represent DF.
- NEW - Leaving happiness at 1 can now result in your dwarf commiting suicide.
Last edited by timmeh; 09-07-2009 at 08:29 PM.
Game Title: Dwarf Caretaker
Version: 1.3
Operating System: Built for Windows XP, although it may work on others with minimal changes.
Compiler: Code::Blocks w/ Mingw
Graphics Library: PDCurses
Description: I recently finished version 1.3 of my "Dwarf Caretaker" game. I know I'm supposed to edit my old post, but for whatever reason vBulletin won't let me...
As it is, unless something changes to make updating the post here easier, I think I'll just stick to updating it's topic on the DF forums, the google code page, and the blog. As a side effect, while the external links I'll post in addition to the source code I'll upload directly will always be current, the source code here may or may not be, depending on my ability to change it later without having to make a new post....
If any of the mods get's a chance, I'd really appreciate it if they could either merge this post with my old one, or delete the old one.
[EDIT]: Now that I think about it, the source code here is actually slightly different from the v1.3 code, as it's part way through the next update... all I've done is a quick bug-fix (gotta stop dividing by zero...) though, so it should be fine.
Last edited by timmeh; 09-22-2009 at 03:45 PM. Reason: Forgot something...
My Dev Blog - The most up-to-date info on my current projects.
You can download a .zip of my game here
http://bijanscrap.webng.com/Downloads/Duck_Hunt.zip
Operating system: Windows 7 (it should still work with vista and XP)
Compiler: Code::Blocks 10.05
Graphics library: Win32 API
Other Libraries: libmsimg32.a, libwinmm.a
Description: Shoot the ducks as they fly by
Please PM me if you have any suggestions.
Last edited by bijan311; 09-12-2010 at 10:00 AM.
Operating system: Windows
Compiler: Dev-C++ 4.9.9.2
Graphics Library: OpenGL
Description: Sudoku (easy - medium)
Basic Sudoku Program. It randomly generates puzzles and allows the user to play them. All the source code is included. If anyone notices more optimal generation techniques please let me know. It currently takes it 5-30 seconds to generate a new sudoku.
Playing.. You'll notice a square "highlighted in red" this moves if you press arrow keys.. left, right, up, down. If you want to enter a choice just press a number 1-9 after you have highlighted the square. Pressing enter at ANY time playing will generate a new sudoku puzzle.
Sudoku.zip
Enjoy!
*Update 19th Sept 10 - updated and all update information can be viewed in the readme file included in the zip
All future projects will be hosted at Sudoku
Last edited by laserlight; 09-27-2010 at 01:26 PM.
Here is my first game:
Language: C
Compiler: Dev-C++
OS: Windows.
Type: Console app.
To download .exe:
Wikisend: free file sharing service
Source Code:
Code:#include <stdio.h> #include <ctype.h> #include <stdlib.h> #include <windows.h> #include <conio.h> #include <limits.h> #include <dos.h> #include <stdlib.h> #define up 1 #define down 2 #define right 3 #define left 4 /*Global Variables*///---------------------------------------------------------- unsigned long long int score; int foodx, foody, snake_length, direction = right, digest = 0; char keypress; struct snake_segment { int x, y; } snake[2000]; const int snake_start_x = 33, snake_start_y = 7; /*Functions*///----------------------------------------------------------------- int random (int number_posibilities){ static long int h=9; h++; srand ((time(NULL)+h+9)*h); return ( rand() % number_posibilities ); } //------------------------------------------------------------------------------ void clear_screen ( void ){ DWORD n; /* Number of characters written */ DWORD size; /* number of visible characters */ COORD coord = {0}; /* Top left screen position */ CONSOLE_SCREEN_BUFFER_INFO csbi; /* Get a handle to the console */ HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE ); GetConsoleScreenBufferInfo ( h, &csbi ); /* Find the number of characters to overwrite */ size = csbi.dwSize.X * csbi.dwSize.Y; /* Overwrite the screen buffer with whitespace */ FillConsoleOutputCharacter ( h, TEXT ( ' ' ), size, coord, &n ); GetConsoleScreenBufferInfo ( h, &csbi ); FillConsoleOutputAttribute ( h, csbi.wAttributes, size, coord, &n ); /* Reset the cursor to the top left position */ SetConsoleCursorPosition ( h, coord ); } //------------------------------------------------------------------------------ void gotoxy(int x, int y){ COORD coord; coord.X = x; coord.Y = y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord); } //------------------------------------------------------------------------------ void clearxy (int x, int y){ DWORD n; COORD coord; coord.X = x; coord.Y = y; CONSOLE_SCREEN_BUFFER_INFO csbi; HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE ); GetConsoleScreenBufferInfo ( h, &csbi ); FillConsoleOutputCharacter ( h, TEXT ( ' ' ), 1, coord, &n ); GetConsoleScreenBufferInfo ( h, &csbi ); FillConsoleOutputAttribute ( h, csbi.wAttributes, 1, coord, &n ); } //------------------------------------------------------------------------------ void cursoroff ( void ){ HANDLE hOut; CONSOLE_CURSOR_INFO ConCurInf; hOut = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTitle("No Cursor"); ConCurInf.dwSize = 10; ConCurInf.bVisible = FALSE; SetConsoleCursorInfo(hOut, &ConCurInf); } //------------------------------------------------------------------------------ void color_red (void){ HANDLE h; h = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute ( h, FOREGROUND_RED | FOREGROUND_INTENSITY ); } //------------------------------------------------------------------------------ void color_green (void){ HANDLE h; h = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute ( h, FOREGROUND_GREEN | FOREGROUND_INTENSITY ); } //------------------------------------------------------------------------------ void color_blue (void){ HANDLE h; h = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute ( h, FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY ); } //------------------------------------------------------------------------------ void color_yellow (void){ HANDLE h; h = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute ( h, FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY ); } //------------------------------------------------------------------------------ void color_normal (void){ HANDLE h; h = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute ( h, FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE ); } //------------------------------------------------------------------------------ int getx (void){ int x; HANDLE hOut; CONSOLE_SCREEN_BUFFER_INFO SBInfo; hOut = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(hOut, &SBInfo); x =SBInfo. dwCursorPosition.X; return x; } //------------------------------------------------------------------------------ int gety (void){ int y; HANDLE hOut; CONSOLE_SCREEN_BUFFER_INFO SBInfo; hOut = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(hOut, &SBInfo); y =SBInfo. dwCursorPosition.Y; return y; } //------------------------------------------------------------------------------ enum { KEY_ESC = 27, ARROW_UP = 256 + 72, ARROW_DOWN = 256 + 80, ARROW_LEFT = 256 + 75, ARROW_RIGHT = 256 + 77 }; //------------------------------------------------------------------------------ static int get_code (void) { int ch = getch(); if ( ch == 0 || ch == 224 ) ch = 256 + getch(); return ch; } //------------------------------------------------------------------------------ void walls (void){ int i, j; for (i=0;i<=23;i++) if (i==0 || i==23){ for (j=1;j<=80;j++) printf ("%c", 177); } else { printf ("%c", 177); for (j=1;j<=78;j++) printf (" "); printf ("%c", 177); } } //------------------------------------------------------------------------------ void intro (void){ cursoroff(); color_blue(); gotoxy(37,10); printf ("SNAKE"); gotoxy(25,13); printf ("An Alfio Vidal Amian's creation"); sleep(3000); } //------------------------------------------------------------------------------ void put_food (void){ int i, x = getx(), y = gety(), same; do{ foodx = random(76)+1 , foody = random(19)+1; for (i=0;i<=snake_length;i++) if (foodx == (snake[i].x) && foody == (snake[i].y)) same = 1; }while (same == 1); gotoxy (foodx,foody); color_red(); printf ("%c", 2); color_normal(); gotoxy(x,y); } //------------------------------------------------------------------------------ void set_game (void){ int i; snake_length = 5; score = 0; keypress = 'z'; clear_screen(); color_green(); walls(); color_normal(); put_food(); printf (" SCORE: %5d Alfio Games %c", score, 184); cursoroff(); for (i=0;i<snake_length;i++) { snake[i].x = snake_start_x+i; snake[i].y = snake_start_y; } } //------------------------------------------------------------------------------ void display_menu (void){ clear_screen(); color_yellow(); printf ("\n SNAKE"); printf ("\n\n\n\n"); printf (" Press 1 to PLAY\n"); printf (" Press 2 for Instructions\n"); } //------------------------------------------------------------------------------ void display_instructions (void){ clear_screen(); printf ("\n\n\n"); printf ("\n Move arround using the keyboard arrows."); printf ("\n Press any other key to PAUSE."); printf ("\n Press ESC to exit game."); printf ("\n Earn points and grow as you collect food."); printf ("\n Avoid the walls and yourself."); color_red(); printf ("\n\n\n\n\n Press any key to return to MENU"); } //------------------------------------------------------------------------------ void clear_segment (void){ int i; gotoxy (snake[0].x, snake[0].y); printf(" "); for (i=1; i<=snake_length; i++) snake[i-1] = snake[i]; } //------------------------------------------------------------------------------ void add_segment() { switch(direction) { case(right): snake[snake_length].x=snake[snake_length-1].x+1; snake[snake_length].y=snake[snake_length-1].y; break; case(left) : snake[snake_length].x=snake[snake_length-1].x-1; snake[snake_length].y=snake[snake_length-1].y; break; case(up) : snake[snake_length].x=snake[snake_length-1].x; snake[snake_length].y=snake[snake_length-1].y-1; break; case(down) : snake[snake_length].x=snake[snake_length-1].x; snake[snake_length].y=snake[snake_length-1].y+1; } gotoxy(snake[snake_length].x,snake[snake_length].y); printf ("%c", 219); } //------------------------------------------------------------------------------ void show_score (void){ color_normal(); gotoxy(2,24); printf (" SCORE: %5d Alfio Games %c", score, 184); } //------------------------------------------------------------------------------ void collision_detection (void){ int i; if ( (snake[snake_length-1].x>78) || (snake[snake_length-1].x<=0) || (snake[snake_length-1].y>22) || (snake[snake_length-1].y<=0) ) keypress = 'x'; for (i=0;i<snake_length-1;i++){ if ((snake[snake_length].x)==(snake[i].x)&& (snake[snake_length].y)==(snake[i].y)){ keypress = 'x'; break; } } if ( (snake[snake_length-1].x == foodx) && (snake[snake_length-1].y == foody) ){ score+=snake_length; show_score(); digest = 1; snake_length++; put_food(); } } //------------------------------------------------------------------------------ main () { int ch, ans, i, menu_op, x, y; intro(); menu: cursoroff(); display_menu(); sleep(500); do{ menu_op = getch(); }while (menu_op < 49 || menu_op > 50); if (menu_op == 50){ display_instructions(); if (getch()) goto menu; } game_start: if (menu_op == 49) set_game(); for (i=0;i<snake_length;i++) { gotoxy(snake[i].x,snake[i].y); printf("%c", 219); } while ( ( ch = get_code() ) != KEY_ESC && keypress != 'x' ) { /* Game loop */ switch ( ch ) { case ARROW_UP: do{ direction = up; add_segment(); if (digest == 1){ add_segment(); digest = 0; } clear_segment(); sleep(80); collision_detection(); if( kbhit() ) { ch = kbhit(); break; } }while (ch == ARROW_UP && keypress !='x'); if (keypress !='x') break; break; case ARROW_DOWN: do{ direction = down; add_segment(); if (digest == 1){ add_segment(); digest = 0; } clear_segment(); sleep (80); collision_detection(); if( kbhit() ) { ch = kbhit(); break; } }while (ch == ARROW_DOWN && keypress !='x'); if (keypress !='x') break; break; case ARROW_LEFT: do{ direction = left; add_segment(); if (digest == 1){ add_segment(); digest = 0; } clear_segment(); sleep(60); collision_detection(); if( kbhit() ) { ch = kbhit(); break; } }while(ch == ARROW_LEFT && keypress !='x'); if (keypress !='x') break; break; case ARROW_RIGHT: do{ direction = right; add_segment(); if (digest == 1){ add_segment(); digest = 0; } clear_segment(); sleep(60); collision_detection(); if( kbhit() ) { ch = kbhit(); break; } }while(ch == ARROW_RIGHT && keypress !='x'); if (keypress !='x') break; break; } } if ( ch == KEY_ESC ) goto menu; if (keypress=='x'){ clear_screen(); walls(); gotoxy(29,9); color_red(); printf ("G A M E O V E R"); color_normal(); gotoxy (33,11); printf ("Score = %5d", score); color_yellow(); gotoxy (32,13); printf ("play again? Y/N"); do{ ans = getch(); }while (ans!=121 && ans!=89 && ans!=78 && ans!=110); if (ans == 121 || ans == 89) goto game_start; else goto menu; } sleep (10000); }
Here is a little 4x4 grid of match the picture cards. There is no score or timer, this is my first go at making a game with graphics.
The source code is included, minus the pictures - due to the fact I thefted them from online sources.
Used Code::Blocks and SDL (including SDL_image.h which is an extension lib for using file types other than .BMP).
I used 199 x 199 sized pics for the cards, if you want to put your own pics in.
Please leave me some feedback on how things could be better, or how I should have done something other than how I did it.
Memory.zip