Jump to content

  • Log In with Google      Sign In   
  • Create Account


Making a "Game" using C: Where should I start?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
11 replies to this topic

#1 ChaosMohawk   Members   -  Reputation: 94

Like
0Likes
Like

Posted 18 July 2011 - 08:54 PM

Hi guys! I want to make a "game" using the language C. It's sort of a task that I was assigned to, but I have no prior knowledge in Game Programming so it's kinda bumming me out. There are lots of intricate details in the specification manual that I got which adds more stress :)) I've tried looking for tutorials in the internet, but I haven't seen one that would really help me so I came to this site (via friend recommendation).

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:

chromium_salvation@yahoo.com
jerome_ibanez@dlsu.ph
jerome_ibanez@dlsu.edu.ph




Sponsor:

#2 Álvaro   Crossbones+   -  Reputation: 12362

Like
0Likes
Like

Posted 18 July 2011 - 09:34 PM

Learn C. Separate the input, the displaying of information and the game logic as clearly as you can. If you encounter problems making progress, post more specific questions.

#3 Ecofina   Members   -  Reputation: 88

Like
-3Likes
Like

Posted 18 July 2011 - 10:51 PM

Use a game engine instead, like GameMaker. C sucks anyway.

#4 Calmatory   Members   -  Reputation: 116

Like
2Likes
Like

Posted 18 July 2011 - 11:13 PM

Use a game engine instead, like GameMaker. C sucks anyway.

At least C grants you a job in software industry unlike GM. ;)




#5 Joe P   Members   -  Reputation: 166

Like
4Likes
Like

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.
Never, ever stop learning.
- Me

#6 Jesse7   Members   -  Reputation: 154

Like
3Likes
Like

Posted 19 July 2011 - 01:34 AM

...C sucks anyway.


That's an interesting comment coming from an aspiring game developer. I guess this person has never heard of Unix, Quake, or John Carmack.
Good judgment comes from experience; experience comes from bad judgment.

#7 szecs   Members   -  Reputation: 2102

Like
0Likes
Like

Posted 19 July 2011 - 01:40 AM

Start by learning C, as already suggested, then make a smaller game first, I would say. A "guess the number" game maybe, just to get the "feel" for it.

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".

#8 IggyT   Members   -  Reputation: 104

Like
-1Likes
Like

Posted 19 July 2011 - 02:29 AM

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.


EDIT: took out some bad information

Edited by IggyT, 19 July 2011 - 03:32 AM.


#9 SuperVGA   Members   -  Reputation: 1118

Like
0Likes
Like

Posted 19 July 2011 - 03:08 AM

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.

http://www.cplusplus...cstdlib/system/

system("cls");

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.

No, please don't do that. -When you can, avoid using system calls like that. Also C++ libs != C libs.
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...)

#10 ChaosMohawk   Members   -  Reputation: 94

Like
0Likes
Like

Posted 19 July 2011 - 03:15 AM

Thanks for the links guys!

By the way, I know how to use C, but like what I've said, I'm a total beginner :D

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.

#11 IggyT   Members   -  Reputation: 104

Like
0Likes
Like

Posted 19 July 2011 - 03:31 AM

If in the console you can use a simple

char map[20][70]; //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.

#12 MasterMas   Members   -  Reputation: 106

Like
0Likes
Like

Posted 19 July 2011 - 05:43 AM

Use a game engine instead, like GameMaker. C sucks anyway.



You can do a lot more in C than you can do in game maker. Anyway, keep going with C. It's a good script to use. I C++, but I'm not suggesting to use it.

Sam (MasterMas)
 





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS