Report a Bug

SIGN IN!

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
  Source/Support Files:  ImpactJsRetroHighScoreNameFieldPlugin.zip
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.

  1. this.retroNameField = ig.game.spawnEntity(EntityRetroHighsSoreNameField, x, y, {
  2. fontNormal: this.fontNormal,
  3. fontHighlighted: this.fontHighlighted,
  4. numberOfChars: 3, // Optional, defaults to 3
  5. letterSpacing: 20 // Optional, defaults to 20
  6. });

To get the name after saying the Enter key was pressed simply call getName()

  1. 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.
July 27, 2012, 8:19 am
July 27, 2012, 9:42 am
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.
   PLUGIN 
Contributed by:
dpweberza
View Profile
Category:Other/Misc.
Updated:July 27, 2012
Version:0.1
Rating:
Your Rating (0)
Average Rating (4.5)
Ready to get to the point?

Your Email will remain private and is only used for good. We promise!


Please use only letters, numbers or underscores.

SIGN UP!