About Donpastor (twitter: @@donpastor82)


MiniLD #63
Ludum Dare 33
Ludum Dare 32

Donpastor's Trophies

Donpastor's Archive

I’m… in?

Posted by (twitter: @@donpastor82)
Thursday, April 14th, 2016 3:48 pm


I’m in! I’ll try to make something worthwhile or I’ll die trying (probably the later).

My tools of choice:

  • Intel XDK
  • Phaser framework
  • Tiled
  • Cosmigo ProMotion
  • AutoTileGen
  • Bfxr

I’m trying to learn how to use Godot Engine, but I fear I will spend too much time struggling with the IDE / language rather than programming. That said I’ll stick with what I know best: Javascript.

Wish me luck! :-)

1st day roundup

Posted by (twitter: @@donpastor82)
Saturday, December 12th, 2015 2:26 pm

Ludum Dare time! This is my progress so far:


Yeah, nothing at all. Impressive, huh?

I have spent the whole day in the hospital with my wife. Nothing serious luckily, but I’m so tired now.
Exactly the same thing happened to me in the last mini ludum dare.
Still I’d like to make something for the Jam, so I’ll go for something super-simple but that I haven’t done before: an infinite runner using two buttons. I’ve been thinking about how to implement this kind of game with Phaser.js, and I think I know how to do it. Let’s hope I have enough time to translate it into a game.

Wish me luck!

Post-jam version MEGA update!

Posted by (twitter: @@donpastor82)
Friday, September 11th, 2015 1:14 pm

This has been a hard week and I had almost no time to work on my entry. Anyway I’ve been able to add a couple of new features for the post-jam version. You can rate the original jam version HERE and the updated post-jam version HERE.


Who doesn’t love new features?

So far this is the complete changelog:

  • First and last maps have a fixed layout now
  • Levels won’t repeat anymore in a single game (bugfix)
  • Different tilesets depending on depth (I recolored the base tileset as a placeholder for now)
  • Music is streamed instead of preloaded
  • Text appears when picking potions or leveling up. More informative
  • Text is animated now
  • More enemy types
  • Some enemy types are tied to certain depths
  • Touch controls
  • Combat is speed based now. Foes faster than you will atack first
  • Reduced amount of potions appearing
  • Special abilities for players. Troll (regeneration) and Cacodemon (See enemies and ladder) are already implemented
  • Diagonal movement enabled, both for players and enemies
  • Added Field of View for players
  • Foes have an alert radius. They won’t chase you unless they notice your presence
  • Ability to skip turns
  • Many more potion types. Some more useful than others. Also tweaked generation rate for the most powerful ones
  • Ascending will heal you 10HP
  • Changed starting stats for players. Troll is stronger but near-sighted, lizard is fast but weak. Try it yourself!

Still to-do:

  • Finish drawing the tiles
  • Add more songs
  • Poison and burn states
  • Ability for Demon, Imp and Lizard
  • Fix bugs (player appearing over ladders or items on map generation)
  • Adding super rare and difficult special maps

On map generation

Posted by (twitter: @@donpastor82)
Friday, September 11th, 2015 9:37 am

(You can play and rate my entry HERE)

I’ve succesfully integrated rot.js map generation with my game… only to discover that those tiny (19*15 tiles) generated maps are not fun at all to play. So I’m sticking to premade maps. I’ll add some more later.

For my next attempt at programming a rogelike the map will be BIGGER than the viewport.

New features implemented to the post-jam version (will be updated shortly):

  • Different tilesets based on depth. I have recolored the base tileset to act as a placeholder (for now).
  • Each main character has a unique special ability that is automatically triggered on each turn.
  • Three new potions.
  • First and last floors are fixed now (The Lair & The Town).
  • Floors won’t repeat anymore.
  • Foes now have an alert radius. They won’t chase you unless they are aware of your presence. Each foe has a different alert radius: that means you won’t be chased by all foes at the same time when entering a floor!
Not that exciting

Not that exciting.


No room to maneuver.

Posted by (twitter: @@donpastor82)
Tuesday, September 1st, 2015 8:43 am

I’m still working on improving my entry, Someone stole the Princess!

Looks like tileset usage based on depth is working. Of course, now I need to actually draw (or look for some CC) new tiles. These are the planned tilesets:

  1. Depth 10 & 9- The Lair
  2. Depth 8 & 7 – The Crystal Caves
  3. Depth 6 & 5 – The Sunken Ship (don’t ask)
  4. Depth 4 & 3 – The Underground Forest
  5. Depth 2 & 1 – The Basement
  6. Depth 0 – The Town
The excellent DawnLike tileset. Just need drawing wall intersections.

The excellent DawnLike tileset. Just need drawing wall intersections.

Once I finish preparing the tiles (I might alternate drawing tiles with programming some of the planned features) I’ll add all these changes to the post-jam version.

More tiles

Posted by (twitter: @@donpastor82)
Monday, August 31st, 2015 4:40 pm

I’m currently working on enabling different sets of tiles based on dungeon depth. Until something failed, of course :-)
You can play and rate my entry HERE

Shit happens

Shit happens

Posted by (twitter: @@donpastor82)
Saturday, August 29th, 2015 2:24 pm

I added a not-so-obvious improvement to the post-jam version: audio is now streamed instead of preloaded thanks to the buzz.js library.

This makes the game loading much quicker (as the biggest files were the background music in ogg and mp3 format) and opens the possibility of playing many different tunes without increasing load times.


The downside is that with slow connections music might take a few seconds to start, but that doesn’t affect gameplay at all.

Should I keep the music streaming or should I go back to preloading?

Play the jam version HERE or the updated post-jam version HERE

Post-Jam version uploaded

Posted by (twitter: @@donpastor82)
Saturday, August 29th, 2015 10:55 am

Hi! I’ve been working on my entry after the submission date and implementing many of the features suggested by users. While still it is not complete (you’ll find bugs), this is the changelog compared to the original jam entry:

  • Quantity of potions has been reduced.
  • Healing potions nerfed. Now they heal a random amount between 1 and 5 HP.
  • Ascending one floor heals now 15 HP.
  • Implemented FOV (albeit a very simple algorythm).
  • Implemented SPEED (enemies faster than you will deal damage first).
  • Implemented DIAGONALS (smarter enemy movement, ramped up difficulty).
  • Enemies are tied now to certain depths. Ninjas will appear on last two floors.
  • Added Infravision (+1 light radius) and Speed (+1 speed) potions.
  • Added the ability of waiting one turn without moving.
  • Implemented touch controls.
New and shiny version!

New and shiny version!

Still to-do:

  • Proper procedural map generation. Working on it!
  • Mix procedural and hand-created maps. I’d like first map to be the one in the intro. And the last one could be the town over the dungeon. Like in Angband.
  • More different enemy types.
  • Eyecandy: floating numbers, popups, speech bubbles, hit animation.
  • Proper victory and game over screens. Popups are cheap.
  • Proper intro.
  • Different sets of music and tilesets based on depth (mines? underground forest? pirate ship?).
  • Better FOV algorythm.
  • Implementing STATES with cooldown counters, like POISON and BURN.
  • Adding monster abilities (poisonous mist, random laser, autoevade and fury are planned).
  • Of course, adding potions of mutation. Wouldn’t be cool to have several abilities at once?
  • After implementing all of this, balance difficulty. A lot.

And some pro-tips:

  • Don’t let enemies sorround you. You can now be attacked from up to 8 directions first.
  • Use hallways to your advantage.
  • Use skip turn key (S or SPACEBAR) to let foes approach and attack fist.
  • If sorrounded, kill stronger foes first.
  • Before entering a room, evaluate the risks and benefits.
  • If low on HP, run to the stairs! You’ll recover 15 HP.

You can play the post-jam version HERE and the original jam version HERE.

Don’t forget to drop a comment if you liked it!


Posted by (twitter: @@donpastor82)
Friday, August 28th, 2015 2:02 pm

I have implemented diagonal movement for player and enemies. That improves the game balance by making it much more difficult, as now it is dangerous to be sorrounded by enemies. By being sorrounded by a group of eight ninjas you could receive up to 48 damage per turn.

Fear the power of... DIAGONALS

Fear the power of… DIAGONALS

Also the touch controls have been updated for diagonal movement.

The touch control zones

The touch control zones

If I’m able to iron some bugs I’ll upload the post-jam version in a couple of hours. In the meanwhile you can play the original jam entry HERE and leave some constructive input :-)

Another small update

Posted by (twitter: @@donpastor82)
Thursday, August 27th, 2015 7:08 pm

Reading the comments I noticed several people missed the ability to wait a turn by pressing a key. This feature is now added to the post-jam version I’m working on.

You got the power!

You’ve got the power of a Time Lord but no TARDIS. Sorry.

As this change made the game even easier I’m thinking about enabling diagonal movement. The possibility of being attacked from up 8 directions simultaneously should ramp up the difficulty quite a bit.

You can play the now obsolete jam version [HERE].

Speedy update

Posted by (twitter: @@donpastor82)
Thursday, August 27th, 2015 5:56 pm

I’m still working on the post-jam version of Someone stole the Princess!.

So far I have finished implementing the new speed stat. Also added a speed potion (for a grand total of 7 potion types, for now), which adds +1 speed to the player. Speed affects combat, as the speedier character will attack first.

Let’s put the troll as an example: the troll is very strong and has lots of hp, but unless he drinks lots of speed potions he will be hit by enemies before dealing damage.

Another finished feature is different behaviors for enemy types. The ninja, for example, is faster that the player by default and can attack TWICE!!! Luckily for the player that enemy will only appear in the two last floors, where the player should should already be stronger.

Ouch! Ninjas pack a punch now.

Ouch! Ninjas pack a punch now.

Working FOV

Posted by (twitter: @@donpastor82)
Thursday, August 27th, 2015 4:05 pm

I’m working on a post-jam version of my entry.

I already have a working implementation of Field of View algorithm. Of course the extremely rare potions of infravision are in the game too, adding +1 to the player’s view range.

Trolls are short-sighted

It’s a known fact that trolls short-sighted

I’ll post a link to the new version once it is finished.

BTW, I have a question. As I just added touch controls to the new version, would backporting that feature (in order to add an Android version) to the original jam entry be allowed?

Someone stole the Princess! Post-Mortem

Posted by (twitter: @@donpastor82)
Thursday, August 27th, 2015 5:52 am



Let’s code a roguelike. Should be easy, right?

Oh man, I was SO wrong. A roguelike might be one of the most complex game types to code, given the amount of interactions possible between its elements (just take a look at NetHack).

From the start I planned a short dungeon romp (about 10 floors deep) with no inventory screen. The original plan was an icon to appear over the player’s head when stepping over an equipment piece for exchanging gear (with the future difference in stats reflected in the GUI).

Of course, as monster can’t hold much equipment (they are not that intelligent) I wanted to put emphasis on drinking potions. Lots of potions with crazy effects affecting gameplay.

You can see the details in my Super Awesome Design Doc ©

Greatest concept art ever

Greatest concept art ever

The challenges

A roguelike is NOT a realtime game. Monsters move when you press a key, and the game world is divided in tiles (usually square tiles, but not always). Each key press is a “turn” and, as there are many actors involved in a turn, there must be a way of managing everything.

Another obvious challenge is map generation. In roguelikes every game is different. Maps are procedurally generated, as well as item end enemy location.

Other not-so-obvious challenges involve enemy AI (foes should chase you in an intelligent way) and field of view, where only the visited rooms are drawn in the map (strategy players will know this as ‘fog of war’).


What the hell?

How does a turn work?

I designed the turn management (turn-o-matic in my code) as a fixed series of events:

Player movement → Enemy movement → Effects update (poison, burn, etc)

First the game would check what kind of tile the player wants to move towards. Depending on the tile type different actions will be triggered:

  • If it’s a wall, player won’t move.
  • If a potion, player will pick it up and effects will be applied.
  • If an enemy, combat will be triggered.
  • If a closed door, it will be opened.
  • If a ladder, player will climb and map will change.
  • Finally, if it’s floor or an open door, player will move.

Next would be enemy movement. Enemies chase the player when there is a path available. That was accomplished thanks to the EaysStar.js library, that allows asynchronous A* pathfinding in your game.

For EasyStar to work, you must provide an array filled with numbers and tell which tiles are walkable, and the start and destination coordinates. For example:

      var walkablemap = [[0,0,0,0],[0,1,1,0],[0,1,1,0],[0,0,0,0]];
      estar = new EasyStar.js
      estar.findPath(foe.posX,foe.posY, player.posX, player.posY, function (path) {
          if (path) {
              //if success then move the player

EasyStar returns a “path” array containing all the calculated steps to the target. So for a turn we would take the second element of the array, as the first one is the origin point:


As EasyStar wouldn’t let the foe step over a wall, game must only check if the destination tile is an empty tile (in that case the foe move towards that tile) ot the player (then it triggers combat).

As for the effects updating, things like ‘Poison’, ‘Burning’, ‘Weakened’, ‘Silenced’ and such were planned but not implemented, so this part is empty.

What went well

Tileset generation went smoothly. Cosmigo ProMotion, while not very intuitive, is a great tool for making tilesets. I also tried Pyxel Edit and liked it even more, but sadly the outdated free version was full of bugs, like refusing to load half of the tiles when loading a project.

The game flow coding went smoothly. Almost a pseudocode to code direct translation.

The map rendering worked on the first try. While some of the wall tiles are not drawn correctly, it doesn’t affect gameplay. It will be corrected soon (that should count as a bugfix for the entry, right?).

¡Behold this amazing black screen!

¡Behold this amazing black screen!

What went wrong

Map generation. For the map generation I took a look at this code, and while I got it somewhat working, didn’t have time to fully integrate it with my game. This is something I’m looking for in the post-LD version I’m making.
I ended choosing a random map between 20-something premade maps. While not common it is possible to see a repeated map ingame.

Field of view is not implemented at all. Shouldn’t be hard to generate a rogue-style FOV, where the full room is revealed once it’s in the player’s range. I’ll leave that for the post-LD version.

Content and gameplay balancing. Base game took so long to code that I didn’t have time to implement many of the things I planned: different foes with different behaviours appearing at different depths, player abilities, equipment system and, of course, some eye-candy.

Map generation needs work

Ouch! Map generation needs some work.


Just as last LD, this was a really fun experience. While I didn’t enjoy the theme much, I’ve always wanted to code a roguelike. I did not completely succeed, but at least my entry is in a somewhat playable state. I’m fine with that :-)

See you at next Ludum Dare!

You can play my entry HERE. Feedback is welcome.

Even more bug fixing!

Posted by (twitter: @@donpastor82)
Wednesday, August 26th, 2015 8:18 am

Potions! ^_^

Today I fixed a bug that caused healing potions not appearing at all. That caused luck potions to appear too often and broke the (already broken) game balance. Also added a hidden easter egg (that doesn’t affect gameplay).

You can try Someone stole the Princess! HERE.


100% more healing!

Now with 100% more healing!

Memory leak fixed!

Posted by (twitter: @@donpastor82)
Tuesday, August 25th, 2015 5:26 pm

Finally I nailed that annoying memory leak bug, plus a bug with the Cacodemon’s starting stats. Also replaced Phaser.js and EasyStar.js with their minified versions.
Now game plays a bazillion times faster. Go kidnap the Princess HERE (and leave a comment if you liked it).


Bug fixing

Posted by (twitter: @@donpastor82)
Tuesday, August 25th, 2015 3:09 pm

Good news is that I already found the cause of the HUGE memory leak in my game.
Turns out that I was creating 19*15 (the number of visible map tiles) new objects to the game twice per second. No wonder it became slower and slower over time!

The quick fix is to add every object to a Phaser.Group and destroy the group contents on each renderer pass. Speed increase was immediately noticeable.


Bad news is that this broke map rendering a bit, so I’ll take a look at the rendering code and hopefully upload the fix in a couple of hours.

Something is a bit... off

Wait… What? WHAT?

[cache: storing page]