Example #1
0
        public override void loadLevelObjects()
        {
            for (int i = 3; i <= 9; i += 2)
            {
                for (int j = 5; j <= 7; j += 2)
                {
                    Desk d = new Desk(i * 32, j * 32);
                    Game1.miscObjects.Add(d);
                }
            }
            //laser puzzle objects
            Gate   laserGate = new Gate(55 * 32, 5 * 32);
            Button bt        = new ButtonHeavy(50 * 32, 5 * 32, laserGate);

            Game1.miscObjects.Add(bt);
            Game1.miscObjects.Add(laserGate);


            Gate   gate4 = new Gate(40 * 32, 23 * 32);
            Button bt2   = new ButtonHeavy(52 * 32, 16 * 32, gate4);

            Game1.miscObjects.Add(bt2);
            Game1.miscObjects.Add(gate4);



            bool lasDir = false;

            for (int i = 21; i < 59; i++)
            {
                for (int j = 2; j < 9; j++)
                {
                    if (((i % 12) == 0) && ((j - 3) % 4 == 0))
                    {
                        Game1.miscObjects.Add(new LaserBlock(i * 32, j * 32, lasDir));
                        lasDir = !lasDir;
                    }
                }
                if ((i % 12) == 0)
                {
                    lasDir = !lasDir;
                }
            }
            Game1.miscObjects.Add(new LaserBlock(49 * 32, 5 * 32, true));
            Game1.miscObjects.Add(new VineMoveBlock(30 * 32, 5 * 32));
            //end laser puzzle
            Gate myGate = new Gate(2 * 32, 4 * 32);

            Game1.miscObjects.Add(myGate);
            ChalkboardTop ch = new ChalkboardTop(5 * 32, 0 * 32, myGate);

            Game1.miscObjects.Add(ch);
            Game1.visuals.Add(new HiddenArrow(6 * 32, 2 * 32));

            Gate gate2 = new Gate(2 * 32, 17 * 32);

            Game1.miscObjects.Add(gate2);
            Button myButton = new ButtonHeavy(32 * 2, 32 * 16, gate2);

            Game1.miscObjects.Add(myButton);

            Gate gate3 = new Gate(16 * 32, 22 * 32);

            Game1.miscObjects.Add(gate3);
            myButton = new ButtonPlayer(32 * 1, 32 * 23, gate3);
            Game1.miscObjects.Add(myButton);

            Game1.miscObjects.Add(new VineMoveBlock(32 * 3, 32 * 18));
            Game1.miscObjects.Add(new VineMoveBlock(32 * 3, 32 * 19));
            Game1.miscObjects.Add(new VineMoveBlock(32 * 10, 32 * 3));


            FlowerTentacles ft = new FlowerTentacles(32 * 4, 32 * 6);

            Game1.creatures.Add(ft);
            ft.setDefendTileGood(4, 6);
            ft.setDefendTileBad(3, 4);

            ft = new FlowerTentacles(32 * 6, 32 * 6);
            Game1.creatures.Add(ft);
            ft.setDefendTileGood(6, 6);
            ft.setDefendTileBad(9, 3);

            ft = new FlowerTentacles(32 * 8, 32 * 6);
            Game1.creatures.Add(ft);
            ft.setDefendTileGood(8, 6);
            ft.setDefendTileBad(10, 3);


            ft = new FlowerTentacles(32 * 3, 32 * 25);
            Game1.creatures.Add(ft);
            ft.setDefendTileGood(3, 25);
            ft.setDefendTileBad(3, 22);



            Game1.miscObjects.Add(new Strawberry(40 * 32, 19 * 32));
            //Game1.miscObjects.Add(new Strawberry(44 * 32, 19 * 32));


            Game1.miscObjects.Add(new VineMoveBlock(44 * 32, 23 * 32));
            Game1.miscObjects.Add(new VineMoveBlock(48 * 32, 23 * 32));
            Game1.miscObjects.Add(new VineMoveBlock(56 * 32, 19 * 32));
            Game1.miscObjects.Add(new VineMoveBlock(56 * 32, 15 * 32));
            Game1.miscObjects.Add(new VineMoveBlock(48 * 32, 19 * 32));

            /*
             * ft = new FlowerTentacles(32 * 11, 32 * 11);
             * Game1.creatures.Add(ft);
             * ft.setDefendTileGood(11, 11);
             * ft.setDefendTileBad(12, 8);
             *
             * //ft = new FlowerTentacles(500, 400, worldState);
             * //creatures.Add(ft);
             *
             * VineMoveBlock vm = new VineMoveBlock(32 * 10, 32 * 5);
             * Game1.miscObjects.Add(vm);
             */

            //leveltiles
            levelTiles.Add(new LevelTile(34 * 32, 26 * 32, "blackBlock", "blackBlock", "hubLevel", new Point(35 * 32, 9 * 32)));
        }
Example #2
0
        public override void reportCollision(Object o)
        {
            if (o is Platform)
            {
                if (!hasBeenOnPlatform)
                {
                    engine.setState("textbox", "platform");
                    hasBeenOnPlatform = true;
                }
            }
            if (o is Boat && !onBoat)
            {
                onBoat = true;
                myBoat = (Boat)o;
                myBoat.setMotion(2);
            }

            if (o is DogBoogieman)
            {
                if (!o.getState())
                {
                    proportion = 0;
                }
            }
            if ((o is Ghost) && (!o.getState()))
            {
                damageProportion(0.3);
            }
            if (o is ChalkboardTop)
            {
                if (!readingChalkboard)
                {
                    collideChalkboard = (ChalkboardTop)o;
                    playerChalkboard  = new Chalkboard(0, 0, collideChalkboard.getGate());
                    Game1.updateMiscObjects.Add(playerChalkboard);
                }
                readingChalkboard = true;
            }
            if (o is BoxTop)
            {
                if (!accessingBox)
                {
                    playerBox = ((BoxTop)o).getBox();
                    Game1.updateMiscObjects.Add(playerBox);
                    collideBoxtop = (BoxTop)o;
                }
                accessingBox = true;
            }



            if (o.getSolid())
            {
                //currentlyMove = false;
            }

            base.reportCollision(o);
            if (o is FlowerTentacles && !o.getState())
            {
                //proportion -= 0.001;
                damageProportion(0.2);
            }
            if (o is Item)
            {
                if (o is Diary)
                {
                    engine.setState("textbox", "diaryExposition");
                }
                if (o is Knife)
                {
                    engine.setState("textbox", "knifeExposition");
                }
                if (o is Rose)
                {
                    engine.setState("textbox", "roseExposition");
                }



                pickUp((Item)o);
                Textures.sounds["pickup"].Play();
            }
            if (o is GoodTile)
            {
                if (!state)
                {
                    engine.switchStates();
                }
            }
            if (o is BadTile)
            {
                if (state)
                {
                    engine.switchStates();
                }
            }
            if (o is LockTile)
            {
                if (stateLocked == false)
                {
                    Textures.sounds["lock"].Play();
                }
                stateLocked = true;
                if (!hasBeenLocked)
                {
                    engine.setState("textbox", "shiftLock");
                    hasBeenLocked = true;
                }
            }
            if (o is UnlockTile)
            {
                if (stateLocked == true)
                {
                    Textures.sounds["unlock"].Play();
                }
                stateLocked = false;
            }
            if (o is LevelTile)
            {
                if (this.x == o.getX() && this.y == o.getY())
                {
                    engine.setLevel(((LevelTile)o));
                    //engine.saveGame(((LevelTile)o));
                }
            }
        }
Example #3
0
        public override void loadLevelObjects()
        {
            for(int i = 3; i <= 9; i+=2)
            {
                for(int j = 5; j<= 7; j+=2)
                {
                    Desk d = new Desk(i * 32, j * 32);
                    Game1.miscObjects.Add(d);
                }
            }
            //laser puzzle objects
            Gate laserGate = new Gate(55 * 32, 5 * 32);
            Button bt = new ButtonHeavy(50 * 32, 5 * 32, laserGate);
            Game1.miscObjects.Add(bt);
            Game1.miscObjects.Add(laserGate);

            Gate gate4 = new Gate(40 * 32, 23 * 32);
            Button bt2 = new ButtonHeavy(52 * 32, 16 * 32, gate4);
            Game1.miscObjects.Add(bt2);
            Game1.miscObjects.Add(gate4);

            bool lasDir = false;
            for (int i = 21; i < 59; i ++)
            {
                for (int j = 2; j < 9; j ++)
                {
                    if (((i % 12) == 0) && ((j - 3) % 4 == 0))
                    {
                        Game1.miscObjects.Add(new LaserBlock(i * 32, j * 32, lasDir));
                        lasDir = !lasDir;
                    }
                }
                if ((i % 12) == 0)
                {
                    lasDir = !lasDir;
                }
            }
            Game1.miscObjects.Add(new LaserBlock(49 * 32, 5 * 32,true));
            Game1.miscObjects.Add(new VineMoveBlock(30 * 32, 5 * 32));
            //end laser puzzle
            Gate myGate = new Gate(2 * 32, 4 * 32);
            Game1.miscObjects.Add(myGate);
            ChalkboardTop ch = new ChalkboardTop(5 * 32, 0 * 32, myGate);
            Game1.miscObjects.Add(ch);
            Game1.visuals.Add(new HiddenArrow(6 * 32, 2 * 32));

            Gate gate2 = new Gate(2 * 32, 17 * 32);
            Game1.miscObjects.Add(gate2);
            Button myButton = new ButtonHeavy(32 * 2, 32 * 16, gate2);
            Game1.miscObjects.Add(myButton);

            Gate gate3 = new Gate(16 * 32, 22 * 32);
            Game1.miscObjects.Add(gate3);
            myButton = new ButtonPlayer(32 * 1, 32 * 23, gate3);
            Game1.miscObjects.Add(myButton);

            Game1.miscObjects.Add(new VineMoveBlock(32 * 3, 32 * 18));
            Game1.miscObjects.Add(new VineMoveBlock(32 * 3, 32 * 19));
            Game1.miscObjects.Add(new VineMoveBlock(32 * 10, 32 * 3));

            FlowerTentacles ft = new FlowerTentacles(32 * 4, 32 * 6);
            Game1.creatures.Add(ft);
            ft.setDefendTileGood(4, 6);
            ft.setDefendTileBad(3, 4);

            ft = new FlowerTentacles(32 * 6, 32 * 6);
            Game1.creatures.Add(ft);
            ft.setDefendTileGood(6, 6);
            ft.setDefendTileBad(9, 3);

            ft = new FlowerTentacles(32 * 8, 32 * 6);
            Game1.creatures.Add(ft);
            ft.setDefendTileGood(8, 6);
            ft.setDefendTileBad(10, 3);

            ft = new FlowerTentacles(32 * 3, 32 * 25);
            Game1.creatures.Add(ft);
            ft.setDefendTileGood(3, 25);
            ft.setDefendTileBad(3, 22);

            Game1.miscObjects.Add(new Strawberry(40 * 32,19 * 32));
            //Game1.miscObjects.Add(new Strawberry(44 * 32, 19 * 32));

            Game1.miscObjects.Add(new VineMoveBlock(44 * 32, 23 * 32));
            Game1.miscObjects.Add(new VineMoveBlock(48 * 32, 23 * 32));
            Game1.miscObjects.Add(new VineMoveBlock(56 * 32, 19 * 32));
            Game1.miscObjects.Add(new VineMoveBlock(56 * 32, 15 * 32));
            Game1.miscObjects.Add(new VineMoveBlock(48 * 32, 19 * 32));
                /*
                ft = new FlowerTentacles(32 * 11, 32 * 11);
                Game1.creatures.Add(ft);
                ft.setDefendTileGood(11, 11);
                ft.setDefendTileBad(12, 8);

                //ft = new FlowerTentacles(500, 400, worldState);
                //creatures.Add(ft);

                VineMoveBlock vm = new VineMoveBlock(32 * 10, 32 * 5);
                Game1.miscObjects.Add(vm);
                */

                //leveltiles
                levelTiles.Add(new LevelTile(34 * 32, 26 * 32, "blackBlock", "blackBlock", "hubLevel", new Point(35 * 32, 9 * 32)));
        }
Example #4
0
        public override void reportCollision(Object o)
        {
            if (o is Platform)
            {
                if(!hasBeenOnPlatform)
                {
                    engine.setState("textbox", "platform");
                    hasBeenOnPlatform = true;
                }

            }
            if (o is Boat && !onBoat)
            {
                onBoat = true;
                myBoat = (Boat)o;
                myBoat.setMotion(2);
            }

            if (o is DogBoogieman)
            {
                if (!o.getState())
                {
                    proportion = 0;
                }
            }
            if ((o is Ghost) && (!o.getState()))
            {
                damageProportion(0.3);
            }
            if(o is ChalkboardTop)
            {

                if(!readingChalkboard)
                {
                    collideChalkboard = (ChalkboardTop)o;
                    playerChalkboard = new Chalkboard(0, 0, collideChalkboard.getGate());
                    Game1.updateMiscObjects.Add(playerChalkboard);
                }
                readingChalkboard = true;

            }
            if(o is BoxTop)
            {
                if(!accessingBox)
                {
                    playerBox = ((BoxTop)o).getBox();
                    Game1.updateMiscObjects.Add(playerBox);
                    collideBoxtop = (BoxTop)o;

                }
                accessingBox = true;
            }

            if(o.getSolid())
            {
                //currentlyMove = false;
            }

            base.reportCollision(o);
            if(o is FlowerTentacles && !o.getState())
            {
                //proportion -= 0.001;
                damageProportion(0.2);
            }
            if (o is Item)
            {
                if(o is Diary)
                {
                    engine.setState("textbox", "diaryExposition");
                }
                if(o is Knife)
                {
                    engine.setState("textbox", "knifeExposition");
                }
                if(o is Rose)
                {
                    engine.setState("textbox", "roseExposition");
                }

                pickUp((Item)o);
                Textures.sounds["pickup"].Play();
            }
            if (o is GoodTile)
            {
                if (!state)
                {
                    engine.switchStates();
                }
            }
            if(o is BadTile)
            {
                if (state)
                {
                    engine.switchStates();
                }
            }
            if (o is LockTile)
            {
                if (stateLocked == false)
                    Textures.sounds["lock"].Play();
                stateLocked = true;
                if(!hasBeenLocked)
                {
                    engine.setState("textbox", "shiftLock");
                    hasBeenLocked = true;
                }

            }
            if(o is UnlockTile)
            {
                if (stateLocked == true)
                    Textures.sounds["unlock"].Play();
                stateLocked = false;

            }
            if(o is LevelTile)
            {
                if(this.x == o.getX() && this.y == o.getY())
                {
                    engine.setLevel(((LevelTile)o));
                    //engine.saveGame(((LevelTile)o));
                }
            }
        }