private void SetEffect(string effect, DirectionTarget facing, Level inLevel, TrashCan who) { // Display Small Spark Effect on Hit SpecialEffects spark = new SpecialEffects(effect, facing, inLevel, who); InLevel.GameItems.Add(spark); }
public override void GetHit(DirectionTarget cameFrom, int damage) { this.IsAttacking = false; this.Health -= damage; if (CheckForDeath()) { SoundManager.PlaySound("RolentoDye"); GetKnockedDown(cameFrom, 0); return; } // Set state and tetxture state = RolentoEnemyRangedState.TakeHit; texture = Game1.SprRolentoWalkIdle; frameX = 0; frameY = 3; drawWidth = DRAW_WIDTH_TAKEHIT; drawHeight = DRAW_HEIGHT_TAKEHIT; SetDrawArea(); // Play Sound SoundManager.PlaySound("RolentoGetHit"); // Face the man who beat you if (cameFrom == DirectionTarget.Left) { FacingDir = DirectionTarget.Right; } else { FacingDir = DirectionTarget.Left; } }
public SpecialEffects(string id, DirectionTarget facingDir, Level inLevel, TrashCan gameItem) : base(Vector2.Zero, inLevel, null) { switch (id) { case "trashcanhit": // TrashCan Blue Spark this.Sprite = TextureManager.GetTexure("small-spark"); break; } // Place this vector based of the actor position this.InitSpriteFrames(DRAW_SMALLSPARK_WIDTH, DRAW_SMALLSPARK_HEIGHT); this.SetOffsetPosition(new Vector2(50, 20)); if (facingDir == DirectionTarget.Left) { this.Position = new Vector2(gameItem.Position.X - Offset.X, gameItem.Position.Y - Offset.Y); } else { this.Position = new Vector2(gameItem.Position.X + Offset.X, gameItem.Position.Y - Offset.Y); } this.SetOriginPosition(); }
public override void GetKnockedDown(DirectionTarget cameFrom, int damage) { // Set state and texture this.IsAttackable = false; this.IsAttacking = false; this.Health -= damage; this.state = EnemyRangedState.KnockedDown; this.Sprite = Texture_React; this.InitSpriteFrames(DRAW_WIDTH_KNOCKDOWN, DRAW_HEIGHT_TAKEHIT, 0, 1); this.SetDrawArea(); this.SetOriginPosition("bottom"); // Face the man who beat you if (cameFrom == DirectionTarget.Left) { FacingDir = DirectionTarget.Right; } else { FacingDir = DirectionTarget.Left; } SoundManager.PlaySound("GetHit03"); }
public override void GetHit(DirectionTarget cameFrom, int damage) { this.IsAttacking = false; this.Health -= damage; if (CheckForDeath()) { SoundManager.PlaySound("GetHit-Died"); GetKnockedDown(cameFrom, 0); return; } // Set state and tetxture state = AdonCloseState.TakeHit; this.Sprite = Texture_Walk_Idle; this.InitSpriteFrames(DRAW_WIDTH_TAKEHIT, DRAW_HEIGHT_TAKEHIT, 0, 2); this.SetOriginPosition("bottom"); this.SetDrawArea(); // Play Sound SoundManager.PlaySound("GetHit01"); // Face the man who beat you if (cameFrom == DirectionTarget.Left) { FacingDir = DirectionTarget.Right; } else { FacingDir = DirectionTarget.Left; } }
public SpecialEffects(string fxID, DirectionTarget facing, Level inLevel, TrashCan gameItem) { this.InLevel = inLevel; this.EffectsID = fxID; this.facing_dir = facing; this.gameItem = gameItem; switch (EffectsID) { case "trashcanhit": // TrashCan Blue Spark this.EffectsID = null; this.texture = Game1.SprSmallSpark; this.drawWidth = DRAW_SMALLSPARK_WIDTH; this.drawHeight = DRAW_SMALLSPARK_HEIGHT; this.frameX = 0; this.frameY = 1; Offset = new Vector2(50, 20); // Place this vector based of the actor position if (facing_dir == DirectionTarget.Left) { this.Position = new Vector2(gameItem.Position.X - Offset.X, gameItem.Position.Y - Offset.Y); } else { this.Position = new Vector2(gameItem.Position.X + Offset.X, gameItem.Position.Y - Offset.Y); } this.origin = new Vector2(this.drawWidth / 2, this.drawHeight / 2); break; } }
public override void GetHitKick(DirectionTarget cameFrom, int damage) { this.IsAttacking = false; this.Health -= damage; if (CheckForDeath()) { SoundManager.PlaySound("GetHit-Died"); GetKnockedDown(cameFrom, 0); return; } // Set state and tetxture this.state = EnemyRangedState.TakeHitLowKick; this.Sprite = Texture_React; this.InitSpriteFrames(DRAW_WIDTH_TAKEHIT, DRAW_HEIGHT_TAKEHIT, 3, 6); this.SetDrawArea(); this.SetOriginPosition("bottom"); // Face the man who beat you if (cameFrom == DirectionTarget.Left) { FacingDir = DirectionTarget.Right; } else { FacingDir = DirectionTarget.Left; } SoundManager.PlaySound("GetHit02"); SoundManager.PlaySound("GetHit-Shit"); }
public override void GetHitKick(DirectionTarget cameFrom, int damage) { this.IsAttacking = false; this.Health -= damage; if (this.CheckForDeath()) { SoundManager.PlaySound("RolentoDye"); GetKnockedDown(cameFrom, 0); return; } // Set state and tetxture this.state = RolentoEnemyRangedState.TakeHitLowKick; this.Sprite = Texture_Walk_Idle; this.InitSpriteFrames(DRAW_WIDTH_TAKEHITLOW, DRAW_HEIGHT_TAKEHITLOW, 0, 4); this.SetDrawArea(); // Face the man who beat you if (cameFrom == DirectionTarget.Left) { FacingDir = DirectionTarget.Right; } else { FacingDir = DirectionTarget.Left; } SoundManager.PlaySound("RolentoGetHit"); }
public override void GetKnockedDown(DirectionTarget cameFrom, int damage) { // Set state and texture IsAttackable = false; this.IsAttacking = false; state = AdonCloseState.KnockedDown; texture = Game1.SprAdonWalkIdle; frameX = 0; frameY = 4; drawWidth = DRAW_WIDTH_KNOCKDOWN; drawHeight = DRAW_HEIGHT_TAKEHIT; originCharacters = new Vector2((drawWidth / 2), drawHeight); SetDrawArea(); // Play Sound SoundManager.PlaySound("GetHit03"); // Face the man who beat you if (cameFrom == DirectionTarget.Right) { FacingDir = DirectionTarget.Left; } else { FacingDir = DirectionTarget.Right; } this.Health -= damage; }
public override void GetHitKick(DirectionTarget cameFrom, int damage) { this.IsAttacking = false; this.Health -= damage; if (CheckForDeath()) { SoundManager.PlaySound("GetHit-Died"); GetKnockedDown(cameFrom, 0); return; } // Set state and tetxture state = AdonCloseState.TakeHitLowKick; texture = Game1.SprAdonWalkIdle; frameX = 0; frameY = 4; drawWidth = DRAW_WIDTH_TAKEHITLOW; drawHeight = DRAW_HEIGHT_TAKEHITLOW; SetDrawArea(); // Play Sound SoundManager.PlaySound("GetHit02"); // Face the man who beat you if (cameFrom == DirectionTarget.Left) { FacingDir = DirectionTarget.Right; } else { FacingDir = DirectionTarget.Left; } }
public RolentoEnemy(DirectionTarget startingSide, Vector2 position, Level inLevel) : base(Vector2.Zero, inLevel) { this.Health = STARTING_HEALTH; this.FacingDir = startingSide; ResetIdleGraphic(); }
/// <summary> /// Create an enemy to spawn on a particular side of the screen /// </summary> /// <param name="startingSide"></param> /// <param name="inLevel"></param> public EnemyClose(DirectionTarget startingSide, Level inLevel) : base(Vector2.Zero, inLevel) { this.FacingDir = startingSide; ResetIdleGraphic(); drawColor = new Color(1f, 0.2f, 0.2f); // Set the draw color this.Health = STARTING_HEALTH; }
/// <summary> /// Create an enemy to spawn on a particular side of the screen /// </summary> /// <param name="startingSide"></param> /// <param name="inLevel"></param> public AdonEnemy(DirectionTarget startingSide, Level inLevel) : base(Vector2.Zero, inLevel) { this.FacingDir = startingSide; ResetIdleGraphic(); drawColor = Color.White; this.Health = STARTING_HEALTH; }
public EnemyRanged(DirectionTarget startingSide, Vector2 position, Level inLevel) : base(position, inLevel) { this.FacingDir = startingSide; this.Health = STARTING_HEALTH; this.DrawColor = new Color(1f, 0.2f, 0.2f); ResetIdleGraphic(); }
public void SetToWait(DirectionTarget facingDir) { this.state = EnemyCloseState.Wait; this.Sprite = Texture_Walk_Idle; this.InitSpriteFrames(DRAW_WIDTH_WAIT, DRAW_HEIGHT_WAIT, 0, 3); this.SetDrawArea(); this.SetOriginPosition("bottom"); this.FacingDir = facingDir; }
public void SetToWait(DirectionTarget facingDir) { this.FacingDir = facingDir; this.state = DeejayCloseState.Wait; this.Sprite = Texture_Walk_Idle; this.InitSpriteFrames(DRAW_WIDTH_IDLE, DRAW_HEIGHT_NORMAL, 0, 0); this.SetOriginPosition("bottom"); this.SetDrawArea(); }
public void SetToLayingDown(DirectionTarget facingDir) { this.FacingDir = facingDir; this.state = DeejayCloseState.LayingDown; this.Sprite = Texture_Walk_Idle; this.InitSpriteFrames(DRAW_WIDTH_WAIT, DRAW_HEIGHT_WAIT, 0, 7); this.SetOriginPosition("bottom"); this.SetDrawArea(); }
public void SetToWait(DirectionTarget facingDir) { texture = Game1.SprDeejayWalkIdle; drawWidth = DRAW_WIDTH_IDLE; drawHeight = DRAW_HEIGHT_NORMAL; frameX = 0; frameY = 0; SetDrawArea(); state = DeejayCloseState.Wait; this.originCharacters = new Vector2((drawWidth / 2), drawHeight); this.FacingDir = facingDir; }
public void SetToWait(DirectionTarget facingDir) { texture = Game1.SprAdonWalkIdle; drawWidth = DRAW_WIDTH_WAIT; drawHeight = DRAW_HEIGHT_WAIT; frameX = 0; frameY = 7; SetDrawArea(); state = AdonCloseState.Wait; this.originCharacters = new Vector2((drawWidth / 2), drawHeight); this.FacingDir = facingDir; }
public override void TakeHit(DirectionTarget cameFrom) { // Set speed and texture this.state = TrashCanState.Hit; this.texture = Game1.SprTrashCanHit; // Set speed based off hitDirection if (cameFrom == DirectionTarget.Left) { this.speed = new Vector2(-baseHitSpeed.X, baseHitSpeed.Y); } else { this.speed = baseHitSpeed; } SoundManager.PlaySound("CrashGlass"); SoundManager.PlaySound("MetalSound2"); }
public Rock(Vector2 startPos, DirectionTarget thrownDir, Level inLevel, Actor whoThrewMe) { this.whoThrewMe = whoThrewMe; this.zHeight = startPos.Y; this.InLevel = inLevel; this.origin = new Vector2(Game1.SprRocks.Width / 2, Game1.SprRocks.Height / 2); GetLayerDepth(zHeight); if (thrownDir == DirectionTarget.Left) { this.speed = BASE_SPEED * -1; this.Position = new Vector2( startPos.X - Offset.X, startPos.Y - Offset.Y); } else { this.speed = BASE_SPEED; this.Position = new Vector2( startPos.X + Offset.X, startPos.Y - Offset.Y); } }
public Rock(Vector2 startPos, DirectionTarget thrownDir, Level inLevel, Actor throwingActor) : base(startPos, inLevel, throwingActor) { this.Sprite = TextureManager.GetTexure("Rocks"); this.SetOffsetPosition(new Vector2(70, 90)); this.InitSpriteFrames(this.Sprite.Width, this.Sprite.Height); this.SetOriginPosition(); this.GetLayerDepth(startPos.Y); if (thrownDir == DirectionTarget.Left) { this.Speed.X = BASE_SPEED * -1; this.Position = new Vector2(startPos.X - Offset.X, startPos.Y - Offset.Y); } else { this.Speed.X = BASE_SPEED; this.Position = new Vector2(startPos.X + Offset.X, startPos.Y - Offset.Y); } }
public virtual void GetHitKick(DirectionTarget cameFrom, int damage) { }
public virtual void TakeHit(DirectionTarget cameFrom) { }
public virtual void GetKnockedDown(DirectionTarget cameFrom, int damage) { }