ShakeTypes - Eneskp3441/Shaker GitHub Wiki

Shake Types

Godot_v4 2 2-stable_win64_nr4OG99WEd Godot_v4 2 2-stable_win64_QXkuSlJMlS Godot_v4 2 2-stable_win64_cohVFKYUNh
ShakeTypeBrownianShake ShakeTypeCurve ShakeTypeNoiseShake
Godot_v4 2 2-stable_win64_bhHg5RVqJp Godot_v4 2 2-stable_win64_AZB2avvyGf Godot_v4 2 2-stable_win64_kNqIoaKDPA
ShakeTypeRandom ShakeTypeSawtoothWave ShakeTypeSineWave
Shake Type
ShakeTypeSquareWave

ShakeTypeBase

ShakeTypeBase is the foundational class for all shake types. It provides the basic structure and properties that are common to all shake types. Here's an explanation of its main components:

@export var amplitude: float = 1.0
  • Defines the magnitude of the shake effect.
  • Can be modified in the editor or via code.
@export var offset: float = 0.0
  • Determines the starting point or phase of the shake effect.
  • Can be adjusted to change the initial position of the shake.
func set_amplitude(value: float) -> void:
    amplitude = value
    on_property_changed("amplitude")
  • Sets the amplitude and notifies that the property has changed.
func get_amplitude() -> float:
    return amplitude
  • Returns the current amplitude value.
func set_offset(value: float) -> void:
    offset = value
    on_property_changed("offset")
  • Sets the offset and notifies that the property has changed.
func get_offset() -> float:
    return offset
  • Returns the current offset value.
func get_value(t: float) -> float:
    var result: float = 0.0
    return result
  • A placeholder method to be overridden by derived classes.
  • Calculates the shake value at a given time t.
  • Each specific shake type will implement its own logic here.

Note: For 2D and 3D shake types, float is replaced with Vector2 and Vector3 respectively for amplitude, offset, and the return type of get_value.