Feature/shake - #32
Conversation
| var keyboardBind = StuffResolver.GetStuff<ITextInputBinder>(); | ||
| keyboardBind?.Init(); | ||
|
|
||
| /*PerlinNoise.Seed = RandomExt.Global.Next*/ |
|
|
||
| // Random seed | ||
| private static int _seed = new Random((int)DateTime.Now.Ticks).Next(); | ||
| private static int _seed = 0; |
|
|
||
| _stoleDainty = false; | ||
| } | ||
| else if (Input.CheckButton(StealButton)) |
There was a problem hiding this comment.
No reason to have else if there.
| { | ||
| public class ShakeDemo : Entity | ||
| { | ||
| public static readonly string Description = "A to doubt." + |
There was a problem hiding this comment.
Description convention in other demos is Button - action
| private Sprite _dainty; | ||
| private Vector2 _daintyPosition; | ||
|
|
||
| private bool _stoleDainty; |
| if (Input.CheckButton(DoubtButton)) | ||
| { | ||
| _currentShake = _shaker.Shake( | ||
| new ShortShakePreset() |
There was a problem hiding this comment.
Presets should be created once and reused.
|
|
||
| if (_currentShake != null) | ||
| { | ||
| displacement = _currentShake.CurrentDisplacement.Position; |
There was a problem hiding this comment.
This is not how you use the shaker at all. Shaker has _shaker.ShakePosition and _shaker.ShakeRotation which properly add up all acting shakes.
There was a problem hiding this comment.
You've also forgot to include the rotation.
|
The demo is funi, I like it, but it doesn't showcase everything that it could showcase.
|
No description provided.