public PointSprite (Game game, bool IsOne) : base(game) { if(IsOne) { this.color = new Color(255, 140, 140); this.pointSpriteSheet = content.Load<Texture2D>("Red_Bat_Point_SpriteSheet"); } else { this.color = new Color(245, 215, 81); this.pointSpriteSheet = content.Load<Texture2D>("Gold_Bat_Point_SpriteSheet"); } Scale = .21f; updatesBetweenFrames = 9; this.sheetInfo = new SpriteSheetInfo(6, pointSpriteSheet.Width, pointSpriteSheet.Height, updatesBetweenFrames); spriteTexture = pointSpriteSheet; SetTranformAndRect(); this.SourceRectangle = sheetInfo.sourceFrame; this.spriteSheetFramesWide = sheetInfo.totalFrames; }
protected override void LoadContent() { spriteTexture = content.Load<Texture2D>("Cyan_SpriteSheet"); sheetInfo = new SpriteSheetInfo(4, spriteTexture.Width, spriteTexture.Height, updates_Between_Frames); this.SourceRectangle = sheetInfo.sourceFrame; this.spriteSheetFramesWide = sheetInfo.totalFrames; SetTranformAndRect(); UpdateHitbox(); base.LoadContent(); }
protected override void LoadContent() { this.movementSpriteSheet = content.Load<Texture2D>("Red_Bat_SpriteSheet"); this.spawningSpriteSheet = content.Load<Texture2D>("Red_Bat_SpawnAnim_SpriteSheet"); this.spriteTexture = this.spawningSpriteSheet; sheetInfo = new SpriteSheetInfo(5, spriteTexture.Width, spriteTexture.Height, 6); this.SourceRectangle = sheetInfo.sourceFrame; this.spriteSheetFramesWide = sheetInfo.totalFrames; SetTranformAndRect(); UpdateHitbox(); base.LoadContent(); }
protected override void LoadContent() { this.movementSpriteSheet = content.Load<Texture2D>("Gold_Bat_SpriteSheet"); this.spawningSpriteSheet = content.Load<Texture2D>("Gold_Bat_SpawnAnim_SpriteSheet"); this.spriteTexture = this.spawningSpriteSheet; sheetInfo = new SpriteSheetInfo(5, spriteTexture.Width, spriteTexture.Height, updates_Between_Frames); this.SourceRectangle = sheetInfo.sourceFrame; this.spriteSheetFramesWide = sheetInfo.totalFrames; SetTranformAndRect(); UpdateHitbox(); maxAllowedDirChanges = rand.Next(1,3); base.LoadContent(); }
protected override void LoadContent() { not_broken = content.Load<Texture2D>("Green_SpriteSheet"); broken = content.Load<Texture2D>("Green_Broken_SpriteSheet"); EmeraldGet = content.Load<SoundEffect>("powerup_get"); EmeraldBreak = content.Load<SoundEffect>("powerup_break"); sheetInfo = new SpriteSheetInfo(4, not_broken.Width, not_broken.Height, updates_Between_Frames); sheetInfo_Broken = new SpriteSheetInfo(4, broken.Width, broken.Height, updates_Between_Frames); spriteTexture = not_broken; this.SourceRectangle = sheetInfo.sourceFrame; this.spriteSheetFramesWide = sheetInfo.totalFrames; SetTranformAndRect(); UpdateHitbox(); base.LoadContent(); }
protected override void LoadContent() { updates_Between_Run = 6; updates_Between_Burst = 3; updates_Between_Ball = 4; updatesBetweenFlicker = 2; run_sheet = content.Load<Texture2D>("Glub_Run_SpriteSheet"); run_info = new SpriteSheetInfo(4, run_sheet.Width, run_sheet.Height, updates_Between_Run); ball_sheet = content.Load<Texture2D>("Glub_BallAnim_SpriteSheet"); ball_info = new SpriteSheetInfo(5, ball_sheet.Width, ball_sheet.Height, updates_Between_Ball); catch_burst_sheet = content.Load<Texture2D>("Glub_Burst_SpriteSheet"); burst_info = new SpriteSheetInfo(5, catch_burst_sheet.Width, catch_burst_sheet.Height, updates_Between_Burst); spriteTexture = run_sheet; spriteSheetFramesWide = run_info.totalFrames; border = this.lanko.border; maxBounces = 3; maxBouncesAfterFalling = 6; maxTimeAllowedBuffed = 10; Scale = .13f; burst_scale = .18f; groundSpeed = 200f; airSpeed = 750f; seekSpeed = 500f; buffSpeed = 900; Speed = groundSpeed; UpdateHitbox(); Direction = new Vector2(0, 0); this.center = new Vector2(Location.X + this.Hitbox.Width / 2, Location.Y + this.Hitbox.Height / 2); WithLanko = true; HasStrongBuff = false; SetTranformAndRect(); this.SourceRectangle = run_info.sourceFrame; base.LoadContent(); }
private void SwapSpriteSheet(Texture2D spriteSheet, SpriteSheetInfo info) { this.spriteTexture = spriteSheet; this.run_info.currentFrame = 0; this.spriteSheetFramesWide = info.totalFrames; info.UpdateSourceFrame(); this.SourceRectangle = info.sourceFrame; if (info == this.ball_info) this.run_Anim_Count = 0; else if (info == this.run_info) this.ball_Anim_Count = 0; this.current_info = info; this.UpdateHitbox(); }
protected virtual void UpdateItemSpriteSheet(SpriteSheetInfo SSI) { if (animationCount >= SSI.updatesPerFrame) { SSI.currentFrame++; animationCount = 0; } else { animationCount++; return; } if (SSI.currentFrame > SSI.totalFrames - 1) SSI.currentFrame = 0; SSI.UpdateSourceFrame(); this.SourceRectangle = SSI.sourceFrame; }
protected override void LoadContent() { idleAnimationCount = 0; updates_Between_Idle = 8; updates_Between_Run = 6; idle_sheet = content.Load<Texture2D>("Lanko_Idle_SpriteSheet"); run_sheet = content.Load<Texture2D>("Lanko_Run_SpriteSheet"); blueGemGet = content.Load<SoundEffect>("BlueGemGet"); catchGlub = content.Load<SoundEffect>("CatchGlub"); landOnGround = content.Load<SoundEffect>("Land"); spriteTexture = idle_sheet; idle_Info = new SpriteSheetInfo(3, idle_sheet.Width, idle_sheet.Height, updates_Between_Idle); run_Info = new SpriteSheetInfo(5, run_sheet.Width, run_sheet.Height, updates_Between_Run); current_Info = idle_Info; spriteSheetFramesWide = idle_Info.totalFrames; ground = this.border.Walls[2].LocationRect.Top; aim = content.Load<Texture2D>("Aim"); aimScale = .5f; crossHair = content.Load<Texture2D>("Crosshair"); crossHairScale = .45f; Scale = .28f; Speed = 300f; speedMod = 1; gravity = .25f; jumpForce = 2.8f; canJumpAgain = true; UpdateHitbox(); Direction = new Vector2(0, 0); Location = new Vector2(border.Walls[2].LocationRect.Width/2, this.ground - this.Hitbox.Height); this.center = new Vector2(Location.X + this.Hitbox.Width / 2, Location.Y + this.Hitbox.Height / 2); aimDirection = this.controller.mouseDirection - this.center; HasJumped = false; HasGlub = true; idleAnimCycled = false; spaceReleased = false; SetTranformAndRect(); glub.SetStartLocationAndGround(); base.LoadContent(); }