Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make items bob #48

Closed
nwinter opened this issue Jan 2, 2014 · 2 comments
Closed

Make items bob #48

nwinter opened this issue Jan 2, 2014 · 2 comments
Assignees

Comments

@nwinter
Copy link
Contributor

nwinter commented Jan 2, 2014

Items, like health potions and swords and such, are currently kind of boring: they just sit on the ground. Lame. What instead they should do is what the Coins and Gems do: bob up and down in the air. But it'd be best to not have to embed a bobbing animation in each ThangType we intend to use with the inventory.Collectable Component.

screenshot 2014-01-02 13 58 42

Instead we should do something like what the WizardSprite does and make the bobbing happen automatically in the updatePosition method of any CocoSprite with thang.isCollectable == true.

screenshot 2014-01-02 13 59 56

Once that started working, we could remove the built-in bobbing animation from Coin and Gem, too.

After that's working, we'd probably want to not tie bobbing to the inventory.Collectable Component, but instead to make a new Component: display.Bobs or something like that. That would be nice, because then we could attach it to any flying Thangs, and we could remove the special-case code from the WizardSprite, too. All that display.Bobs would need to do is attach a bobs or maybe bobsUpAndDown property to the Thang, and the CocoSprite would read that instead of isCollectable. If we really wanted, we could configure the bob distance in that Component.

nwinter added a commit that referenced this issue Jan 5, 2014
Completed #48: Adds bobbing to thangs with 'bobs' property.
@nwinter
Copy link
Contributor Author

nwinter commented Jan 5, 2014

Perfect--thanks Tom!

@ghost ghost assigned nwinter Jan 8, 2014
@nwinter
Copy link
Contributor Author

nwinter commented Jan 8, 2014

Now I just need to update the existing items to use it.

@nwinter nwinter closed this as completed Jan 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant