Playing
Chart
A song's chart as it starts.
| Field | Type | |
|---|---|---|
id | string | |
name | string | |
difficulty | Difficulty | |
level | string | "15" |
composer | string | |
charter | string | |
illustrator | string | |
mirror | boolean | |
notes | integer |
Hit
A judged note.
| Field | Type | |
|---|---|---|
judgement | Judgement | |
offset | number? | in ms, nil for a miss |
combo | integer | |
note | "tap"|"drag"|"hold"|"flick" | |
x | number? | screen pixels, nil while a replay is sought |
y | number? |
Stats
The play so far.
| Field | Type | |
|---|---|---|
score | integer | |
accuracy | number | over the notes judged so far |
combo | integer | |
maxcombo | integer | |
fc | boolean | |
ap | boolean | |
perfect | integer | |
good | integer | |
bad | integer | |
miss | integer | |
early | integer | |
late | integer |
Touch
| Field | Type | |
|---|---|---|
id | integer | |
phase | integer | |
x | number | screen pixels |
y | number |
playing()
The chart being played, or nil.
local chart = playing() if chart then print(chart.name, chart.difficulty, chart.level) end --> Glaciaxion IN 12
Returns Chart?
stats()
The play so far, nil outside of a song.
on("hit", function() local s = stats() print(s.combo, s.score, ("%.2f"):format(s.accuracy)) --> 412 874120 99.31 end)
Returns Stats?
touches()
This frame's fingers, replayed ones while watching (none while paused).
on("update", function() for _, touch in ipairs(touches()) do print(touch.id, touch.x, touch.y) end --> 0 1520 860 end)
Returns Touch[]
replaying()
True while a replay plays.
on("hit", function(hit) if replaying() then return end -- only the player's own plays count(hit) end)
Returns boolean
phigrospp.jump(t, to?, from?)
Puts the song being played t seconds into its chart, with its music: going forward the game misses the notes jumped over, going back the notes from there on come back unjudged, the score stays as it is. The one way to steer a song, a replay makes the same jumps. Given to, leaves only the notes from t to to on the field, whichever way it goes and with none missed: a section to practise. Given from, the music starts there: a lead-in before the notes.
phigrospp.jump(42.5) phigrospp.jump(42.5, 60) phigrospp.jump(40.5, 60, 42.5)
| Parameter | Type | |
|---|---|---|
t | number | |
to? | number | |
from? | number |
phigrospp.restart()
Puts the song being played back at its start in place, every note unjudged and nothing scored, the music waiting like a fresh start.
button("Restart", phigrospp.restart) on("restart", function() print("again") end)
phigrospp.pausing(allowed?)
Given false, the song being played can't be paused from its button nor started again until it's left, for a play others wait on. Returns whether it can.
on("song", function() phigrospp.pausing(false) end) print(phigrospp.pausing()) --> false
| Parameter | Type | |
|---|---|---|
allowed? | boolean |
Returns boolean
phigrospp.speed(x?)
How fast the song being played runs until it's left: its music, whose pitch follows, and its notes. Returns it.
phigrospp.speed(0.75) print(phigrospp.speed()) --> 0.75
| Parameter | Type | |
|---|---|---|
x? | number |
Returns number
phigrospp.pauseButton(x, y)
Whether a point of the screen (pixels) is on the pause button.
for _, touch in ipairs(touches()) do if phigrospp.pauseButton(touch.x, touch.y) then print("on pause") end end
| Parameter | Type | |
|---|---|---|
x | number | |
y | number |
Returns boolean
phigrospp.counts(value?)
Whether the song being played counts, false for a replay. A play with modifiers counts: it's recorded, and saves nothing either. Given false, it doesn't: not recorded, its result shows without saving.
on("song", function() phigrospp.counts(false) end) -- a practice play saves nothing print(phigrospp.counts()) --> false
| Parameter | Type | |
|---|---|---|
value? | false |
Returns boolean
Modifier
| Field | Type | |
|---|---|---|
id | string | "HR" |
bit | integer | |
name | string | |
percent | number | |
colour | Colour | |
icon | string | its picture, an svg's paths: <path d="M9 7 4 12l5 5..."/> |
phigrospp.modifiers.play()
The modifiers of the song being played as their bits, 0 for none (Modifiers), and the seed Random shuffled its chart from.
local mods, seed = phigrospp.modifiers.play() print(mods, seed) --> 16 83612
Returns integer (mods)
Returns integer (seed)
phigrospp.modifiers.pick(mask?)
The ones the player picked for the next song, sets them when given.
print(phigrospp.modifiers.pick()) --> 0 phigrospp.modifiers.pick(16 | 8) -- HR and HD for the next song
| Parameter | Type | |
|---|---|---|
mask? | integer |
Returns integer
phigrospp.modifiers.list
Modifier[]
Every modifier.
phigrospp.modifiers.total(score, mods)
The score a play counts for with its modifiers.
print(phigrospp.modifiers.total(1000000, 16)) --> 1060000
| Parameter | Type | |
|---|---|---|
score | integer | |
mods | integer |
Returns integer
phigrospp.modifiers.fits(id, difficulty)
Whether a chart plays with modifiers: one with effects of its own doesn't.
print(phigrospp.modifiers.fits("Glaciaxion.SunsetRay.0", "IN")) --> true
| Parameter | Type | |
|---|---|---|
id | string | |
difficulty | Difficulty |
Returns boolean
phigrospp.modifiers.strip(parent, mods, pos, width)
Their plates in a row under parent, each width wide.
phigrospp.modifiers.strip(row, 16 | 8, { 20, 30 }, 48)
| Parameter | Type | |
|---|---|---|
parent | Unity | |
mods | integer | |
pos | Vector | |
width | number |