Ejemplo n.º 1
0
 public LocationObject(Item i, Location loc) : base(loc)
 {
     item         = i;
     sprite       = Game1.CreateSingleAnimatedSprite(item.SpriteName(), item.AnimationName(), item.AnimationFrames(), isLooping: false);
     posX         = Game1.tileSize * 4;
     posY         = Game1.tileSize * 5;
     collisionBox = MakeCollisionBoundingBox();
 }
Ejemplo n.º 2
0
 public InventoryStack(Item i, int x = 0, int y = 0, int count = 1)
 {
     Item   = i;
     posX   = x;
     posY   = y;
     sprite = Game1.CreateSingleAnimatedSprite(Item.SpriteName(), Item.AnimationName(), Item.AnimationFrames(), isLooping: false);
     Count  = count;
 }
Ejemplo n.º 3
0
        public Projectile(Character caster, Location loc) : base(loc)
        {
            speed = 0.4f;
            switch (caster.FacingDirection())
            {
            case Direction.Right: { velocityX = speed; velocityY = 0; break; }

            case Direction.Left: { velocityX = -speed; velocityY = 0; break; }

            case Direction.Down: { velocityX = 0; velocityY = speed; break; }

            case Direction.Up: { velocityX = 0; velocityY = -speed; break; }
            }
            //Vector2 v = caster.Velocity();
            //velocityX = (velocityX + v.X) / 2;
            //velocityY = (velocityY + v.Y) / 2;
            sprite = Game1.CreateSingleAnimatedSprite("spriteSheets/potions/firepot", "animations/firepot", new int[] { 0 }, isLooping: false);
            Vector2 v = caster.GetPosition();

            posX         = (int)v.X;
            posY         = (int)v.Y;
            collisionBox = MakeCollisionBoundingBox();
            Active       = true;
        }