Godot Nature of Code  1.2.0
Nature of Code implemented in Godot Engine
Public Member Functions | Protected Member Functions | List of all members
Ecosystem.Ecosystem.NervousButterfly Class Reference

Nervous butterfly. Same behavior than nervous fly. Uses multiple SimpleOscillator. More...

Inheritance diagram for Ecosystem.Ecosystem.NervousButterfly:
Ecosystem.Ecosystem.BaseFly Ecosystem.Ecosystem.Lifeform Forces.SimpleMover

Public Member Functions

 NervousButterfly ()
 Create a nervous butterfly. More...
 
- Public Member Functions inherited from Forces.SimpleMover
 SimpleMover ()
 Create a simple wrapping mover with a circle mesh. More...
 
 SimpleMover (WrapModeEnum wrapMode)
 Create a simple mover with a custom wrap mode and a circle mesh. More...
 
virtual void ApplyForce (Vector2 force)
 Apply force on mover. More...
 
virtual void ApplyAngularForce (float force)
 Apply angular force on mover. More...
 
virtual void ApplyFriction (float coef)
 Apply friction on mover. More...
 
virtual void ApplyAngularFriction (float coef)
 Apply angular friction on mover. More...
 
virtual void ApplyDrag (float coef)
 Apply drag on mover. More...
 
virtual void ApplyDamping (float coef)
 Apply damping on mover. More...
 

Protected Member Functions

override void UpdateAcceleration ()
 Update acceleration value. More...
 

Additional Inherited Members

- Public Types inherited from Forces.SimpleMover
enum class  WrapModeEnum { Wrap , Bounce , None }
 Wrapping mode enum. More...
 
- Public Attributes inherited from Ecosystem.Ecosystem.BaseFly
float AccelerationFactor = 0.5f
 Acceleration factor More...
 
float AngularAccelerationFactor = 0.01f
 Angular acceleration factor More...
 
Color BaseColor = Colors.White
 Base color More...
 
float WingRotationFactor = 0.5f
 Wing rotation factor More...
 
float WingSpeed = 64f
 Wing speed More...
 
float WingSize = 3f
 Wing size More...
 
byte WingColorAlpha = 80
 Wing alpha color More...
 
- Public Attributes inherited from Ecosystem.Ecosystem.Lifeform
bool DebugDrawEnabled
 Debug draw enabled? More...
 
- Public Attributes inherited from Forces.SimpleMover
Vector2 Velocity = Vector2.Zero
 Current velocity More...
 
Vector2 Acceleration = Vector2.Zero
 Current acceleration More...
 
float AngularVelocity
 Current angular velocity More...
 
float AngularAcceleration
 Current angular acceleration More...
 
float MaxVelocity = 10
 Max velocity More...
 
float MaxAngularVelocity = 0.1f
 Max angular velocity More...
 
float Mass = 1
 Mass More...
 
WrapModeEnum WrapMode
 Wrapping mode More...
 
bool DisableForces
 Disable forces More...
 
bool SyncRotationOnVelocity
 Synchronize rotation on velocity More...
 
SimpleMesh Mesh
 Mesh More...
 
- Protected Attributes inherited from Ecosystem.Ecosystem.BaseFly
float tWings
 Wings time More...
 
SimpleCircleSprite sBody
 Body sprite More...
 
SimpleCircleSprite sLeftWing
 Left wing sprite More...
 
SimpleCircleSprite sRightWing
 Right wing sprite More...
 
- Protected Attributes inherited from Forces.SimpleMover
CollisionShape2D collisionShape2D
 Collision shape More...
 
- Properties inherited from Forces.SimpleMover
bool Drawing [get, set]
 Draw mesh More...
 
Vector2 MeshSize [get, set]
 Mesh size More...
 
float Radius [get, set]
 Mesh radius More...
 

Detailed Description

Nervous butterfly. Same behavior than nervous fly. Uses multiple SimpleOscillator.

Definition at line 227 of file Ecosystem.cs.

Constructor & Destructor Documentation

◆ NervousButterfly()

Ecosystem.Ecosystem.NervousButterfly.NervousButterfly ( )
inline

Create a nervous butterfly.

Definition at line 245 of file Ecosystem.cs.

246  {
247  BaseColor = Colors.GreenYellow;
248  sLeftWing.Visible = false;
249  sRightWing.Visible = false;
250  }
SimpleCircleSprite sRightWing
Right wing sprite
Definition: Ecosystem.cs:99
Color BaseColor
Base color
Definition: Ecosystem.cs:75
SimpleCircleSprite sLeftWing
Left wing sprite
Definition: Ecosystem.cs:96

Member Function Documentation

◆ UpdateAcceleration()

override void Ecosystem.Ecosystem.NervousButterfly.UpdateAcceleration ( )
inlineprotectedvirtual

Update acceleration value.

Reimplemented from Forces.SimpleMover.

Definition at line 252 of file Ecosystem.cs.

253  {
255  Acceleration = new Vector2(
258  ) * AccelerationFactor;
259  }
float AngularAccelerationFactor
Angular acceleration factor
Definition: Ecosystem.cs:72
float AccelerationFactor
Acceleration factor
Definition: Ecosystem.cs:69
float AngularAcceleration
Current angular acceleration
Definition: SimpleMover.cs:36
Vector2 Acceleration
Current acceleration
Definition: SimpleMover.cs:30
Math utility functions
Definition: MathUtils.cs:7
static float SignedRandf()
Return a signed Randf, between -1 and 1.
Definition: MathUtils.cs:46

The documentation for this class was generated from the following file: