Oprava spawnování monster, optimalizace v CommandProcessor a EventProcessor. Přesunutí některých tříd do vlastních namespaců, pročištění kódu, úpravy formátování, odstranění nepoužívaných souborů a zakomentovaného kódu
This commit is contained in:
parent
e5d746d597
commit
243f071a43
62 changed files with 873 additions and 1217 deletions
|
|
@ -10,29 +10,23 @@ public class JumpscareUIElement : UIElement {
|
|||
private int twitchVertical;
|
||||
private Point positionDefault;
|
||||
private Random random;
|
||||
private float defaultScaleMultiplier;
|
||||
private float twitchScale;
|
||||
|
||||
private bool playing = false;
|
||||
private Stopwatch stopwatch = new();
|
||||
private int duration;
|
||||
|
||||
public JumpscareUIElement(TextureRegion texture, Point positionDefault, int twitchHorizontal, int twitchVertical, float defaultScaleMultiplier, float twitchScale, int durationMs = 2000, Action afterStop = null) : base(texture, positionDefault) {
|
||||
public JumpscareUIElement(TextureRegion texture, Point positionDefault, int twitchHorizontal, int twitchVertical, float defaultScaleMultiplier, int durationMs = 2000, Action afterStop = null) : base(texture, positionDefault) {
|
||||
this.twitchHorizontal = twitchHorizontal;
|
||||
this.twitchVertical = twitchVertical;
|
||||
this.positionDefault = positionDefault;
|
||||
random = new Random();
|
||||
this.defaultScaleMultiplier = defaultScaleMultiplier;
|
||||
ScaleMultiplier = defaultScaleMultiplier;
|
||||
this.twitchScale = twitchScale;
|
||||
duration = durationMs;
|
||||
Active = false;
|
||||
Visible = false;
|
||||
AfterStop = afterStop;
|
||||
}
|
||||
|
||||
// public JumpscareUIElement(UIElement element) : base(element.GetTextures(), element.Bounds.Item1) {}
|
||||
|
||||
public void Play() {
|
||||
playing = true;
|
||||
Active = true;
|
||||
|
|
@ -51,8 +45,6 @@ public class JumpscareUIElement : UIElement {
|
|||
AfterStop();
|
||||
}
|
||||
}
|
||||
|
||||
// ScaleMultiplier = defaultScaleMultiplier + (float)(random.NextDouble() * twitchScale * new[]{-1, 1}[random.Next(2)]);
|
||||
}
|
||||
|
||||
private Action AfterStop;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue