Skip to content

NoteLanes

A rhythm game’s lanes, with no code: notes from a chart (a table of beats and lanes) scroll toward a hit line in time with the music, and the player presses each lane’s key, button or touch zone as its notes reach the line, holding a hold note down until its end. Each press is judged by how far it is from the note’s beat as the player hears it (their audio offset allowed for), Perfect, Great, Good or Miss, which adds to the Score, the Combo and the Accuracy, pops up over the lanes and sends a message for anything else in the game to act on.

Part of the Rhythm module: Rhythm games: lanes of notes from a chart (a table of beats and lanes) that scroll to a hit line in time with the music (NoteLanes), each press judged Perfect, Great, Good or Miss against the beat as the player hears it; and Create Note Lanes in the Entity menu, with a song and its chart at three difficulties; a SongSelect to pick a song and difficulty with its best score; and the Rhythm template, a whole rhythm game.

The chart is a table (Data > New Table, or Entity > Genres > Rhythm > Create Note Lanes, which makes one with a song): a row a note, with its Beat (counting from 0, the music’s first, as a BeatClock counts), its Lane (1 for the first), a Hold in beats for a note to hold down (empty or 0 for a tap) and the Difficulty it’s in (empty for every one; “Easy, Normal” for two). It plays its Song (or keeps time with the music playing) by its BeatClock, drawing the notes ahead by the player’s visual offset so they cross the line as the beat is heard, and judging each press by the beat as it’s heard. It starts as it’s shown (its Start action starts it again, Play at a difficulty), pauses with the game, and says when the song is over with its CompleteMessage. Each machine of a network game plays its own player’s lanes and judges them there; what they score goes to the host, which sends the messages and adds the points to that player’s score.

Works with: BeatClock (keeps the time the notes are judged by); Text (shows its Score, Combo, Accuracy, Judgment or Grade); Trigger (does something on a Hit, a Perfect or a Miss); SongSelect (play the song a song select picked)

Takes the player’s input only while it has focus (its Controllable): its Focus action hands it the input and takes it from everything else the same player plays.

Draws itself (its entity draws at Order 300 unless it has a Sprite, whose order counts).

In a network game, each machine keeps its own entity with this on it: it isn’t sent.

Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.

  • song: text = null. The song to play, e.g. “Music/song.wav”: from the start as the lanes start, once through. Its chart is the table named like it (Music/Groove.wav plays the Groove table) unless Chart says. Empty keeps time with the music playing (a Background Music’s), or with none, clicks a metronome at its clock’s tempo. (Music in Assets, e.g. “Music/song.wav”.) (Field: music.)
  • savedSong: text = null. A name in the save data holding the song to play, e.g. “Song” (where a SongSelect keeps the one picked): while a song is saved there it’s played in place of Song, with its own chart (the table named like it). (Names a name in the save data.) (Field: a name.)
  • chart: text = null. The table of notes to play: a row a note, with a Beat, a Lane (from 1), a Hold in beats (empty for a tap) and the Difficulty it’s in (empty for all). Empty: the table named like the Song (or the music playing). (Names a table.) (Field: a name.)
  • difficulty: text = “Normal”. Which of the chart’s difficulties to play, e.g. “Hard”: its notes whose Difficulty names it, and those that name none. Empty plays only the notes that name none. (Difficulties, one per row (or one, for a single name), as the charts’ Difficulty column names them, e.g. “Easy”, “Normal”, “Hard”. The Inspector picks from the difficulties the charts have.) (Field: its own editor: Difficulties.)
  • savedDifficulty: text = null. A value a menu saved (a Choice’s or a SongSelect’s Save As, e.g. “difficulty”) naming the difficulty to play, when the chart has it; Difficulty otherwise. (Names a name in the save data.) (Field: a name.)
  • clock: text = null. The entity whose BeatClock times the notes. Empty: its own, or else the scene’s first. (Names an entity.) (Field: an entity’s name.)
  • startOnShow: true or false = true. Starts as soon as it’s shown (as the scene starts, or its panel opens). Off, it waits for its Start or Play action. (Field: on or off.)
  • volume: a number = 0.8. How loud its Song plays, 0 to 1, on top of the player’s music volume. (Field: a number.)
  • lanes: a whole number = 4. How many lanes, side by side. (Field: a number.)
  • direction: one of Down, Up, Left, Right = “Down”. Which way the notes travel to the hit line. (Field: one of its values.)
  • speed: a number = 10. How fast the notes come, in world units a second: faster spreads them out. Each player can make it faster or slower still with their own note speed (Game.NoteSpeed, which a slider can set). (Field: a number.)
  • length: a number = 9. How long the lanes are, from where the notes come in to the far end past the hit line, in world units. (Field: a number.)
  • laneWidth: a number = 1.3. How wide each lane is, in world units. (Field: a number.)
  • hitLine: a number = 1.2. How far the hit line is from the end of the lanes the notes travel to, in world units. (Field: a number.)
  • actions: text = “Lane1, Lane2, Lane3, Lane4”. The input actions that press the lanes, the first lane’s first, separated by commas: Lane1 to Lane4 are D, F, J and K, the arrows, and the D-pad or the face buttons. A lane without one is pressed by touch alone. (Names input actions: their names, separated by commas.) (Field: a name.)
  • clicks: true or false = true. A click or a tap on a lane presses it, and on a touch screen each finger on one does, so chords and holds play by touch. (Field: on or off.)
  • controllable: true or false = true. Untick it to have the lanes ignore the keys, mouse, touches and gamepad while the song plays on: another part of the scene has the player’s input. Its Focus action ticks it and unticks it on everything else the player plays. (Field: on or off.)
  • perfectWindow: a number = 45. A press this close to a note’s beat (early or late), in milliseconds, is Perfect. (Field: a number.)
  • greatWindow: a number = 90. A press this close, in milliseconds, is Great. (Field: a number.)
  • goodWindow: a number = 135. A press this close, in milliseconds, is Good. A note this late with no press is a Miss. (Field: a number.)
  • missWindow: a number = 180. A press earlier than the Good Window but this close, in milliseconds, is a Miss: pressed too soon. Further off, a press isn’t taken for that note at all. (Field: a number.)
  • colors: text = “#F2607E #F2BC4B #4BC4F2 #9A72F2”. The notes’ colors, a lane each from the first, as hex colors separated by spaces (“#F2607E #F2BC4B”), round again for more lanes than colors. (Colors in order, as hex colors separated by spaces, e.g. “#F2607E #F2BC4B”. The Inspector lists them a row each with the color shown.) (Field: its own editor: List Of.)
  • laneColor: a color, “#RRGGBB” or “#RRGGBBAA” = “#101422C8”. The lanes’ own color, behind the notes. Transparent draws none. (Field: a color.)
  • popSize: a number = 0.7. How big the judgment that pops up as a note is hit (and the combo under it) is drawn, in world units. 0 shows none. (Field: a number.)
  • order: a whole number = 300. Higher draws on top, like Sprite.Order (an entity’s sprite says for it). (Field: a number.)
  • hitSound: text = null. A sound played on each hit (not a Miss), e.g. “Sounds/tick.wav”. Empty plays none: the music is the sound. (A sound in Assets, e.g. “Sounds/hit.wav”.) (Field: a sound.)
  • missSound: text = null. A sound played on each Miss. (A sound in Assets, e.g. “Sounds/hit.wav”.) (Field: a sound.)
  • hitMessage: text = “Hit”. A message sent on each Perfect, Great and Good, with the points it scored as its data: a Counter listening for it adds up the score, and a Trigger can fire a weapon on it. (Names a message.) (Field: a name.)
  • perfectMessage: text = “Perfect”. A message sent on each Perfect, as well as the HitMessage: for a bonus. (Names a message.) (Field: a name.)
  • missMessage: text = “Miss”. A message sent on each Miss. (Names a message.) (Field: a name.)
  • completeMessage: text = “Song Complete”. A message sent once the song is over (every note judged, and its song done), with the score as its data: a panel with this as its Open Message shows the results. (Names a message.) (Field: a name.)
  • saveBestAs: text = “Best”. A name to keep the best score of each song and difficulty under in the save data, with its grade: “Best” keeps a Normal play of the Groove chart as “Best.Groove.Normal” (and “Best.Groove.Normal.Grade”), which Best and a SongSelect show. Empty keeps none. (Names a name in the save data: this entity’s own, which other fields can name.) (Field: a name.)
  • isPlaying: true or false = false. True while its chart plays. Saved with the scene, so a rewind carries the song on from there. (Field: on or off.)
  • songTime: a number = 0. Seconds into its Song it has got to. The game sets it, so a rewind or a pause carries the song on from there. (Field: a number.)
  • played: text = “”. How each note went, in the chart’s order, two marks a note (the press, then a hold’s end): . not yet, P Perfect, G Great, O Good, M Miss, S left out (gone by before it started), - no end (a tap). The game sets it; a rewind takes it back. (Plain text: how each note went: the game writes it.) (Field: text.)
  • score: a whole number = 0. The points scored: 300 a Perfect, 200 a Great, 100 a Good. (Field: a number.)
  • combo: a whole number = 0. Hits in a row since the last Miss (a hold’s end counts as one). (Field: a number.)
  • bestCombo: a whole number = 0. The longest combo so far. (Field: a number.)
  • perfects: a whole number = 0. How many Perfects so far. (Field: a number.)
  • greats: a whole number = 0. How many Greats so far. (Field: a number.)
  • goods: a whole number = 0. How many Goods so far. (Field: a number.)
  • misses: a whole number = 0. How many Misses so far. (Field: a number.)
  • best: a whole number = 0. The best score kept for the song and difficulty it plays (see SaveBestAs), 0 before any: this play’s once it’s over and beats it. Set by the game. (Field: a number.)
  • newBest: true or false = false. True once the song is over with a score beating the best kept for it: a “New best!” on the results. Set by the game. (Field: on or off.)

What anything can make it do with no code: a Trigger’s do when its message arrives, a Contraptions Wire’s input as its signal comes on, a script’s Game.Do(entity, “Name”).

  • Start. Starts the chart from the top, at its Difficulty: the song from its start, the score at 0.
  • Play (done with a name, its difficulty: a trigger’s with). Starts the chart from the top at difficulty (e.g. “Hard”), which becomes its Difficulty.
  • Stop. Stops the chart where it is, and its song.
  • Focus. Gives its entity the player’s input: whatever there and inside it has focus, and everything else the same player plays loses it (a platformer’s player stops on the arrow keys while a board takes them).

What anything can read with no code: a Counter’s, Bar’s or Text’s output, a Contraptions Wire’s output as its signal; Text shows names too, the rest read numbers, true as 1.

  • IsPlaying (true or false). True while its chart plays. Saved with the scene, so a rewind carries the song on from there.
  • Score (a whole number). The points scored: 300 a Perfect, 200 a Great, 100 a Good.
  • Combo (a whole number). Hits in a row since the last Miss (a hold’s end counts as one).
  • BestCombo (a whole number). The longest combo so far.
  • Perfects (a whole number). How many Perfects so far.
  • Greats (a whole number). How many Greats so far.
  • Goods (a whole number). How many Goods so far.
  • Misses (a whole number). How many Misses so far.
  • Best (a whole number). The best score kept for the song and difficulty it plays (see SaveBestAs), 0 before any: this play’s once it’s over and beats it. Set by the game.
  • NewBest (true or false). True once the song is over with a score beating the best kept for it: a “New best!” on the results. Set by the game.
  • FullCombo (true or false). True while every note judged so far was hit (one at least, and no Miss): a “Full combo!” on the results.
  • Title (a name). The name of the chart it plays (its song’s, “Groove” for Music/Groove.wav): a title over the lanes or on the results.
  • Playing (a name). The difficulty it plays: a saved one (see SavedDifficulty), or its Difficulty.
  • Progress (a number). How far through the chart it is, from 0 at the start of the song to 1 at its last note’s end: a bar shows it.
  • Notes (a whole number). How many notes the chart it plays has (a hold is one note, judged as it’s pressed and at its end).
  • Accuracy (a number). How well it’s going, from 0 to 100: the points scored out of what Perfects all along would have scored. 100 before the first note.
  • Grade (a name). A letter for the Accuracy: S from 95, A from 90, B from 80, C from 70, D below (empty before the first note).
  • Judgment (a name). The last judgment, “Perfect”, “Great”, “Good” or “Miss” (empty before the first).
  • Timing (a number). How far the last press that was taken for a note was from its beat as the player heard it, in milliseconds: below 0 early, above 0 late. For an “Early” or “Late” under the judgment, or to see whether a player’s offset needs setting.

Not saved with the scene; scripts read them, and entity_get shows them as live while the game plays.

  • fullCombo: true or false. True while every note judged so far was hit (one at least, and no Miss): a “Full combo!” on the results.
  • title: text. The name of the chart it plays (its song’s, “Groove” for Music/Groove.wav): a title over the lanes or on the results.
  • playingDifficulty: text. The difficulty it plays: a saved one (see SavedDifficulty), or its Difficulty.
  • progress: a number. How far through the chart it is, from 0 at the start of the song to 1 at its last note’s end: a bar shows it.
  • notes: a whole number. How many notes the chart it plays has (a hold is one note, judged as it’s pressed and at its end).
  • accuracy: a number. How well it’s going, from 0 to 100: the points scored out of what Perfects all along would have scored. 100 before the first note.
  • grade: text. A letter for the Accuracy: S from 95, A from 90, B from 80, C from 70, D below (empty before the first note).
  • judgment: text. The last judgment, “Perfect”, “Great”, “Good” or “Miss” (empty before the first).
  • timing: a number. How far the last press that was taken for a note was from its beat as the player heard it, in milliseconds: below 0 early, above 0 late. For an “Early” or “Late” under the judgment, or to see whether a player’s offset needs setting.

Scripts use it as NoteLanes: its methods, events and values that aren’t saved with the scene.