Making a "Game" using C: Where should I start?
Members - Reputation: 94
Posted 18 July 2011 - 08:54 PM
So I'm asked to make this "game" wherein there is a walled environment (min size is 20 rows x 70 columns). So there is no real objective in this game. There are supposed to be 3 big blocks and then there is a character that is supposed to move in all directions (up, down, left, right, and diagonally). The user can generate food, and the user can also make that character eat the food. The user can make the character run (move 2x it's normal speed) and the user can also generate blocks, separate from those 3 blocks and the user can make the character move those blocks.
Another complicated thing is that the user should have the ability to change the character's color and the blocks beside it (Think of it as sort of like de Blob).
Soooooo, how do you guys suppose I start? Any help will be HIGHLY appreciated. Thank you and God Bless!
P.S. You guys can also reach me through:
Members - Reputation: 166
Posted 18 July 2011 - 11:48 PM
Use a game engine instead, like GameMaker. C sucks anyway.
Its scary that new people get advice from someone like yourself. That was the most useless, un-informed post Ive seen in a while. C sucks anyway? What does that even mean?
EDIT: I just realized you started the thread about making a WoW clone in a summer with a friend. This is all clear now.
Members - Reputation: 2102
Posted 19 July 2011 - 01:40 AM
Solving these tasks basically mean breaking down the problem. It's fairly easy with your game, if you are a bit more experienced.
First, you need to display something (maybe just "place holder" "graphics"), but it's important to see what you are doing. Display something, then hard code the maze (manually filling out an "array" in the source code), then display it.
Then, "make the character": a little block that you can move around with the keyboard for example (during game development, you will implement lots of stuff that will be totally dropped later, but you will need those temporary quickly-hacked stuff to be able to test your important functions/features).
Next (if I understand correctly), you will need to perform some kind of order mechanism: implement input (to be able to determine to which "tile" the character needs to move). Then implement movement to that tile (discard walls at this point)
Next (if I understand correctly), you will need to implement "path finding", to avoid and navigate between walls.
After that, all the other fancy stuff should be pretty straightforward.
So: this task is a bit out of reach if you are a total beginner, start with something simpler, then move on to this "project".
Members - Reputation: 104
Posted 19 July 2011 - 02:29 AM
If not, and working with only console application, then something you'll want to look into is how to clear the screen so that each new display is the only thing displayed.
EDIT: took out some bad information
Edited by IggyT, 19 July 2011 - 03:32 AM.
Members - Reputation: 1118
Posted 19 July 2011 - 03:08 AM
No, please don't do that. -When you can, avoid using system calls like that. Also C++ libs != C libs.
Are you talking about making a DOS game?
If not, and working with only console application, then something you'll want to look into is how to clear the screen so that each new display is the only thing displayed. There are C libraries just for that that you'll want to look for.
Is the function I've used in the past to clear the screen in a windows console application. It's part of the cstdlib. I've meddled with console based games before but the most I've made is a card game for which I used system("cls");
That's the only tip I feel comfortable with giving at this point, and alvaro gave good advice on how to start thinking about your project.
Chcek out this great tutorial if you want to create a proper Windows platform-dependent console application: http://www.adrianxw..../Consoles1.html
(And native console applications are always platform dependant. -Creating your own console in your favourite cross-platform graphics library is a possibility for platform independence...)
Members - Reputation: 94
Posted 19 July 2011 - 03:15 AM
By the way, I know how to use C, but like what I've said, I'm a total beginner
So how do you guys suppose i make the border of the game?
@Iggyt: Yep, I've thought of doing it like that, similar to those old text based RPGs.
Members - Reputation: 104
Posted 19 July 2011 - 03:31 AM
char map; //array
And then use loops to set the outlying borders. Then a simple collision check would be to see when the character moves if that next space is whatever you use for borders, and if it is then -1 from his current location after you calculated that movement so that he's not inside the border before you display.
alternatively you can set the borders at the declaration of the array, too.
@SuperVGA ...huh, I had no idea they were so messy. I received the code from a friend that had been using it a while and blindly trusted it, thanks for the link.