public override void Updated() { if (this.IsAlive == false) { return; } var screen = this.machine.Screen; flyAnimator.Update(); if (framePath <= path.MaximumFrame) { path.GetPosition((int)framePath, out var offsetX, out var offsetY); X = originalX + offsetX; Y = originalY + offsetY; framePath += 0.5; if (framePath < frameThresold1) { isHorizontalFlipped = true; } else { isHorizontalFlipped = false; } } else { this.IsAlive = false; } if (Y < screen.BoundsClipped.Top - this.Height) { this.IsAlive = false; } // XScrolled est calculé ici this.SetScroll(page); if (frameBullet > 60 * 2) { frameBullet = 0; page.Bullets.GetFreeSprite().Fire(X, Y); } else { frameBullet++; } }
public override void Updated() { if (this.IsAlive == false) { return; } var screen = this.machine.Screen; walkAnimator.Update(); if (framePath <= path.MaximumFrame) { path.GetPosition(framePath, out var offsetX, out var offsetY); X = originalX + offsetX; Y = originalY + offsetY; if (framePath < directionThresold1) { isHorizontalFlipped = true; } else if (framePath < directionThresold2) { isHorizontalFlipped = false; } else if (framePath < directionThresold3) { isHorizontalFlipped = true; } else { isHorizontalFlipped = false; } framePath++; } else { this.IsAlive = false; } if (Y < screen.BoundsClipped.Top - this.Height) { this.IsAlive = false; } this.SetScroll(this.page); }
public override void Updated() { if (this.IsAlive == false) { return; } var screen = this.machine.Screen; walkAnimator.Update(); if (framePath <= path.MaximumFrame) { path.GetPosition((int)framePath, out var offsetX, out var offsetY); X = originalX + offsetX; Y = originalY + offsetY; framePath += 0.5; } else { this.IsAlive = false; } if (Y < screen.BoundsClipped.Top - this.Height) { this.IsAlive = false; } if (frameBullet > 60 * 3) { frameBullet = 0; page.Bullets.GetFreeSprite().Fire(X, Y); } else { frameBullet++; } this.SetScroll(page); }