This is an archive of my old blog (2008–2013), kept online because people still use it. XNA has been discontinued; MonoGame is its open-source successor, and the techniques still apply. Comments are closed.

World of Goo: Cursor

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:

GooCursor 2009-01-26 00-34-27-52 GooCursor 2009-01-26 00-34-29-77

GooCursor 2009-01-26 00-34-59-21 GooCursor 2009-01-26 00-35-43-53

GooCursor 2009-01-26 00-36-14-92 GooCursor 2009-01-26 00-37-23-76

GooCursor 2009-01-26 00-38-05-53 GooCursor 2009-01-26 00-39-30-55

GooCursor 2009-01-26 00-40-10-53

Download: GooCursor.zip

22 comments on “World of Goo: Cursor”

  1. Music is bliss on XNA forums, I was searching some stuff about the Viewport class you suggested I use, and ended up on your website through google, taking advantage of the irony, I decided to browse it, and I love how you replicated this cursor.

    to be honest, the only 2 things i liked in world of goo was the cursor, and the actual goo placement programming. good job on the replication, and your programming amazes me. that is all.

  2. I'm glad you like it, and hope you find it useful.
    I liked the idea for World of Goo (and the cursor, obviously), but it didn't keep me interested enough to make it through to the last level. Maybe some other time, when I'm need of a quick gaming session :)

  3. I have programmed this cursor too, it is on my game, here you con download an play/edit it:

    http://www.mediafire.com/file/4wbowzmomqv/JustFantasy!0.6a.zip

  4. @Catalin is it computationally impossible ? Is anyone able to make this cursor ? I would pay $4.99 for it no doubt.

  5. Just want to let you know that I was working on something similar. You can have a look on my website http://curltable.the-yard.net/curltable/mouse-trail

  6. i had tried to use the 'goocursor.zip' but it is not a cur file.
    now what can i do ??????????????

  7. Sorry I had to laugh when I read all the questions about an actual windows cursor implementation that a lot of commenters asked for.
    An actual proof of how influential World of Goo was?
    Good job on your sample, Catalin :)

  8. Hi, you helped me a lot, and I've just modified a little your code for making it better (I think), and I want to share it with you, I made a video so you can see the the results:

    http://vimeo.com/20019564

    If you want me to put the very simple code of the modification, just answer me.

    Thank you for sharing!

  9. Thanks a lot for the example. The clear code is really helpful!
    Can you please explain in short how the texture is a 32x32 square, but the final draw makes it a circle? I figured out myself that it probably has something to do with the blendstate. Thanks!

  10. It took me forever to realize that the it's not a 32x32 square... it's a circle... Had to open it in gimp to find that out.