Skip to content

Feature/shake - #32

Open
Ne1gh-RR wants to merge 3 commits into
developfrom
feature/shake
Open

Feature/shake#32
Ne1gh-RR wants to merge 3 commits into
developfrom
feature/shake

Conversation

@Ne1gh-RR

Copy link
Copy Markdown
Collaborator

No description provided.

@Ne1gh-RR
Ne1gh-RR requested a review from Martenfur May 21, 2025 03:17
var keyboardBind = StuffResolver.GetStuff<ITextInputBinder>();
keyboardBind?.Init();

/*PerlinNoise.Seed = RandomExt.Global.Next*/

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove


// Random seed
private static int _seed = new Random((int)DateTime.Now.Ticks).Next();
private static int _seed = 0;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default value should be -1


_stoleDainty = false;
}
else if (Input.CheckButton(StealButton))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to have else if there.

{
public class ShakeDemo : Entity
{
public static readonly string Description = "A to doubt." +

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description convention in other demos is Button - action

private Sprite _dainty;
private Vector2 _daintyPosition;

private bool _stoleDainty;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_isDaintyStolen

if (Input.CheckButton(DoubtButton))
{
_currentShake = _shaker.Shake(
new ShortShakePreset()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presets should be created once and reused.


if (_currentShake != null)
{
displacement = _currentShake.CurrentDisplacement.Position;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not how you use the shaker at all. Shaker has _shaker.ShakePosition and _shaker.ShakeRotation which properly add up all acting shakes.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've also forgot to include the rotation.

@Martenfur

Martenfur commented May 21, 2025

Copy link
Copy Markdown
Owner

The demo is funi, I like it, but it doesn't showcase everything that it could showcase.

  1. There aren't any comments at all.
    This is a demo, we're showing people how to use this stuff. It should include an extensive explanation of why shaker is the way it is.
    When you create a shaker instance, for example, leave a comment that you can create multiple shakers at once, that users need to be aware that these shakers are entities bound to the layer system.

  2. It's not utilized as a camera shaker.
    You got the correct idea that these shakers can be used for anything, not JUST for camera but when people think about shaking they think about cameras and such. Add a button where you hook it up to a basic explosion shake and it shakes the entire camera. Again, leave a comment explaining why it is this way.

  3. Current shake settings are pretty bad. Doubt barely shakes the cat, S is twitchy and D is way too strong and goes on for too long. Make them more pleasant, we can tune the presets in vc if you want.

  4. Make a custom shake present. Something very simple, base it on the default presets. It just needs to show that we can make custom presets. And again, explain everything in the demo's comments.

  5. Gotta think on a way to hook up a shaker to a camera by default. Since it's noц a part of Monofoxe, we can write an easy way to achieve that. Not sure what's that gotta be, do everything I said above first and then we'll think about a camera api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants