MADE MY FIRST TILE BASED GAME/MAPMAKER

Started by
7 comments, last by XDaWNeDX 12 years, 10 months ago
I'm SO proud of myself.

But I'm at school right now, and didn't have internet when I made it.

I did LITTLE research on tile based games. Basically learned that it loads a file with 1s/2s in it and that's about it.

The only downsides are that it's... A console based tile based game.

I have a mapmaker with it, 1-2 = walls, 3 = ground, 4 = monsters, 5 = player 6 WILL = boss, 7 WILL = portal.(max of one player.)

You make the map full of 1/2/3/4/5 then you save the file (it's a console based application, so it kinda automatically does that.)

Then I load up my engine. A.K.A the OTHER console based application, and all the 1's become |, 2's _, 3's . 4'sM and 5 is P, 6 is B and 7 O.

It opens up and displays the map, however it was built, and prompts the user to enter w/a/s/d to move the Player.
Upon movement of the character, the screen gets cleared and reloaded, prompting the user to move again. (Currently no AI, although I would presume it would be EXTREMELY easy in this.)

When the user comes in contact with a monster (same space.) the screen gets cleared and displays about 100-200 1's/0's on the screen. (That's my loading screen into battle. Random number between 100 and 200.)

It then displays a more in depth Monster created in ASCII :D the monsters HP/MP
Your HP/MP/Skills

You select a skill, which uses assorted MP to use.
Then the monster will use "attack" and deal X-X damage

After the monster battle, theres really nothing to do...

TODO:

Add items, portals, more maps, bosses, weapons, defence, attack points, skill upgrades, stats, NPC's, monsters respawn randomly on a space that is NOT the characters after a monster battle, create a better map maker, create a GUI for this game, make it a 2d SIDE SCROLLER. Rather than top-down. (jeez, wonder how hard that would be... Making a console simulate jumping based on w/a/s/d input?...)


So yeah, I actually made this and feel EXTREMELY happy!

/ discuss. I've been brainstorming on a whiteboard for a while now and can't think of a way to get the monsters to respawn NOT on a wall or characters position. Although if I had code in front of me I'm sure I could.

I would assume that it would be select two random numbers (x/y coordinates)

if those x/y coordinates when inputted into the char array is != to a wall, character, or other monster
break the loop

Would that work properly? *remember, I'm at school right now. And it's NOT programming school.

I am a sesquipidalian.

Go not where the path leads, but rather walk somewhere new and leave a trail.
Advertisement
Awesome! Keep up the hard work! :)
I shall. NEXT STOP: ADD IN WINDOWS.H and ctime to make some form of timed quests... And HOTKEYS TO MOVE THE PLAYER! yeah that's right. This is going to be the best freaking console application ever invented.

Screw graphics API's... :P Maybe I'll add in some networking for highscores. That's not TOO hard.
I am a sesquipidalian.

Go not where the path leads, but rather walk somewhere new and leave a trail.
Go for it bro :cool:
MHM. I'm still needing help with the random respawn. Anybody able to help me?
I am a sesquipidalian.

Go not where the path leads, but rather walk somewhere new and leave a trail.
if your map is just an array of numbers you could very well call rand within the range of the size of your arrays and you'd be done with random respawning.

Go for it tiger!
[size="2"]I like the Walrus best.
Alright, wonderful. Thanks guys, feels good to get positive stuff said to me :D

And seeing as it's just an array of bytes, for the AI I could just check which variable is closer to the character...

For example, the array is as follows:

Grid [PlayerX] [PlayerY]
Grid [MonsterX] [MonsterX]

so to find out what to move on the monsters turn, I could just do:

DifferenceX = MonsterX-PlayerX;
DifferenceY = MonsterY-PlayerY;

if (DifferenceX < DifferenceY){
if (MonsterX < PlayerX){
MonsterX++
system("cls");
DisplayMap;

}
else if (MonsterX > PlayerX){
MonsterX--
system("cls");
DisplayMap;

}
else if (DifferenceX>DifferenceY){
if (MonsterY < PlayerY){
MonsterY++
system("cls");
DisplayMap;

}
else if (MonsterY >PlayerY){;
MonsterY--
system("cls");
DisplayMap;
}

That SHOULD work for artificial intelligence right?
I am a sesquipidalian.

Go not where the path leads, but rather walk somewhere new and leave a trail.
u will want a pause before the monster moves possibly,

otherwise the player will move, the screen refreshes, then instantly monster moves and screen refreshes again

causing a double refresh unnecessarily.
Nah, it basically is turn based.
int main(){
MovePlayer();
MoveEnemy();
}


MovePlayer does NOT refresh the screen.


But, now when I move my player, the screen flickers. I use system("cls") to clear the screen, is there a way to JUST clear the Player/monsters and re-write them?

Remember, it is a console application...
I am a sesquipidalian.

Go not where the path leads, but rather walk somewhere new and leave a trail.

This topic is closed to new replies.

Advertisement