LynxJam2023 - day 3


and......yes !!!!!!

I could now walk on the dungeon !

When you turn, it's not perfect because not animated but Dungeon Master did the same so I probably won't change it (limited time doesn't help!!)



The main difficulty was to handle the field of view, which request to controls almost 20 positions of the maze!

 X-2 X-1 X X+1 X+2
      L C R     D | | | | Y=3
   C _ _ _ Y=3
   C | | | | Y=2
   B _ _ _ Y=2
   B . | | . Y=1
   A _ _ _ Y=1
   A . |P| . Y=0
     Player

Unlike a "classic" maze where you only need to check if there is a wall in front of you.

Why is it difficult ? If you walk front in the middle of the dungeon, no problem : just use curent X and Y

But what if you're against a wall (at X=0 for ex) or if you walk to the left of the dungeon ?

Yes, the 20 positions you need to test are defined by where you are and which direction you are 

According direction, I so defined how much X and Y is needed to move front and how much X and Y is need to move right.
This way, I could get any maze information based on player direction

switch (mazeAim)
{
case AIM_UP:
stepFrontX = 0;
stepFrontY = -1;
stepRightX = 1;
stepRightY = 0;
break;
case AIM_RIGHT:
stepFrontX = 1;
stepFrontY = 0;
stepRightX = 0;
stepRightY = 1;
break;
case AIM_BOTTOM:
stepFrontX = 0;
stepFrontY = 1;
stepRightX = -1;
stepRightY = 0;
break;
case AIM_LEFT:
stepFrontX = -1;
stepFrontY = 0;
stepRightX = 0;
stepRightY = -1;
break;
}

I'll probably add encounter engine tomorrow 

Get Hero Dust

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.