예제 #1
0
 void Start()
 {
     player = GameObject.Find("Player");
     pStats = player.GetComponent <PlayerStats>();
     iceShield.SetActive(true);
     shield = player.GetComponent <IceShield>();
     fire   = player.GetComponent <RangeAttack>();
     port   = player.GetComponent <Teleport>();
     nuke   = player.GetComponent <PlayerAOEattack>();
     speed  = player.GetComponent <Haste>();
 }
예제 #2
0
        public WalkingScene(SpellswordGame game, World thisWorld, WalkingPlayer player)
        {
            inputHandler = game.Services.GetService <InputHandler>();
            if (inputHandler == null)
            {
                inputHandler = new InputHandler(game);
                game.Components.Add(inputHandler);
            }

            this.game      = game;
            this.thisWorld = thisWorld;
            this.player    = player;

            string[] mapFile =
            {
                "11111110001111111",
                "11111110001111111",
                "11111110001111111",
                "11110000000001111",
                "11110000000001111",
                "11110000000001111",
                "00010000000001000",
                "00000000000000000",
                "00010000000001000",
                "11110000000001111",
                "11110000000001111",
                "11110000000001111",
                "00010000000001000",
                "00000000000000000",
                "00010000000001000",
                "11110000000001111",
                "11110000000001111",
                "11110000000001111",
                "11110000000001111",
                "11111111011111111",
                "11111110001111111",
                "11111110001111111",
                "11111110001111111"
            };

            emptyTiles = new List <EmptyTile>();
            CreateEmptyTiles(game, mapFile);

            //Temp test
            Enemy welp   = new Welp("WelpSmall", "Welp");
            Enemy zombie = new Zombie("ZombieSmall", "Zombie");
            Enemy wraith = new Wraith("WraithSmall", "Wraith");
            Enemy ghost  = new Ghost("BackwardsStill", "Ghost");
            Enemy flower = new Flower("FlowerWorld", "FlowerBattle");
            Enemy dragon = new Dragon("Dragon", "Dragon", "DragonSpecial");

            enemies = new List <WorldEnemy>();
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(3, 7), welp));    // Welp
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(3, 13), zombie)); // Zombie
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(13, 7), wraith)); // Wraith
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(13, 13), ghost)); // Ghost
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(8, 19), flower)); // Flower
            this.enemies.Add(new WorldEnemy(game, thisWorld, new Point(8, 1), dragon));  // Dragon Boss

            // More Temp Test
            swords = new List <WorldSword>();
            Weapon iceShield      = new IceShield("IceShield", 8, 15);
            Weapon iceSword       = new IceSword("IceSword", 20, 5);
            Weapon lightningSword = new LightningSword("LightningSword", 30, 5);
            Weapon focus          = new BasicFocus("SpellFocus");

            this.swords.Add(new WorldSword(game, thisWorld, new Point(1, 7), iceShield));       // Ice Shield
            this.swords.Add(new WorldSword(game, thisWorld, new Point(1, 13), iceSword));       // Ice Blade
            this.swords.Add(new WorldSword(game, thisWorld, new Point(15, 7), lightningSword)); // Lightning Blade
            this.swords.Add(new WorldSword(game, thisWorld, new Point(15, 13), focus));         // Spell/Power Focus

            InitializePlayerToMiddle();
        }