Day 11: GameJam #Redefine2021

The minigame to disable the laser barriers in the game. There is only one symbol here, but in the later versions there will be three (cross, circle and triangle) and each of them has a destination. The possible positions (marked with the symbol) can toggle one or two barriers.

I don’t even know what to tell about this. The levels are defined in the code like this:

    private static readonly string[][] mapLevels = {
        new string[] {
            ". . . . . . . .",   ". . . . . . . . ",
            ". X . . .2. . .",   ". . . . . . . . ",
            ". . . . . x . .",   ". . . . . 15. . ",
            ". . . .1. . . .",   ". . . . . . . . ",
            ". . . . .2.5.5.",   ". . . . . . . . ",
            ". . x . . . . .",   ". . 2 . . . . . ",
            ". . . .1. . y .",   ". . . . . . . . ",
            ". . . . . . . .",   ". . . . . . . . ",
        },
      ...

The left side defines the positions of the symbols cross, circle and triangle. The uppercase X means that this is the start position. The goals are specified by using the following character in the alphabet (x -> y, t -> u, o -> p). Numbers are always present in pairs and define the barriers.

The right side defines the barriers that get toggled when a symbol reaches this position. The “5” next to the “1” is actually right of the position it belongs to and is the second barrier that will be triggered. There are 4 barrierts (1-4) the number 5 actually only means that this barrier is disabled at the start.

When moving a symbol, I do a Graphics2D.LineCastNonAlloc to check if the way is clear and let it collide otherwise and restart the game.

Leave a Reply

Your email address will not be published. Required fields are marked *