Skip to content

Character and Chart scripts

Super edited this page Sep 3, 2021 · 29 revisions

As of 0.5.0, you will be able to provide a script with characters or charts. You can use these scripts to add custom features and such to the game while only having it effect one song. To add a script, you just put a script.hscript in the character or song's folder

Character methods:

All methods contain a reference to the character as the first argument

  • startSong ()
  • endSong ()
  • initScript ()
  • new ()
  • update (elapsed)
  • playAnim (animName)

Song methods:

All methods contain a reference to playState as the first argument

  • startSong ()
  • generateSong ()
  • endSong ()
  • initScript ()
  • update (elapsed)
  • beatHit ()
  • stepHit ()

BRtools

You can use BRtools to load sprites and play sounds without having to worry about the chart or character's folder path.
Available methods:

  • BRtools.loadSparrowSprite(x, y, PATH, ANIMATION, LOOP, FPS) - Loads a xml and png, example: spacebarthing = BRtools.loadSparrowSprite(0,0,"sprites/spacebar","spacepress",true);
  • BRtools.playSound(PATH, VOLUME) - Plays a sound, example: BRtools.playSound("sounds/Alarm.ogg",1);
  • BRtools.cacheSound(PATH),BRtools.cacheSprite(PATH) - loads a sound/sprite into memory. Example BRtools.cacheSprite("sprites/spacebar");
Clone this wiki locally