Game: World of Goo, made by 2D Boy
Replicated Feature: The shape and behavior of the mouse cursor
More Information: [Blog Post]
Using the Sample:
The most important element of the sample is the Cursor class. This is a DrawableGameComponent the handles the updating and drawing of the cursor. To add a cursor to your game, you simply add a cursor instance to your Components list.
By default, the cursor is made to look similar to the one in World of Goo, but I also provided plenty of customization points. There are several properties of this class that control how the cursor looks and behaves.
- StartScale â€“ the scale of the starting node in the cursorâ€™s trail
- EndScale â€“ the scale of the ending node in the cursorâ€™s trail
- LerpExponent â€“ controls how the transition from the StartScale to the EndScale is done
- FillColor â€“ the color used for the inside area of the cursor
- BorderColor â€“ the color used for the border of the cursor
- BorderSize â€“ size (in pixels) of the border around the cursor
- TrailStiffness â€“ controls the stiffness of the springs between trail nodes. A higher value causes the springs to be stiffer, so the cursor will have a shorter elongation. A lower value will cause the cursor to have a longer trails
- TrailDamping â€“ controls the damping factor that affects the velocity of the trail nodes
- TrailNodeMass â€“ specifies the mass of each node
Most properties are also modifiable using the keyboard at runtime, so you can experiment with different values.
To control the cursor, you can use either the mouse, or a gamepad.