Sign in to follow this  

Ascii rogue rpgs

This topic is 3408 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So if I were to make a game like ADom, using C++, would I have to use bubblesort to move the character around like if I click up, it checks if there is a period and switches you with it, and if there is like an f, you dont switch but you fight it like a lion? Or would you have to use opengl to get the keys like that?

Share this post


Link to post
Share on other sites
I... can't see why you would use bubble sort for this. And OpenGL has nothing to do with roguelikes, unless you happen to be doing your rendering with it.

Checking by the symbol would be quite limiting. You'd be hard coding expectations about tiles that way, limiting what you could present with any given symbol.

It depends on your particular setup how exactly it would work, but a simple method would be to use a 2D array of tiles, where each tile has a type (TILE_WALL, TILE_FLOOR), can store an entity (player, monster, anything that moves about), and can contain a collection of items. All you'd need to do then is make sure it's not a wall (world[x][y].type != TYPE_WALL) and that there's nobody standing on it (world[x][y].entity == NULL). If both these pass, set that tile's entity to the player (and clear out the one you just left) and you're done.

Of course, that's not the most efficient way of doing it and it would only work if the game is designed around that from the start.

Share this post


Link to post
Share on other sites

This topic is 3408 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this