public ProximitySensor(Touching dir, Red_Boss parent) : base(Vector2.Zero, Drawing.DrawOrder.ENTITIES) { visible = false; this.parent = parent; direction = dir; switch (dir) { case Touching.UP: width = parent.width; height = 8; offset_from_parent = new(0, -21); break; case Touching.DOWN: width = parent.width + 4; height = 12; offset_from_parent = new(0, parent.height + 8); break; case Touching.LEFT: width = 12; height = parent.height + 20; offset_from_parent = new(-18, -10); break; case Touching.RIGHT: width = 8; height = parent.height + 16; offset_from_parent = new(parent.width + 7, -8); break; } }
public void Spawn(Touching dir, Red_Boss parent) { if (dir.HasFlag(Touching.UP)) { Position = parent.Position + new Vector2(16 * t_index - 14, -13); } else if (dir.HasFlag(Touching.LEFT)) { Position = parent.Position + new Vector2(-14, 16 * t_index - 16); } else if (dir.HasFlag(Touching.RIGHT)) { Position = parent.Position + new Vector2(parent.width + 2, 16 * t_index - 16); } else if (dir.HasFlag(Touching.DOWN)) { Position = parent.Position + new Vector2(16 * t_index - 14, parent.height + 2); } else { //player isn't close in any direction, so random locations Vector2 ul = MapUtilities.GetRoomUpperLeftPos(GlobalState.CurrentMapGrid); Position.X = ul.X + 16 + 12 * (1 + t_index) + GlobalState.RNG.Next(-5, 6); Position.Y = ul.Y + 16 * GlobalState.RNG.Next(1, 4) + GlobalState.RNG.Next(-5, 6) + tentacle.height - height; } tentacle.Position = Position + Vector2.UnitY * (height - 3 - tentacle.height); tentacle.y_push = tentacle.height; Flicker(0.7f + (float)GlobalState.RNG.NextDouble()); state = StateLogic(); }
public SmallWave(Red_Boss parent) : base(Vector2.Zero, "red_boss_small_wave", 16, 64, Drawing.DrawOrder.BG_ENTITIES) { spawn_point = MapUtilities.GetRoomUpperLeftPos(GlobalState.CurrentMapGrid) + new Vector2(96, 48); AddAnimation("move", CreateAnimFrameArray(0, 1), 8); AddAnimation("rise", CreateAnimFrameArray(2, 3), 8); AddAnimation("fall", CreateAnimFrameArray(1, 2, 3, 4), 8, false); exists = false; immovable = true; }
public Ripple(Red_Boss parent) : base(parent.Position, "red_boss_ripple", 48, 8, Drawing.DrawOrder.BG_ENTITIES) { AddAnimation("a", CreateAnimFrameArray(0, 1), 12); Play("a"); this.parent = parent; }