Esempio n. 1
0
        public override void SpawnMob()
        {
            Mob tempMob = new Spiderling(new Vector2(pos.X, pos.Y), ownerId);

            if (tempMob != null)
            {
                GameGlobals.PassMob(tempMob);

                totalSpawns++;
                if (totalSpawns >= maxSpawns)
                {
                    dead = true;
                }
            }
        }
Esempio n. 2
0
        //Para no tener movimiento en diagonal, usar if/else
        public override void Update(Vector2 OFFSET)
        {
            bool checkScroll = false;

            if (Globals.keyboard.GetPress("A"))
            {
                pos = new Vector2(pos.X - speed, pos.Y);

                checkScroll = true;
            }

            if (Globals.keyboard.GetPress("D"))
            {
                pos = new Vector2(pos.X + speed, pos.Y);

                checkScroll = true;
            }

            if (Globals.keyboard.GetPress("W"))
            {
                pos = new Vector2(pos.X, pos.Y - speed);

                checkScroll = true;
            }

            if (Globals.keyboard.GetPress("S"))
            {
                pos = new Vector2(pos.X, pos.Y + speed);

                checkScroll = true;
            }

            if (checkScroll)
            {
                GameGlobals.CheckScroll(pos);
            }

            rot = Globals.RotateTowards(pos, new Vector2(Globals.mouse.newMousePos.X, Globals.mouse.newMousePos.Y) - OFFSET);

            if (Globals.mouse.LeftClick())
            {
                GameGlobals.PassProjectile(new Fireball(new Vector2(pos.X, pos.Y), this, new Vector2(Globals.mouse.newMousePos.X, Globals.mouse.newMousePos.Y) - OFFSET));
            }

            base.Update(OFFSET);
        }
Esempio n. 3
0
        public override void SpawnMob()
        {
            int num = Globals.rand.Next(0, 10 + 1);

            Mob tempMob = null;

            if (num < 5)
            {
                tempMob = new Imp(new Vector2(pos.X, pos.Y), ownerId);
            }
            else if (num < 8)
            {
                tempMob = new Spider(new Vector2(pos.X, pos.Y), ownerId);
            }
            if (tempMob != null)
            {
                GameGlobals.PassMob(tempMob);
            }
        }
Esempio n. 4
0
 public virtual void SpawnEggSac()
 {
     GameGlobals.PassSpawnPoint(new SpiderEggSac(new Vector2(pos.X, pos.Y), ownerId));
 }
Esempio n. 5
0
 public virtual void SpawnMob()
 {
     GameGlobals.PassMob(new Imp(new Vector2(pos.X, pos.Y), ownerId));
 }