Retro High Score Name Field

This plugin allows you to add a retro style high score name text field to your game. The player uses his / her keyboard to switch each character to the desired letter of the alphabet to make up his / her name.
Plugin URL: https://github.com/dpweberza/ImpactJS-Plugins
More Information: http://dpweberza.tumblr.com/
Plugin Demo: http://www.joylabs.co.za/html5/plugins/retroname
A demo app is included in the attached zip, you just need to copy your impact lib folder into the demo's lib folder.
I plan on adding support for mobile devices at a later stage.
Usage is really simple:
Include the entity in your module requires: 'game.entities.retrohighscorenamefield'
In your games init function spawn an instance of the entity by passing in two different fonts and the number of characters you need and then save the object returned so that you can ask it for the name later.
this.retroNameField = ig.game.spawnEntity(EntityRetroHighsSoreNameField, x, y, { fontNormal: this.fontNormal, fontHighlighted: this.fontHighlighted, numberOfChars: 3, // Optional, defaults to 3 letterSpacing: 20 // Optional, defaults to 20 });
To get the name after saying the Enter key was pressed simply call getName()
this.retroNameField.getName()
alexandre
Apparently, POI won't allow me to edit my posts. By cursor wraparound, I meant, for example, that pressing the UP key when you are at the letter A would take you back to the letter Z.
dpweberza
Hi Alexandre, good idea. I will set this up on github later today and post the link in the plugin description. Thanks for your contribution.
dpweberza
GitHub link is: https://github.com/dpweberza/ImpactJS-Plugins
alexandre
Great idea! Would you consider setting this up on github? I've made some mods to allow for cursor wraparound (e.g., A+ > Z) that I'd gladly send a pull request for.
Contributed by:
dpweberza
View Profile
dpweberza
Category:Other/Misc.
Updated:July 27, 2012
Version:0.1
Rating:
Your Rating (0)
Average Rating (4.5)
