Sign in to follow this  
speciesUnknown

"Best" way to do roguelike in javascript

Recommended Posts

Hi,

For the next Ludumdare competition I've decided I want to do some kind of roguelike game. Not necessarily set in ancient times with monsters and the such (it might possibly be contempory). But, I wanted to do this in javascript as a learning experience. The main question is, what would be the best way to do this? I can think of a few options. I've done a big project in javascript before, but it wasnt for a game, and for graphics I was using dojox.gfx which was an experimental wrapper for both canvas (pre HTML5) and the proprietary MS / Adobe one that everybody used to complain about; I've not done something in pure text before.

For those not familiar, a roguelike is a top down, turn based game where the characters and environment are represented using ascii characters.
For example, this would be a guy in a 3x3 room:

[code]
#####
# #
# @ #
# #
#####
[/code]

This is a guy being attacked by 3 dogs in a room where the door has inextricably locked itself:

[code]
#####
#dd #
#d@ +
# #
#####
[/code]


Because its not using sprite graphics, this changes the approach I might need to use when rendering the game. I've done this type of game in other systems, so the technical side is not an issue, its more a case of getting performant drawing on the largest number of machines possible. As far as I'm aware, there aren't a lot of browser roguelikes implemented in pure javascript; usually they use flash, java, etc.

Share this post


Link to post
Share on other sites
You have a couple of really simple choices in front of you here. First, you could use flash or java which in my honest opinion is not the right way to go. If not plugins, you could use the canvas but it'll be quite a headache to draw and place text inside it. If I were you I'd do it inside HTML, take a div, assign an appropriate font to it, place it wherever you want it, and edit the text inside it on every update! Just take care of the fonts you use, preferably mono space.

Share this post


Link to post
Share on other sites

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