public BaseFly() { MeshSize = new Vector2(4, 4); MaxVelocity = 5f; MaxAngularVelocity = 0.01f; sBody = new SimpleCircleSprite(); sLeftWing = new SimpleCircleSprite(); sRightWing = new SimpleCircleSprite(); }
/// <summary> /// Create a simple pendulum. /// </summary> public SimplePendulum() { circleSprite = new SimpleCircleSprite() { Radius = 30 }; lineSprite = new SimpleLineSprite() { Width = 2 }; children = new Node2D(); }
public override void _Ready() { circleShape2D = new CircleShape2D() { Radius = Radius }; collisionShape2D = new CollisionShape2D() { Shape = circleShape2D }; AddChild(collisionShape2D); sprite = new SimpleCircleSprite() { Radius = Radius, Modulate = Colors.LightGoldenrod }; AddChild(sprite); }
/// <summary> /// Create a swimming fish. /// </summary> public SwimmingFish() { MaxVelocity = 1f; tail1 = new SimpleCircleSprite(); tail2 = new SimpleCircleSprite(); tail3 = new SimpleCircleSprite(); body1 = new SimpleCircleSprite(); body2 = new SimpleCircleSprite(); body3 = new SimpleCircleSprite(); body4 = new SimpleCircleSprite(); leftWing = new SimpleCircleSprite(); rightWing = new SimpleCircleSprite(); Color colorToUse = BaseColor; Color lightenedColor = colorToUse.Lightened(0.25f); Color lowDarkenedColor = colorToUse.Darkened(0.1f); Color midDarkenedColor = colorToUse.Darkened(0.25f); tail1.Modulate = colorToUse.Darkened(0.5f); tail2.Modulate = midDarkenedColor; tail3.Modulate = lowDarkenedColor; tail1.Radius = 2; tail2.Radius = 2; tail3.Radius = 2; body1.Modulate = colorToUse; body2.Modulate = colorToUse; body3.Modulate = colorToUse; body4.Modulate = colorToUse; body1.Radius = 3; body2.Radius = 4; body3.Radius = 5; body4.Radius = 4; leftWing.Modulate = lightenedColor; rightWing.Modulate = lightenedColor; leftWing.Radius = 1.5f; rightWing.Radius = 1.5f; }
/// <summary> /// Create a hopping bunny. /// </summary> public HoppingBunny() { body1 = new SimpleCircleSprite(); body2 = new SimpleCircleSprite(); paws1 = new SimpleCircleSprite(); paws2 = new SimpleCircleSprite(); paws3 = new SimpleCircleSprite(); paws4 = new SimpleCircleSprite(); tail = new SimpleCircleSprite(); leftEar1 = new SimpleCircleSprite(); leftEar2 = new SimpleCircleSprite(); leftEar3 = new SimpleCircleSprite(); leftEar4 = new SimpleCircleSprite(); leftEar5 = new SimpleCircleSprite(); head = new SimpleCircleSprite(); eye = new SimpleCircleSprite(); nose = new SimpleCircleSprite(); rightEar1 = new SimpleCircleSprite(); rightEar2 = new SimpleCircleSprite(); rightEar3 = new SimpleCircleSprite(); rightEar4 = new SimpleCircleSprite(); rightEar5 = new SimpleCircleSprite(); Color baseColor = BaseColor; Color darkenedColor = baseColor.Darkened(0.1f); // Body body1.Modulate = baseColor; body2.Modulate = baseColor; body1.Radius = 10; body2.Radius = 10; // Paws paws1.Modulate = darkenedColor; paws2.Modulate = darkenedColor; paws3.Modulate = darkenedColor; paws4.Modulate = darkenedColor; paws1.Radius = 2; paws2.Radius = 2; paws3.Radius = 2; paws4.Radius = 2; // Tail tail.Modulate = darkenedColor; tail.Radius = 4; // Left ear leftEar1.Modulate = darkenedColor; leftEar2.Modulate = darkenedColor; leftEar3.Modulate = darkenedColor; leftEar4.Modulate = darkenedColor; leftEar5.Modulate = darkenedColor; leftEar1.Radius = 3; leftEar2.Radius = 3; leftEar3.Radius = 3; leftEar4.Radius = 3; leftEar5.Radius = 3; // Head head.Modulate = baseColor; head.Radius = 8; // Eye eye.Modulate = EyeColor; eye.Radius = 2; // Nose nose.Modulate = baseColor; nose.Radius = 1.5f; // Right ear rightEar1.Modulate = darkenedColor; rightEar2.Modulate = darkenedColor; rightEar3.Modulate = darkenedColor; rightEar4.Modulate = darkenedColor; rightEar5.Modulate = darkenedColor; rightEar1.Radius = 3; rightEar2.Radius = 3; rightEar3.Radius = 3; rightEar4.Radius = 3; rightEar5.Radius = 3; }