public VillDeathCloud(Vill vill) : base(vill.entityArea) { this.vill = vill; this.x = vill.x; this.y = vill.y + 4; frames = new FAtlasElement[] { Futile.atlasManager.GetElementWithName("Arena/Vill_Death1"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death2"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death3"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death4") }; cloudHolder = new FContainer(); cloudSprite = new FSprite(frames[0]); cloudSprite.scaleX = RXRandom.Bool() ? -1f : 1f; cloudHolder.AddChild(cloudSprite); cloudSprite.shader = FShader.Additive; cloudSprite.alpha = RXRandom.Range(0.8f, 0.9f); cloudSprite.color = vill.player.player.color.color + new Color(0.1f, 0.1f, 0.1f, 0.0f); graveHolder = new FContainer(); graveSprite = new FSprite("Arena/VillGrave1_body"); graveHolder.AddChild(graveSprite); graveSpriteColor = new FSprite("Arena/VillGrave1_color"); graveHolder.AddChild(graveSpriteColor); graveSpriteColor.color = vill.player.player.color.color + new Color(0.5f, 0.5f, 0.5f); graveSprite.y = graveSpriteColor.y = 5; Update(); }
public HumanDeathCloud(Human human) : base(human.entityArea) { this.human = human; this.x = human.x; this.y = human.y + 4; frames = new FAtlasElement[] { Futile.atlasManager.GetElementWithName("Arena/Vill_Death1"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death2"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death3"), Futile.atlasManager.GetElementWithName("Arena/Vill_Death4") }; cloudHolder = new FContainer(); cloudSprite = new FSprite(frames[0]); cloudSprite.scaleX = RXRandom.Bool() ? -1f : 1f; cloudHolder.AddChild(cloudSprite); cloudSprite.shader = FShader.Additive; cloudSprite.alpha = RXRandom.Range(0.8f, 0.9f); cloudSprite.color = human.player.player.color.color + new Color(0.1f, 0.1f, 0.1f, 0.0f); cloudSprite.scale = 2.0f; graveHolder = new FContainer(); graveSprite = new FSprite("Arena/Human_Grave_1"); graveHolder.AddChild(graveSprite); graveSprite.color = human.player.player.color.color + new Color(0.5f, 0.5f, 0.5f); graveSprite.y = 16; Update(); }
protected override void Update() { if (CurrentState == State.HIT) { base.Update(); return; } lastDecision += Time.deltaTime; if (lastDecision >= MIN_DECISION) { if (RXRandom.Float() < .3f) { moving = !moving; } else if (RXRandom.Float() > .7f) { if (RXRandom.Bool()) { currentDirection += 1; } else { currentDirection -= 1; } if (currentDirection < 0) { currentDirection = Dir.RIGHT; } else if (!Enum.IsDefined(typeof(Dir), currentDirection)) { currentDirection = 0; } } lastDecision = 0; nextDecision = MIN_DECISION + (MAX_DECISION - MIN_DECISION) * RXRandom.Float(); base.Update(); } if (moving) { switch (currentDirection) { case Dir.UP: walkUp(); break; case Dir.LEFT: walkLeft(); break; case Dir.DOWN: walkDown(); break; case Dir.RIGHT: walkRight(); break; } } base.Update(); }