MichaelSinsbeck / platformer

A ninja platformer written in LÖVE
7 stars 0 forks source link

Show keys in upgrade-screen #251

Closed michalove closed 9 years ago

michalove commented 9 years ago

When a new bandana is collected, I want to show the player which button to press to use it. Is there a quick and easy way of getting the image for the correct button?

Germanunkol commented 9 years ago

Yes. There's getAnimationForKey and getAnimationForPad.

There's an example of how to place a key image into the level as an object: https://github.com/michalove/platformer/blob/master/scripts/objects/input.lua

Alternatively, there's getImageForKey and getImageForPad if you need the on and off states of the button (which I don't think you need).

michalove commented 9 years ago

Phantastic. Done.