Last active
November 19, 2020 20:23
-
-
Save mamamia5x/8db8ea19e9c769b5a5d6b53ee8a1c6fe to your computer and use it in GitHub Desktop.
SCRIPT-8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//title: Reflexes | |
var frame = 0; | |
var second = 0; | |
var time; | |
var difference = []; | |
var diff; | |
var over = false; | |
var framedisplay; | |
init = state => { | |
} | |
update = (state, input, elapsed) => { | |
if (input.startReleased){ | |
time = framedisplay; | |
frame = 0; | |
second = 0; | |
over = !over; | |
if (over == true){ | |
diff = Math.abs(5 - time); | |
diff = diff.toFixed(2); | |
difference.push(diff); | |
difference.sort(); | |
if (difference.length > 3){ | |
var diffs = difference; | |
difference = []; | |
difference.push(diffs[0]); | |
difference.push(diffs[1]); | |
difference.push(diffs[2]); | |
} | |
} | |
} | |
} | |
draw = state => { | |
clear(); | |
frame ++; | |
if (over == false){ | |
if (frame > 60){ | |
frame = 0; | |
second ++; | |
} | |
framedisplay = frame * (1+2/3); | |
framedisplay = Math.floor(framedisplay); | |
framedisplay = second+'.'+framedisplay; | |
framedisplay *= 1; | |
print(60,50,framedisplay); | |
print(10,60,"Press Start to stop the time"); | |
print(0,0,difference); | |
} | |
else { | |
print(60,50,time); | |
print(10,60,"You were off by " + diff); | |
print(0,0,difference); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"iframeVersion": "0.1.280", | |
"lines": [ | |
56, | |
0, | |
0, | |
0, | |
0, | |
0, | |
0, | |
0 | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment