hello im trying to write a text based game for class and not really sure where to start i was hoping i could get some pointers on how to start
hello im trying to write a text based game for class and not really sure where to start i was hoping i could get some pointers on how to start
How difficult do you want it to be?
The first thing to do is to pick a game:
* Guess a number.
* Guess a code.
* Guess a word. (hangman)
* Blackjack.
* Battleship.
* Craps.
* Crib. (or some other card game)
* Tic-tac-toe.
* Checkers.
* ...
That's just a sample. Your options are limitless.
im aiming for a text based adventure game kind of like D&D
btw im using pelles c so im kind of limited so far all the examples ive been looking at require which doesnt work with pelles
A text-based game can be made using only standard C, it should compile in all standard-compliant IDEs/compilers such as pellesC/gcc.
Why don't you start programming it and see where it takes you? It's almost certain that after a few months, you may want to rewrite it( as you'd have gotten experienced with the language ), but still...
Devoted my life to programming...
To make an adventure game you'll need data structures like the following.
Code:MAP --1-- | | 2 3 | | | 4 | | --5-- ROOMS Num Name Descrip 1 "The Dingo Room" "A dingo stands astride a mangled corpse." 2 "Release the Crack" "A crack .......... is smoking crack. There is crack here." 3 "Bill" "A wise old man smiles and pats his crotch." 4 "El Diablo Cheese Sandwicho" "Just use your imagination." 5 "Reflector" "Mirrors adorn every wall. The room still seems small, though." ROOM CONNECTIONS N E S W 1 0 3 0 2 2 1 0 5 0 3 1 0 4 0 4 3 0 5 0 5 0 4 0 2 ROOM OBJECTS RoomNum ObjNum(s) 1 2 2 1 3 0 4 3 5 0 OBJECTS ObjNum Name RoomNum 1 Crack 2 2 Magic Dingo Collar 1 3 Cheese Sandwich 4 4 Baseball Bat 0 PLAYER Location: 1 Inventory: 4, ... Score: 42
Games, even text-based, can be quite difficult for a beginner to implement. I am assuming you're a beginner, if you don't even know where to start. I would actually suggest you avoid a project like this for now, as it is more complex than you might realize.
If you still want to go ahead with this idea...
You need to start with a plan. If you don't have a plan, you are not anywhere near ready to begin coding "for real" (though writing little test snippets to check out ideas along the way is a good idea).
Do you have any ideas on how you want the game to work? For instance, some questions that pop to mind are:
- How will movement work? Will it be text-based like the old-style MUDs, or a "graphical" map made up of characters that show current location?
- What commands do you want to include?
- What kind of character information do you want to keep track of?
- What kinds of things do you want the player/character to be able to do?
- How will battles work?
The answer to each one of these questions will yield a host of details you will need to figure out before you even start thinking about how your program will be structured.
Once you have a plan ready, then "where to start" will become pretty obvious.