public void LoadContent(SpriteBatch sb, ContentManager content)
        {
            collidableSky00Mask = content.Load<Texture2D>("Sprites/Collidables/plane1mask");
            Texture2D sky00Anim = content.Load<Texture2D>("Sprites/Collidables/plane1animated");
            collidableSky00Animated = new AnimatedSprite(sky00Anim, new Point(196, 84), Point.Zero, new Point(4, 1), 25);
            collidableSky00Sound = content.Load<SoundEffect>("Audio/Collidables/plane1");

            collidableEvening00Mask = content.Load<Texture2D>("Sprites/Collidables/jetmask");
            Texture2D evening00Anim = content.Load<Texture2D>("Sprites/Collidables/jetanimated");
            collidableEvening00Animated = new AnimatedSprite(evening00Anim, new Point(196, 84), Point.Zero, new Point(4, 1), 25);
            collidableEvening00Sound = content.Load<SoundEffect>("Audio/Collidables/jet");

            collidableSpace00Mask = content.Load<Texture2D>("Sprites/Collidables/ufo");
            Texture2D Space00Anim = content.Load<Texture2D>("Sprites/Collidables/ufoanimation");
            collidableSpace00Animated = new AnimatedSprite(Space00Anim, new Point(196, 84), Point.Zero, new Point(4, 1), 25);
            collidableSpace00Sound = content.Load<SoundEffect>("Audio/Collidables/ufo");

            collectibleHealthMask = content.Load<Texture2D>("Sprites/Collectibles/healthPickup");
            collectibleHealthAnimated = new AnimatedSprite(collectibleHealthMask, new Point(24, 48), Point.Zero, new Point(1, 1), 1000);
            collectibleHealthSound = content.Load<SoundEffect>("Audio/Collectibles/health");

            collectibleSpeedMask = content.Load<Texture2D>("Sprites/Collectibles/speedPickup");
            collectibleSpeedAnimated = new AnimatedSprite(collectibleSpeedMask, new Point(48, 48), Point.Zero, new Point(1, 1), 1000);
            collectibleSpeedSound = content.Load<SoundEffect>("Audio/Collectibles/speed");

            bigBlank = content.Load<Texture2D>("Sprites/UI/bigblank");
        }
        public Collectible(Texture2D mask, AnimatedSprite s, SoundEffect se, int t, int xPos)
        {
            spriteMask = mask;
            sprite = s;
            pickupSound = se;
            type = t;
            position = new Vector2(xPos, -100);

            boundingBox = new Rectangle((int)position.X, (int)position.Y, spriteMask.Width, spriteMask.Height);
        }
示例#3
0
文件: Actor.cs 项目: xSpyro/Zomgbies
 public Actor(Game1 game, Vector2 start, string spritepath, string name)
 {
     this.name = name;
     this.game = game;
     this.position = start;
     this.bounds = new Rectangle((int)start.X, (int)start.Y, 32/2, 32/2);
     this.animatedSpr = new AnimatedSprite(game, spritepath, 32, 100);
     this.isControlled = false;
     this.health = 100;
     ks = Keyboard.GetState();
     color = Color.White;
 }
示例#4
0
 public Human(Game1 game, Vector2 pos, string sprPath)
 {
     int seed = unchecked(Environment.TickCount);
     rand = new Random(seed);
     this.position = pos;
     this.health = 20;
     animateSpr = new AnimatedSprite(game, sprPath, 32, 100);
     bloodAnim = new AnimatedSprite(game, "Other\\Blood", 32, 100);
     angle = 0;
     bounds = new Rectangle((int)position.X, (int)position.Y, animateSpr.getWidth()/2,animateSpr.getHeight()/2);
     healthBar = new Rectangle((int)position.X, (int)position.Y - 10, health, 2);
     isHit = false;
     isDead = false;
     isSafe = false;
     isFleeing = false;
     hpPieceSprite = game.Content.Load<Texture2D>("Other\\HealthBarPiece");
     bloodSplash = game.Content.Load<Texture2D>("Other\\bloodSplash");
     hurtsfx = game.Content.Load<SoundEffect>("Sfx\\hurt");
 }
        public Collidable(Texture2D msk, AnimatedSprite aSprt, float spd, Vector2 pos, int dir, SoundEffect se)
        {
            spriteMask = msk;
            animatedSprite = aSprt;
            speed = spd;
            position = pos;
            direction = dir;
            soundEffect = se;

            if (soundEffect != null) {
                soundEffect.Play();
            }

            //Flips sprite if the direction is right to left. Need to do this here
            //instead of at draw time for per-pixel collision
            if (dir == -1) {
                spriteMask = Utility.Flip(spriteMask, false, true);
            }

            boundingBox = new Rectangle((int)position.X, (int)position.Y, spriteMask.Width, spriteMask.Height);

            oscillateHeight = 0;
            oscillateDirection = 0;
        }
        public void LoadContent(SpriteBatch sb, ContentManager content)
        {
            spriteMask = content.Load<Texture2D>("Sprites/Player/penguin");

            Texture2D sprAnim = content.Load<Texture2D>("Sprites/Player/penguinAnimated");
            spriteAnimated = new AnimatedSprite(sprAnim, new Point(32, 64), Point.Zero, new Point(4, 1), 20);

            jetpackSound = content.Load<SoundEffect>("Audio/Player/jetpack");
            jetpackSoundEffect = jetpackSound.CreateInstance();
            jetpackSoundEffect.IsLooped = true;
            jetpackSoundEffect.Volume = 0.1f;

            damageSound = content.Load<SoundEffect>("Audio/Player/damage");
            deathSound = content.Load<SoundEffect>("Audio/Player/death");

            aviatorHat = content.Load<Texture2D>("Sprites/Player/aviatorhat");
            spaceHelmet = content.Load<Texture2D>("Sprites/Player/spacehelmet");

            boundingBox = new Rectangle((int)position.X, (int)position.Y, spriteMask.Width, spriteMask.Height);
        }