Bouncing ball v234

$\textsf{JUMP!}$

(             )

\textsf{\\\\         NEXT\             LEVEL             \\\}

\textsf{Try to reach the flag using addition.}

\textsf{Now try to reach the flag with subtraction!}

\textsf{Now both – addition and subtraction!}

\textsf{Let's try bigger numbers.}

\textsf{You are unstoppable – climb even higher!}

\textsf{The numbers are growing – but so is your power!}

\textsf{Nothing can stop you – push to the top!}

\textsf{Even bigger challenges – but you’ve got this!}

\textsf{Keep going – the sky’s the limit!}

\textsf{The flag is further – but you’re smarter!}

\textsf{Input a number}

\textsf{↓}

\textsf{Now press JUMP}

\textsf{↓}

\textsf{Cool! Now try to reach the flag!}

\textsf{Now try subtraction!}

\textsf{     We're almost done!\Now try to get to the initial point.}

\textsf{THE GAME\BEGINS}

\textsf{THE GAME\BEGINS}

next level

to start

\textsf{WIN!!!}

skip tutorial

\textsf{\\\\\\\\\\\\\\\\\                          Collect 50 stars!                                                      \\\\\\\\\\\\\\\\\\\\}

$\textsf{Continue}$

$\textsf{Zoom to Fit}$

\textsf{Try again!}

$\textsf{START TUTORIAL}$

a = 0 (slider from -1000 to 1000)
anim = 0 (slider from 0 to 1)
studentNumber = NaN
InputBox2 = Textfield(studentNumber)
a_{i} = 0
jumps = 13 (slider from 1 to 50, step 1)
ifJumping: anim ≠ 0 ∧ anim < 1
level = 0
tutorialStep = 0 (slider from 0 to 4, step 1)
n = If(level ≟ 1 ∨ level ≟ 2, level - 1, level ≟ 0, If[tutorialStep < 2, 0, 1], Random[0, 1])
imageHeight = -0.02 (slider from -5 to 5, step 0.01)
A: (a - 0.05, ((If[Defined[studentNumber], abs(studentNumber) / 5 + 1, 0] * ℯ^((-7 * anim))) * abs(sin(((jumps * pi) * (anim + jumps^((-(2 / 5))))^(5 / 2))))) + imageHeight)
imageStretch = 0.6 (slider from 0 to 2)
firstGoal = 2
tutorialList: {firstGoal, -5, 0}
previousStudentNumber = 3
previousN = 0
previousGoal = 8
valueList = Remove(Sequence[-5 - (3 * level), 5 + (3 * level)], {previousGoal})
goalNumber = If(level ≟ 0, tutorialList(tutorialStep), RandomElement[valueList])
score = 0
animNextLevel = 0 (slider from 0 to 1)
ifFirstTry = false
text6: "LEVEL: " + (LaTeX[level]) + ""
xMin: x(Corner[1]) + 0.2
xMax: x(Corner[3])
aShift: If[round(a) < 0, 1, 0] + If[abs(round(a)) > 9, 1, 0] + If[abs(round(a)) > 99, 1, 0]
bracketsShift = If(studentNumber < 0, 2, 0)
graphics2LockZoom = -19.33 (slider from -20 to -19, step 0.01)
b: level ≟ 1
A_{i}: (a_{i} - 0.05, 0)
F: (a_{i}, 1.3)
G: (a, 1.4)
H: ((a + a_{i}) / 2, (0.7 * (abs(a_{i} - a))^(1 / 4)) + 1)
d = Circle(G, 0.01)
animTutorial = 1 (slider from 0 to 6.283185307179586, step 0.1)
c = CircumcircleArc(F, H, G)
I = Intersect(d, c, 1)
u = Vector(I, G)
J = Intersect(d, c, 2)
v = Vector(J, G)
animPlay = 0 (slider from 0 to 1)
introMask, introMask_s0, introMask_s1, introMask_s2, introMask_s3 = Polygon(Corner[1], Corner[2], Corner[3], Corner[4])
animFirework = 0 (slider from 0 to 2, step 0.02)
h = 1 (slider from -5 to 5)
randomShifts = Sequence(Random[-2, 2] / 10, h, -5, 5, 1)
RandomVelocities = Sequence((Random[-10, 10] / 14, Random[5, 10]), h, 1, 10)
fireworkPoints = Sequence((a + (animFirework * x(Element[RandomVelocities, h])), (animFirework * y(Element[RandomVelocities, h])) - (5 * animFirework^(2))), h, 1, 10)
flag = 1
K: (a, 0)
ifGameComplete = false
animComplete = 0 (slider from 0 to 2)
xPositions = Sequence(xMin + ((k - 1) * (xMax - xMin) / 39), k, 1, 40, 1)
yMax: y(Corner[2])
yMin: y(Corner[4])
phaseList = Shuffle(Sequence[k / 40, k, 1, 40, 1])
fallingPoints = Sequence((Element[xPositions, k], yMax - ((1 - Mod[animComplete + Element[phaseList, k], 1]^(2)) * (yMax - yMin))), k, 1, 40, 1)
animSky = 0 (slider from 0 to 1, step 0.01)
text4: "\math{" + (LaTeX[score]) + "" + (LaTeX[If[score < 50, "/50"]]) + "}"
animCollect = 0 (slider from 0 to 1)
text20: "\math{" + (LaTeX[If[previousN ≟ 0, "\textcolor{red}{+}", "\textcolor{blue}{-}"]]) + "" + (LaTeX[If[((a - a_{i}) * (-1)^(previousN)) < 0, "(", ""]]) + "" + (LaTeX[If[previousN ≟ 0, round(a) - a_{i}, a_{i} - round(a)]]) + "" + (LaTeX[If[((a - a_{i}) * (-1)^(previousN)) < 0, ")", ""]]) + "}"
ifContinue = false
distanceBallGoal: abs(a - goalNumber)
screenCenter = Midpoint(Corner[1], Corner[3])
pixelSize: Distance[Corner[1], Corner[2]] / 700
zoomCoef: 1 - 0.9^(distanceBallGoal)
animZoom = 0 (slider from 0 to (2 * pi))
ifFits: a ≥ xMin ∧ a ≤ xMax ∧ If[Defined[goalNumber], goalNumber ≥ xMin ∧ goalNumber ≤ xMax, true] ∧ yMin > 0 ∧ yMax < 0
flagCorner2: (goalNumber + 1, -0)
flagCorner1: (goalNumber - 0.11, 0)
flagPoint: (goalNumber, 0)
q1, f, g, i, j = Polygon(Corner[1], Corner[2], Corner[3], Corner[4])
ifStart: true
text3: "\mathsf{\text{is at }}" + (LaTeX[If[goalNumber < 0, "-\hspace{-0.2em}", ""]]) + "" + (LaTeX[abs(goalNumber)]) + " "
text31: "\mathsf{\text{is at }" + (LaTeX[If[a_{i} < 0, "-\hspace{-0.2em}", ""]]) + "" + (LaTeX[abs(a_{i})]) + " " + (LaTeX[If[n ≟ 0, "\textcolor{red}{+}", "\textcolor{blue}{-}"]]) + " " + (LaTeX[If[studentNumber < 0, "(", ""]]) + "" + (LaTeX[studentNumber]) + "" + (LaTeX[If[studentNumber < 0, ")", ""]]) + "}"
text11: "\mathsf{\text{is at }" + (LaTeX[If[a < 0, "-\hspace{-0.2em}", ""]]) + "" + (LaTeX[abs(a)]) + " " + (LaTeX[If[n ≟ 0, "\textcolor{red}{+}", "\textcolor{blue}{-}"]]) + "}"