Skip to content

Commit

Permalink
updated template script
Browse files Browse the repository at this point in the history
  • Loading branch information
Joalor64GH authored Nov 19, 2024
1 parent 0825872 commit b430345
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 44 deletions.
103 changes: 60 additions & 43 deletions assets/scripts/template.hxs
Original file line number Diff line number Diff line change
@@ -1,43 +1,60 @@
function create() {
trace("Script initialized!");
}

function startCountdown() {
// when the countdown starts
}

function update(elapsed:Float) {
// while the game is updating
}

function beatHit(curBeat:Int) {
// every beat hit
}

function stepHit(curStep:Int) {
// every step hit
}

function pause() {
// when the game pauses
}

function resume() {
// when the game resumes
}

function noteHit(note:Note, rating:String) {
// when a note is hit
}

function noteMiss(direction:String) {
// when a note is missed
}

function endSong() {
// when the song ends
}

function destroy() {
// when playstate ends
}
/**
* Called when the script is created.
*/
function create() {}

/**
* Called when the countdown starts in PlayState.
*/
function startCountdown() {}

/**
* Called every frame.
* @param elapsed The elapsed time between frames.
*/
function update(elapsed:Float) {}

/**
* Called every beat hit in PlayState.
* @param curBeat The current song beat.
*/
function beatHit(curBeat:Int) {}

/**
* Called every step hit in PlayState.
* @param curStep The current song step.
*/
function stepHit(curStep:Int) {}

/**
* Called when the game is paused.
*/
function pause() {}

/**
* Called when the game is resumed.
*/
function resume() {}

/**
* Called when a note is hit.
* @param note The note that was hit.
* @param rating The rating given.
*/
function noteHit(note:Note, rating:String) {}

/**
* Called when a note is missed.
* @param direction The note direction that was missed.
*/
function noteMiss(direction:String) {}

/**
* Called when the song ends.
*/
function endSong() {}

/**
* Called when leaving PlayState.
*/
function destroy() {}
1 change: 0 additions & 1 deletion docs/Scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ The following are not supported:
* `final`
* Wildcard imports
* Access modifiers (e.g., `private`, `public`)
* Multi-line comments (`/* ... */`)

## Default Variables
* `Function_Stop` - Cancels functions (e.g., `startCountdown`, `endSong`).
Expand Down

0 comments on commit b430345

Please sign in to comment.