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.
- Looks
- 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
- Behavior
- 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.
Screenshots:
Download: GooCursor.zip
Pingback: Catalin’s XNA Experiments » World of Goo Cursor Sample Thought
Pingback: Ingeniero Informático en busca de trabajo