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

  • Pingback: Catalin’s XNA Experiments » World of Goo Cursor Sample Thought

  • shane

    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.

  • http://www.catalinzima.com Catalin Zima

    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 :)

  • http://www.celticfans.info f1sh

    Hey mate, can I use this cursor in Windows ? Please reply. Many thanks

  • http://www.catalinzima.com Catalin Zima

    @fish: No, you can only use it inside XNA applications.

  • http://trinit.es Windgate

    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

  • Hotgoblin

    i want use it on desktop :(

  • http://www.catalinzima.com Catalin Zima

    @Hotgoblin sorry, you can’t

  • http://www.codeplex.com/bling Sean McDirmid

    I replicated the Goo cursor in WPF using Bling’s physics support. Nice effect!

  • Tomas Skelton

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

  • http://www.catalinzima.com Catalin Zima

    @Tomas: It’s technically impossible to use this code for the cursor in Windows

  • eslam_jazz

    thaaaaaaaaaaaaaanks

  • http://www.curltable.de David

    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

  • superkk99

    DUDE’S I DID EVERTHING IT WONT WORK!!!!!!!!!!!!!!!!! PLEASE HELP ME *cry’s*

  • http://www.catalinzima.com Catalin Zima

    Did you try simply running the sample?

  • superkk99

    no i dont know what that is.

  • umar muzammil

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

  • http://www.catalinzima.com Catalin Zima

    You can’t use this in windows. This is just for use in a game made with XNA

  • http://www.polynaught.com/ Marco Sperling

    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 :)

  • http://Website Antonio Liñán

    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!

  • Pingback: Ingeniero Informático en busca de trabajo

  • http://Website Tomas

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

  • http://Website Clayphd

    It took me forever to realize that the it’s not a 32×32 square… it’s a circle… Had to open it in gimp to find that out.

  • abhishek

    can you develop a xna application with this which run in background