| | |
Mapping Program for Game
Thread Solved |
•
•
Join Date: Nov 2008
Posts: 29
Reputation:
Solved Threads: 0
This was orignally posted in C++ Foums:
Hey, I'm new to this forum.
I'm having trouble making a mapping/navigation type program.
Kind of like one where you type in "N" and you go north. But more complex, scince i'm creating an rpg. (In command prompt console) I need to have the map visible. I would need to add things and properties to certian positions on the map. I've already created a complexish battle system that works. (If you need me to post my program, I will.)
If anyone could get me started in the right direction at least, I would be very appreciative.
It would have to be non linear. I know how to make linear mapping programs, but what is the fun in that?
Here is an example of what I need my code to do:
You are here: x=14,y=18
|F|R|F|
|F|X|F|
|M|R|F|
F, Being Forests,
X, Being current position,
M, Being Mountian or somthing,
R, Being road or somthing.
cin>>input;
"N"
(The new map would perhaps look like this)
You are here: x=15,y=18
|F|T|F|
|F|X|F|
|F|R|F|
T, Being town.
Maybe there is a battle there, And I would access that code if there were.
If this helps any, please let me know.
Hey, I'm new to this forum.
I'm having trouble making a mapping/navigation type program.
Kind of like one where you type in "N" and you go north. But more complex, scince i'm creating an rpg. (In command prompt console) I need to have the map visible. I would need to add things and properties to certian positions on the map. I've already created a complexish battle system that works. (If you need me to post my program, I will.)
If anyone could get me started in the right direction at least, I would be very appreciative.
It would have to be non linear. I know how to make linear mapping programs, but what is the fun in that?
Here is an example of what I need my code to do:
You are here: x=14,y=18
|F|R|F|
|F|X|F|
|M|R|F|
F, Being Forests,
X, Being current position,
M, Being Mountian or somthing,
R, Being road or somthing.
cin>>input;
"N"
(The new map would perhaps look like this)
You are here: x=15,y=18
|F|T|F|
|F|X|F|
|F|R|F|
T, Being town.
Maybe there is a battle there, And I would access that code if there were.
If this helps any, please let me know.
•
•
Join Date: Nov 2008
Posts: 29
Reputation:
Solved Threads: 0
int x;
x = 2;
int y;
y = 2;
//Definition of MAP ARRAY//
char commandmpdir;
char N;
char W;
char S;
char E;
// 0123//
//0XXXX//
//1XXXX//
//2XXXX//
//3XXXX//
//TESTING//
string MAP[3][3];
MAP[0][0]= "|I|";
MAP[0][1]= "|I|";
MAP[0][2]= "|I|";
MAP[0][3]= "|I|";
MAP[1][0]= "|I|";
MAP[1][1]= "|G|";//thing
MAP[1][2]= "|R|";//thing
MAP[1][3]= "|I|";
MAP[2][0]= "|I|";
MAP[2][1]= "|M|";//thing
MAP[2][2]= "|F|";//thing
MAP[2][3]= "|I|";
MAP[3][0]= "|I|";
MAP[3][1]= "|I|";
MAP[3][2]= "|I|";
MAP[3][3]= "|I|";
goto maptest;
//Fisrt Lockup:
{
maptest:
cout<<MAP[y-1][x-1];cout<<MAP[y-1][x+0];cout<<MAP[y-1][x+1]<<endl;
cout<<MAP[y+0][x-1];cout<<MAP[y+0][x+0];cout<<MAP[y+0][x+1]<<endl;
cout<<MAP[y+1][x-1];cout<<MAP[y+1][x+0];cout<<MAP[y+1][x+1]<<endl;
Restart:
cout<<"Which Direction do you want to go in? N,S,E,W?"<<endl;
cin>>commandmpdir;
}What happend? It locks up, too much memory being used? Can someone tell me?
Last edited by Shinedevil; Nov 24th, 2008 at 5:43 pm.
![]() |
Similar Threads
- Starting "Java" [Java tutorials / resources / faq] (Java)
- How do I write code for PAC MAN! (C++)
- 2D Game Mapping... (Python)
- Arrays (Assembly)
- Card dealing game (Java)
- recommendations 4 a 3D graphics prog? (Graphics and Multimedia)
Other Threads in the Game Development Forum
- Previous Thread: best language to program in and when to get a patent.
- Next Thread: letterlasso game
| Thread Tools | Search this Thread |
3d advertising ai algorithm ban c++ cambridge camera censorship china competition console development engine fov fpx game gamer games gaming gauntanamo government idaho in-gameadvertisement intellectualproperty l-systems laracroft lindenmayer live manhunt math mathematics matrix mercenaries microsoft mmorpg modded msn naked news nintendo obama opengl palin physics pirate playstation politics projection ps3 rpg search selection software sony stephenhawking stocks studio technology terrorism tombraider uk videogame web wii world-of-warcraft xbox xbox-live xbox360





