public ChaseSubAct() { _finished = false; _tempTimers = new(); _ghostPoints = Points.From(200); _tempSprites = new(); _ghosts = new(); var justOffScreen = new Vector2(250, 140); _ghostEatenTimer = new(0.Milliseconds(), static () => { });
public ChaseSubAct() { _finished = false; _tempTimers = new TimerList(); _ghostScore = 200; _tempSprites = new TimedSpriteList(); _ghosts = new List <AttractGhost>(); var justOffScreen = new Vector2(250, 140); _ghostEatenTimer = new EggTimer(0.Milliseconds(), () => { }); _ghostTimer = new EggTimer(5.Seconds(), async() => await reverseChase()); _pacTimer = new EggTimer(5.1f.Seconds(), () => { }); _powerPillToEat = new PowerPill { Visible = false, Position = new Vector2(30, justOffScreen.Y - 4) }; _pillLegend = new Pill { Position = new Vector2(70, 178) }; _powerPillLegend = new PowerPill { Position = new Vector2(66, 182) }; _pacMan = new AttractScenePacMan { Direction = Directions.Left }; var blinky = new AttractGhost(GhostNickname.Blinky, Directions.Left); var pinky = new AttractGhost(GhostNickname.Pinky, Directions.Left); var inky = new AttractGhost(GhostNickname.Inky, Directions.Left); var clyde = new AttractGhost(GhostNickname.Clyde, Directions.Left); _ghosts.Add(blinky); _ghosts.Add(pinky); _ghosts.Add(inky); _ghosts.Add(clyde); var gap = new Vector2(16, 0); _pacPositions = new StartAndEndPos(justOffScreen, new Vector2(30, justOffScreen.Y)); _pacMan.Position = _pacPositions.Start; _ghostPositions = new Dictionary <GhostNickname, StartAndEndPos>(); var startPos = justOffScreen + new Vector2(50, 0); var endPos = new Vector2(50, justOffScreen.Y); blinky.Position = startPos; _ghostPositions[blinky.NickName] = new StartAndEndPos(startPos, endPos); startPos = startPos + gap; endPos = endPos + gap; pinky.Position = startPos; _ghostPositions[pinky.NickName] = new StartAndEndPos(startPos, endPos); startPos = startPos + gap; endPos = endPos + gap; inky.Position = startPos; _ghostPositions[inky.NickName] = new StartAndEndPos(startPos, endPos); startPos = startPos + gap; endPos = endPos + gap; clyde.Position = startPos; _ghostPositions[clyde.NickName] = new StartAndEndPos(startPos, endPos); _tempTimers.Add(new EggTimer(1.Seconds(), () => _legendVisible = true)); _tempTimers.Add(new EggTimer(3.Seconds(), () => { _powerPillToEat.Visible = true; _copyrightVisible = true; })); _tempTimers.Add(new EggTimer(4500.Milliseconds(), () => { _ghostsChasing = true; })); }