Skip to main content
GameDev.net gamedev.net
🔒 Locked

"Best" way to do roguelike in javascript

Started by speciesUnknown Apr 5, 2012 at 8:58 PM 0 replies 1.6k views
Original Post
speciesUnknown
speciesUnknown
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:


#####
# #
# @ #
# #
#####


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


#####
#dd #
#d@ +
# #
#####



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.
Don't thank me, thank the moon's gravitation pull! Post in My Journal and help me to not procrastinate!
vidhvat
vidhvat
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.