diff options
Diffstat (limited to 'Oneko.cs')
| -rw-r--r-- | Oneko.cs | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -75,10 +75,11 @@ class Oneko : Drawable Position += TargetDirection; if (InactivityTimer > 3f) Animation = ScratchSelf; - if (InactivityTimer > 5f) Animation = Sleep; + if (InactivityTimer > 5f) Animation = Yawn; + if (InactivityTimer > 6f) Animation = Sleep; FrameCounter = (FrameCounter+1)%(Animation.AnimSpeed+1); - Frame = FrameCounter/Animation.AnimSpeed; + Frame = (int)MathF.Round((float)FrameCounter/(float)Animation.AnimSpeed); } public override void Dispose() @@ -87,9 +88,9 @@ class Oneko : Drawable base.Dispose(); } - struct OnekoAnimation(Rectangle frame1, Rectangle frame2, int animSpeed) + struct OnekoAnimation(Rectangle frame1, Rectangle frame2, byte animSpeed) { - public int AnimSpeed = animSpeed; + public byte AnimSpeed = animSpeed; Rectangle Frame1 = frame1; Rectangle Frame2 = frame2; @@ -153,7 +154,7 @@ class Oneko : Drawable static readonly OnekoAnimation Yawn = new(Yawn1, Yawn1, 1); static readonly OnekoAnimation Clean = new(Clean1, Clean1, 1); static readonly OnekoAnimation ScratchSelf = new(Scratch1, Scratch2, 1); - static readonly OnekoAnimation Sleep = new(Sleep1, Sleep2, 4); + static readonly OnekoAnimation Sleep = new(Sleep1, Sleep2, 10); static readonly OnekoAnimation RunUp = new(RunUp1, RunUp2, 1); static readonly OnekoAnimation RunUpLeft = new(RunUpLeft1, RunUpLeft2, 1); static readonly OnekoAnimation RunLeft = new(RunLeft1, RunLeft2, 1); |
