Log In  

Cart #dx-4 | 2019-11-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

To load this cart in Pico-8, type:

load #dx

VVhat's new ?

  • Added visible footprints so you can see where you've been.
  • Now does not show maze-drawing process.
  • Fixed up sprites a bit.
  • Am researching recursion as a possible maze-maker.

There are 2-ways you can navigate this maze.

  1. Just using your footprints as a guide.
  2. Press (X) to turn on the auto-mapper and use that as a guide.

This is not so much a game (although you can play it) as a proof of concept.

Something I've wanted to do is have code that automatically builds a fairly large dungeon, in this case 125x125 tiles is a fine testing area and build a maze that cuts the edge of the walls intelligently leaving space for the player to move around, so the corridors are not 1x1 tile in size but actually 3x3 floor space and 2x2 walls.

When you start getting down to having a regular sized dungeon you'll find that the mapper space provided really isn't very big, a maximum of 128x64 and that's only if you sacrifice some of your sprite space for it.

What better way to use the mapper then to create an array for what you need in the map, in this case 125x125 and then draw only the bits you need to the mapper and then just use the MAP() command for that particular area only.

Then intelligently draw black edges around the walls to separate them from the floor, something the default Pico-8 mapper cannot yet do but is included in this code.

Then you get to explore using the arrow keys. Hold two arrow keys to travel a bip-bopping diagonal.

Hold (O) to run instead of walk, and tap (X) to bring up a map of where you've traveled so far or again to hide it so you can focus on the full display.

Your mission is a fairly easy one. Locate the nice cottage in the center of the dungeon and touch it to complete the quest. Know well though that from where you start, there is only one guaranteed path to reach it. And that path is randomized every single time you start a new game.

Also includes torches that flicker, view the code to see how it's done.

Also see unique code of:

  • Constants, _1=true, _0=false.
  • Correct sgn() function where 0 returns 0.
  • Range function where a number is checked to be within a range and returns true if it is.
  • Good generate random number within set range. Negative number ranges are also acceptable.
P#69643 2019-11-04 23:22 ( Edited 2019-11-24 18:18)

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2020-06-05 09:47 | 0.018s | 2097k | Q:33