Beispiel #1
0
 public ReimuObject(Room room, Vector2 pos) : base(room, pos, new Vector2(0, 0), new Vector2(64, 64))
 {
     remainingGraceSteps    = 0;
     remainingShootCooldown = 0;
     spawnLoc           = pos;
     isJumping          = false;
     remainingJumpSteps = 0;
     facingRight        = true;
     Sprite             = new SpriteData();
     Sprite.Size        = new Vector2(64, 64);
     Sprite.Layer       = Layer;
     Hitbox             = new Rectangle(16, 4, 32, 59);
     Light            = new LightData();
     Light.Brightness = 128;
     Light.Position   = Position + (Size / 2);
     YinYang          = new YinYangObject(room, pos);
     idleSprite       = null;
     moveSprite       = null;
     jumpSprite       = null;
     airSprite        = null;
     jumpSound        = null;
     throwCardSound   = null;
     AssetManager.RequestTexture("reimuIdle", (frames) =>
     {
         idleSprite = frames;
     });
     AssetManager.RequestTexture("reimuRun", (frames) =>
     {
         moveSprite = frames;
     });
     AssetManager.RequestTexture("reimuJump", (frames) =>
     {
         jumpSprite = frames;
     });
     AssetManager.RequestTexture("reimuFall", (frames) =>
     {
         airSprite = frames;
     });
     AssetManager.RequestSound("reimuJump", (sound) =>
     {
         jumpSound = sound;
     });
     AssetManager.RequestSound("throwCard", (sound) =>
     {
         throwCardSound = sound;
     });
     AssetManager.RequestSound("jumpReset", (sound) =>
     {
         jumpResetSound = sound;
     });
     AssetManager.RequestSound("reimuDamaged", (sound) =>
     {
         reimuDamagedSound = sound;
     });
 }
Beispiel #2
0
 public BossObject(Room room, Vector2 pos) : base(room, pos, new Vector2(0, 0), new Vector2(64, 64))
 {
     life         = maxLife;
     stepCooldown = 0;
     sprayDir     = minSprayDir;
     attackMode   = 3;
     target       = null;
     remainingStepsBeforeChange = stepsBeforeAttackChange;
     Sprite               = new SpriteData();
     Sprite.Size          = new Vector2(64, 64);
     Sprite.Layer         = Layer;
     Sprite.Speed         = 0.1f;
     Light                = new LightData();
     Light.Brightness     = 64;
     Light.Position       = Position + (Size / 2);
     healthbar            = new SpriteData();
     healthbar.Size       = new Vector2(384, 32);
     healthbar.Source     = new Rectangle(0, 0, (int)healthbar.Size.X, (int)healthbar.Size.Y);
     healthbar.Layer      = 0.98f;
     healthbarFrame       = new SpriteData();
     healthbarFrame.Size  = new Vector2(384, 32);
     healthbarFrame.Layer = 0.99f;
     drawHealthbarFrom    = new Vector2((Room.Game.GraphicsDevice.Viewport.Width - healthbarFrame.Size.X) / 2, healthbarTopPadding);
     AssetManager.RequestTexture("clownpiece", (frames) =>
     {
         Sprite.Change(frames);
     });
     AssetManager.RequestTexture("clownpieceHealthbar", (frames) =>
     {
         healthbar.Change(frames);
     });
     AssetManager.RequestTexture("clownpieceHealthbarFrame", (frames) =>
     {
         healthbarFrame.Change(frames);
     });
 }