Example #1
0
    private void createWallBouncy(WallBouncy wallBouncy)
    {
        GameObject wb = Instantiate(WallBouncyObj, wallBouncy.transform.position, Quaternion.identity);

        wb.transform.SetParent(gc.gameObject.transform);
        wb.transform.localScale = wallBouncy.transform.scale;
    }
Example #2
0
    public Level1() : base()
    {
        width          = 27;
        height         = 30;
        cameraSettings = new CameraSettings(new Vector3(0f, 15f, -10f), new Vector3(60f, 0f, 0f), 2.5f, 2.5f);
        // (0, 15, -10)

        player = new Player(1, 1);
        walls  = new Wall[] {
            // new Wall(x1, z1, x2, z2)
            // 1:start from x > 2:start from z ^
            // 3: >  4:^
            new Wall(0, 0, 28, 0),   // Bottom Wall
            new Wall(0, 0, 0, 31),   // Left Wall
            new Wall(27, 0, 28, 31), // Right Wall
            // new Wall(0, 30, 28, 31),// Top Wall

            new Wall(5, 0, 6, 10), // Internal Wall: start
            new Wall(0, 15, 12, 16),
            new Wall(12, 8, 13, 16),

            new Wall(18, 5, 19, 20),
            new Wall(10, 20, 19, 21),
            new Wall(0, 25, 23, 26),
        };


        wallsBouncy = new WallBouncy[] {
            new WallBouncy(0, 30, 27, 31),//top wall
            new WallBouncy(5, 5, 18, 6),
            new WallBouncy(22, 5, 23, 26),
        };

        goals = new Goal[] {
            new Goal(1, 27),
        };

        obstacles = new Obstacle[] {
            new Hole(8, 6),
            new Hole(23, 6),
            new Hole(23, 15),
            new Hole(23, 22),
            new Hole(21, 26),
        };
        introDialogue = new Dialogue[] {
            new Dialogue(70, Dialogue.Speaker.Rubik, "Welcome To your doom!"),
            new Dialogue(50, Dialogue.Speaker.Rubik, "We're going to have some fun you and I!"),
            new Dialogue(50, Dialogue.Speaker.Rubik, "Because now the walls turn against you! You thought you could find solace against these edges, but now they will push you to your sanity’s edge! HAHAHA!"),
        };
        outroDialogue = new Dialogue[] {
            new Dialogue(50, Dialogue.Speaker.Rubik, "I have more planned for you, you just wait and see. You'll crack like Humpty Dumpty did in our maze!"),
        };

        failDialogue = new Dialogue[] {
            new Dialogue(50, Dialogue.Speaker.King, "Hey Rubik, I have a great new idea! You ever try to fit a round peg in a square hole?"),
            new Dialogue(50, Dialogue.Speaker.Rubik, "I think I know where you're pointing to! I gotta say, it sounds FITTING!"),
            new Dialogue(50, Dialogue.Speaker.King, "Well, thank cube very much! Now get to it!"),
        };

        buildMap();
    }
Example #3
0
    public Level2() : base()
    {
        width          = 35;
        height         = 55;
        cameraSettings = new CameraSettings(new Vector3(4f, 20f, -15f), new Vector3(60f, 0f, 0f), 2.5f, 2.5f);

        player = new Player(1, 1);
        walls  = new Wall[] {
            // new Wall(x1, z1, x2, z2)
            // 1:start from x > 2:start from z ^
            // 3: >  4:^
            new Wall(0, 0, 37, 0),   // Bottom Wall
            new Wall(0, 0, 0, 57),   // Left Wall
            new Wall(36, 0, 37, 57), // Right Wall
            new Wall(0, 56, 37, 57), // Top Wall


            new Wall(0, 4, 20, 4), // Internal Wall: start
            // new Wall(22, 0, 22, 8), // *** Bouncy Wall

            new Wall(6, 12, 27, 13), //wall: L
            // new Wall(6, 12, 6, 20),// *** Bouncy Wall
            // new Wall(0, 24, 17, 25),//*** Bouncy Wall: second that protrudes from left wall
            // new Wall(23, 24, 32, 25),// *** Bouncy Wall: wall opposite
            new Wall(17, 20, 18, 30), //wall: T
            new Wall(17, 20, 29, 21), // wall: upside down L
            new Wall(29, 7, 30, 21),  // wall: upside down L
            new Wall(17, 30, 27, 31), //wall: protrude right from corridor

            //final stretch
            new Wall(13, 34, 32, 35),
            new Wall(13, 30, 14, 34),
            new Wall(13, 30, 14, 34),
            new Wall(4, 30, 13, 31),
            new Wall(3, 30, 4, 52),
            // new Wall(3, 52, 33, 53),// *** Bouncy Wall



            //fast/hard corridor
            // new Wall(26, 3, 27, 12), // *** Bouncy Wall
            // new Wall(26, 3, 32, 4), // *** Bouncy Wall
            // new Wall(32, 3, 33, 52),// *** Bouncy Wall
        };


        wallsBouncy = new WallBouncy[] {
            new WallBouncy(22, 0, 22, 8),
            new WallBouncy(6, 12, 6, 20),
            new WallBouncy(0, 24, 17, 25),
            new WallBouncy(23, 24, 32, 25),

            new WallBouncy(3, 52, 33, 53),
            new WallBouncy(26, 3, 27, 12),
            new WallBouncy(26, 3, 32, 4),
            new WallBouncy(32, 3, 33, 52),
        };

        goals = new Goal[] {
            new Goal(33, 53)
        };

        obstacles = new Obstacle[] {
            //place 2 holes near beginning
            //place 2  holes at end for either side depending on which side you take
            new Hole(17, 1),
            new Hole(17, 6),
            new Hole(10, 4),
            new Hole(0, 12),
            new Hole(5, 20),
            new Hole(12, 15),
            new Hole(25, 17),
            new Hole(26, 3),

            new Hole(22, 26),
            new Hole(24, 26),
            new Hole(26, 26),
            new Hole(28, 26),

            //final stretch
            new Hole(12, 26),
            new Hole(3, 24),
            new Hole(31, 53),


            //fast/hard corridor
            new Hole(22, 6),
            new Hole(23, 3),
            new Hole(22, 1),

            //final stretch of fast/hard
            new Hole(32, 0),
            new Hole(33, 4),
            new Hole(33, 6),
            new Hole(33, 8),
            new Hole(33, 10),

            new Hole(32, 14),
            new Hole(32, 16),

            new Hole(33, 20),
            new Hole(33, 22),
            new Hole(33, 24),
            new Hole(33, 26),

            new Hole(32, 30),
            new Hole(32, 32),

            new Hole(33, 36),
            new Hole(33, 38),
            new Hole(33, 40),
            new Hole(33, 42),
            new Hole(33, 44),

            new Hole(32, 48),
            new Hole(33, 51),
        };
        introDialogue = new Dialogue[] {
            new Dialogue(9, Dialogue.Speaker.Rubik, "Welcome To Level 2 Torture!!"),
            new Dialogue(5, Dialogue.Speaker.Rubik, "You may have survived thus far, but we’re just getting started!"),
            new Dialogue(5, Dialogue.Speaker.Rubik, "MORE WALLS, MORE DANGER!!!!"),
        };
        outroDialogue = new Dialogue[] {
            new Dialogue(5, Dialogue.Speaker.Rubik, "AGH!!! You won't be able to get aROUND us next time!"),
        };
        failDialogue = new Dialogue[] {
            new Dialogue(70, Dialogue.Speaker.Rubik, "Humpty Dumpty bumped into my walls & Humpty Dumpty had a great fall"),
            new Dialogue(70, Dialogue.Speaker.Rubik, "All the king's horses and all the king's men, couldn't put Humpty together again"),
            new Dialogue(70, Dialogue.Speaker.Rubik, "You my good broken Spherical General are now like Humpty Dumpty! HAHAHAHA"),
            new Dialogue(70, Dialogue.Speaker.King, "Well done Rubik! Just like how I like my eggs."),
        };

        buildMap();
    }
Example #4
0
    public void buildMap()
    {
        if (wallsBouncy == null)
        {
            wallsBouncy = new WallBouncy[0];
        }

        // IF YOUR OBJECT IS NOT A SUB-SET OF ANY OTHER TYPE ADD OFFSET RULES HERE
        xOffset = (float)-width / 4f + 0.5f;
        zOffset = (float)-height / 4f + 0.5f;

        if (king != null)
        {
            king.transform.xPos += xOffset;
            king.transform.zPos += zOffset;
        }

        player.transform.xPos += xOffset;
        player.transform.zPos += zOffset;

        foreach (Wall wall in walls)
        {
            wall.transform.xPos += xOffset;
            wall.transform.zPos += zOffset;
        }


        foreach (WallBouncy wallbouncy in wallsBouncy)
        {
            wallbouncy.transform.xPos += xOffset;
            wallbouncy.transform.zPos += zOffset;
        }

        foreach (Goal goal in goals)
        {
            goal.transform.xPos += xOffset;
            goal.transform.zPos += zOffset;
        }
        foreach (Obstacle obstacle in obstacles)
        {
            obstacle.transform.xPos += xOffset;
            obstacle.transform.zPos += zOffset;
        }

        // IF YOUR OBJECT REMOVES GROUND TILES DO THAT HERE
        mapScale    = new Vector3((float)width / 10f, 1f, (float)height / 10f);
        this.ground = new bool[height, width];
        for (int i = 0; i < height; i++)
        {
            for (int j = 0; j < width; j++)
            {
                this.ground[i, j] = true;
            }
        }

        foreach (Goal goal in goals)
        {
            for (int i = 0; i < 2; i++)
            {
                for (int j = 0; j < 2; j++)
                {
                    ground[goal.transform.zGrid + i, goal.transform.xGrid + j] = false;
                }
            }
        }

        foreach (Obstacle obstacle in obstacles)
        {
            switch (obstacle.type)
            {
            case Obstacle.ObstacleType.Hole:
                for (int i = 0; i < 2; i++)
                {
                    for (int j = 0; j < 2; j++)
                    {
                        ground[obstacle.transform.zGrid + i, obstacle.transform.xGrid + j] = false;
                    }
                }
                break;

            case Obstacle.ObstacleType.BlackHole:
                for (int i = 0; i < 8; i++)
                {
                    for (int j = 0; j < 8; j++)
                    {
                        ground[obstacle.transform.zGrid + i, obstacle.transform.xGrid + j] = false;
                    }
                }
                break;

            default:
                ground[obstacle.transform.zGrid, obstacle.transform.xGrid] = !obstacle.removeGround;
                break;
            }
        }
    }