setscreen ("graphics:750;750, nocursor, noecho")
%Stars
var q : int
var w : int
% Done By
var f2 : int := Font.New ("Ignacio:22:bold") % Font Information
assert f2 > 0 % Make Sure Font Is Made
% Adding
var f4 : int := Font.New ("Ignacio:16") % Font Information
assert f4 > 0 % Make Sure Font Is Made
% Menu
var f3 : int := Font.New ("Ignacio:44") % Font Information
assert f3 > 0 % Make Sure Font Is Made
% Subtract
var f5 : int := Font.New ("Ignacio:16") % Font Information
assert f5 > 0 % Make Sure Font Is Made
% Multiply
var f6 : int := Font.New ("Ignacio:16") % Font Information
assert f6 > 0 % Make Sure Font Is Made
% Divide
var f7 : int := Font.New ("Ignacio:16") % Font Information
assert f7 > 0 % Make Sure Font Is Made
% Exit
var f8 : int := Font.New ("Ignacio:16") % Font Information
assert f8 > 0 % Make Sure Font Is Made
% Credits
var f9 : int := Font.New ("Ignacio:50:bold") % Font Information
assert f9 > 0 % Make Sure Font Is Made
var f10 : int := Font.New ("Ignacio:16:bold")
assert f10 > 0
var f11 : int := Font.New ("Ignacio:16:bold") % Font Information
assert f11 > 0 % Make Sure Font Is Made
% Click To Let Magic Begin
var f12 : int := Font.New ("Ignacio:14") % Font Information
assert f12 > 0 % Make Sure Font Is Made
% Variable For Select Level (Addition)
var f14 : int := Font.New ("Ignacio:32") % Font Information
assert f14 > 0 % Make Sure Font Is Made
% Back (Addition)
var f15 : int := Font.New ("Ignacio:16")
assert f15 > 0
% Easy (Addition)
var f16 : int := Font.New ("Ignacio:16")
assert f16 > 0
% Normal (Addition)
var f17 : int := Font.New ("Ignacio:16")
assert f17 > 0
% Hard (Addition)
var f18 : int := Font.New ("Ignacio:16")
assert f18 > 0
% Varaiable For buttonwait
var x : int
var y : int
var bnum : int
var bud : int
var a : int
var b : int
var c : int
var answer : int
const NUM_OF_QUESTIONS := 5
var temp : int
var count : int := 0
% Music Variable (Finished)
var finished : boolean := false
var finished2 : boolean := false
% During
var finished3 : boolean := false
% End During
var finished4 : boolean := false
var finished5 : boolean := false
% Flicker Free Transitions
View.Update
%%%%%%%%%%% Music Variables %%%%%%%%%%%%
% Splash Screen
process splash
loop
exit when finished
Music.PlayFile ("Splash.mp3")
end loop
end splash
% Menu Screen
process menu
loop
exit when finished2
Music.PlayFile ("Menu.mp3")
end loop
end menu
% During Gameplay
process Dgame
loop
exit when finished3
Music.PlayFile ("Termina.mp3")
end loop
end Dgame
% Back To Menu
process BTM
loop
exit when finished4
Music.PlayFile ("Menu.mp3")
end loop
end BTM
% Credits Music
process CM
loop
exit when finished5
Music.PlayFile ("Splash.mp3")
end loop
end CM
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SPLASH SCREEN %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fork splash
% Horizon Above (Sky)
drawfillbox (0, 300, 200, 600, 53)
drawfillbox (200, 300, 500, 600, 53)
drawfillbox (500, 300, 750, 600, 53)
drawfillbox (0, 600, 750, 750, 53)
% Horizon Below (Ground)
drawfillbox (0, 0, 750, 300, 45)
% Tree (Left)
drawfillbox (0, 0, 150, 400, red)
% Tree (Left) Leaves
drawfillbox (125, 225, 225, 325, green)
drawfillbox (115, 305, 250, 500, green)
drawfillbox (0, 365, 125, 550, green)
% Tree (Right)
drawfillbox (600, 0, 750, 375, red)
% Tree (Right) Leaves
drawfillbox (625, 375, 750, 550, green)
drawfillbox (500, 325, 625, 500, green)
drawfillbox (525, 225, 625, 325, green)
% Title (Creating The Font)
Pic.ScreenLoad ("MagicMath.jpg", 135, 520, picCopy)
% Font (Done By..)
Font.Draw ("Done By: Jawad Khan", 227, 180, f2, black)
% Instruction
Font.Draw ("!Press A Key Then Click, Let The Magic Begin!", 190, 120, f12, black)
% Stars
for s1 : 1 .. 15
randint (q, 0, 700)
randint (w, 620, 750)
loop
drawfillstar (q, w, q + 10, w + 10, yellow)
delay (100)
drawfillstar (q, w, q + 10, w + 10, white)
exit when hasch
end loop
end for
% Click To Enter Menu
buttonwait ("down", x, y, bnum, bud)
% Ending the Music
% Stops the background music.
finished := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
%%%%%%%%% Variables %%%%%%%%
loop
delay (150)
fork menu
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MENU %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Color Back
drawfillbox (0, 0, 750, 750, 53)
% Horizon Below (Ground)
drawfillbox (0, 0, 750, 300, 45)
% Tree (Left)
drawfillbox (0, 0, 150, 400, red)
% Tree (Left) Leaves
drawfillbox (125, 225, 225, 325, green)
drawfillbox (115, 305, 250, 500, green)
drawfillbox (0, 365, 125, 550, green)
% Tree (Right)
drawfillbox (600, 0, 750, 375, red)
% Tree (Right) Leaves
drawfillbox (625, 375, 750, 550, green)
drawfillbox (500, 325, 650, 500, green)
drawfillbox (525, 225, 625, 325, green)
% Selections Boxes
drawfillbox (85, 275, 223, 375, 43) % Add
drawfillbox (100, 285, 210, 365, 44)
Font.Draw ("Add", 135, 315, f4, black)
drawfillbox (235, 275, 373, 375, 43) % Sub
drawfillbox (245, 285, 365, 365, 44)
Font.Draw ("Subtract", 265, 315, f5, black)
drawfillbox (385, 275, 520, 375, 43) % Multiply
drawfillbox (395, 285, 510, 365, 44)
Font.Draw ("Multiply", 415, 315, f6, black)
drawfillbox (530, 275, 665, 375, 43) % Divide
drawfillbox (540, 285, 655, 365, 44)
Font.Draw ("Divide", 565, 315, f7, black)
drawfillbox (310, 165, 445, 265, 43) % Exit
drawfillbox (320, 175, 435, 255, 44)
Font.Draw ("Exit", 360, 205, f8, black)
% Menu
Font.Draw ("Menu", 300, 440, f3, black)
% Stars
for s1 : 1 .. 15
randint (q, 0, 700)
randint (w, 620, 750)
loop
drawfillstar (q, w, q + 10, w + 10, yellow)
delay (100)
drawfillstar (q, w, q + 10, w + 10, white)
exit when hasch
end loop
end for
% Buttonwait & Loop
buttonwait ("down", x, y, bnum, bud)
% Ending the Music
% Stops the background music.
finished2 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Addition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if x > 85 and x < 223 and y > 275 and y < 375 then
loop
fork Dgame
% Horizon Above (Sky)
drawfillbox (0, 300, 200, 600, 53)
drawfillbox (200, 300, 500, 600, 53)
drawfillbox (500, 300, 750, 600, 53)
drawfillbox (0, 600, 750, 750, 53)
% Horizon Below (Ground)
drawfillbox (0, 0, 750, 300, 45)
% Tree (Left)
drawfillbox (0, 0, 150, 400, red)
% Tree (Left) Leaves
drawfillbox (125, 225, 225, 325, green)
drawfillbox (115, 305, 250, 500, green)
drawfillbox (0, 365, 125, 550, green)
% Tree (Right)
drawfillbox (600, 0, 750, 375, red)
% Tree (Right) Leaves
drawfillbox (625, 375, 750, 550, green)
drawfillbox (500, 325, 625, 500, green)
drawfillbox (525, 225, 625, 325, green)
% Selection Boxes (Level)
Font.Draw ("Select Your Level", 220, 565, f14, black)
Font.Draw ("Addition", 302, 625, f14, black)
drawfillbox (305, 380, 440, 480, 43) % Back
drawfillbox (315, 390, 430, 470, 44)
Font.Draw ("Back", 350, 425, f15, black)
drawfillbox (305, 275, 440, 375, 43) % Easy
drawfillbox (315, 285, 430, 365, 44)
Font.Draw ("Novice", 345, 320, f16, black)
drawfillbox (305, 170, 440, 270, 43) % Moderate
drawfillbox (315, 180, 430, 260, 44)
Font.Draw ("Moderate", 335, 210, f17, black)
drawfillbox (305, 65, 440, 165, 43) % Hard
drawfillbox (315, 75, 430, 155, 44)
Font.Draw ("Expert", 345, 100, f18, black)
buttonwait ("down", x, y, bnum, bud)
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 9)
randint (b, 0, 9)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 285, 565, f14, black)
get answer
Font.Draw (intstr (a) + " + " + intstr (b) + " = " + intstr (answer), 285, 565, f14, black)
if answer = a + b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a + b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 30)
randint (b, 0, 30)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " + " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a + b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a + b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -10, 30)
randint (b, -10, 30)
Font.Draw (intstr (a) + " + " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " + " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a + b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a + b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a + b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Addition End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Subtraction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 235 and x < 373 and y > 275 and y < 375 then
loop
% Horizon Above (Sky)
drawfillbox (0, 300, 200, 600, 53)
drawfillbox (200, 300, 500, 600, 53)
drawfillbox (500, 300, 750, 600, 53)
drawfillbox (0, 600, 750, 750, 53)
% Horizon Below (Ground)
drawfillbox (0, 0, 750, 300, 45)
% Tree (Left)
drawfillbox (0, 0, 150, 400, red)
% Tree (Left) Leaves
drawfillbox (125, 225, 225, 325, green)
drawfillbox (115, 305, 250, 500, green)
drawfillbox (0, 365, 125, 550, green)
% Tree (Right)
drawfillbox (600, 0, 750, 375, red)
% Tree (Right) Leaves
drawfillbox (625, 375, 750, 550, green)
drawfillbox (500, 325, 625, 500, green)
drawfillbox (525, 225, 625, 325, green)
% Selection Boxes (Level)
Font.Draw ("Select Your Level", 220, 565, f14, black)
Font.Draw ("Subtraction", 267, 625, f14, black)
drawfillbox (305, 380, 440, 480, 43) % Back
drawfillbox (315, 390, 430, 470, 44)
Font.Draw ("Back", 350, 425, f15, black)
drawfillbox (305, 275, 440, 375, 43) % Easy
drawfillbox (315, 285, 430, 365, 44)
Font.Draw ("Novice", 345, 320, f16, black)
drawfillbox (305, 170, 440, 270, 43) % Moderate
drawfillbox (315, 180, 430, 260, 44)
Font.Draw ("Moderate", 335, 210, f17, black)
drawfillbox (305, 65, 440, 165, 43) % Hard
drawfillbox (315, 75, 430, 155, 44)
Font.Draw ("Expert", 345, 100, f18, black)
buttonwait ("down", x, y, bnum, bud)
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 9)
randint (b, 0, 9)
if b > a then
temp := b
b := a
a := temp
end if
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 285, 565, f14, black)
get answer
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (answer), 285, 565, f14, black)
if answer = a - b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a - b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 30)
randint (b, 0, 30)
if b > a then
temp := b
b := a
a := temp
end if
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a - b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a - b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for o : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -10, 20)
randint (b, -10, 20)
Font.Draw (intstr (a) + " - " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " - " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a - b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a - b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a - b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Subtract End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Multplication %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 385 and x < 520 and y > 275 and y < 375 then
loop
fork Dgame
% Horizon Above (Sky)
drawfillbox (0, 300, 200, 600, 53)
drawfillbox (200, 300, 500, 600, 53)
drawfillbox (500, 300, 750, 600, 53)
drawfillbox (0, 600, 750, 750, 53)
% Horizon Below (Ground)
drawfillbox (0, 0, 750, 300, 45)
% Tree (Left)
drawfillbox (0, 0, 150, 400, red)
% Tree (Left) Leaves
drawfillbox (125, 225, 225, 325, green)
drawfillbox (115, 305, 250, 500, green)
drawfillbox (0, 365, 125, 550, green)
% Tree (Right)
drawfillbox (600, 0, 750, 375, red)
% Tree (Right) Leaves
drawfillbox (625, 375, 750, 550, green)
drawfillbox (500, 325, 625, 500, green)
drawfillbox (525, 225, 625, 325, green)
% Selection Boxes (Level)
Font.Draw ("Select Your Level", 220, 565, f14, black)
Font.Draw ("Multiplication", 250, 625, f14, black)
drawfillbox (305, 380, 440, 480, 43) % Back
drawfillbox (315, 390, 430, 470, 44)
Font.Draw ("Back", 350, 425, f15, black)
drawfillbox (305, 275, 440, 375, 43) % Easy
drawfillbox (315, 285, 430, 365, 44)
Font.Draw ("Novice", 345, 320, f16, black)
drawfillbox (305, 170, 440, 270, 43) % Moderate
drawfillbox (315, 180, 430, 260, 44)
Font.Draw ("Moderate", 335, 210, f17, black)
drawfillbox (305, 65, 440, 165, 43) % Hard
drawfillbox (315, 75, 430, 155, 44)
Font.Draw ("Expert", 345, 100, f18, black)
buttonwait ("down", x, y, bnum, bud)
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 5)
randint (b, 0, 5)
Font.Draw (intstr (a) + " * " + intstr (b) + " =", 285, 565, f14, black)
get answer
Font.Draw (intstr (a) + " * " + intstr (b) + " = " + intstr (answer), 285, 565, f14, black)
if answer = a * b then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 0, 10)
randint (b, 0, 10)
Font.Draw (intstr (a) + " * " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " * " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -5, 10)
randint (b, -5, 10)
Font.Draw (intstr (a) + " * " + intstr (b) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a) + " * " + intstr (b) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Multiply End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Divide %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 530 and x < 665 and y > 275 and y < 375 then
loop
fork Dgame
% Horizon Above (Sky)
drawfillbox (0, 300, 200, 600, 53)
drawfillbox (200, 300, 500, 600, 53)
drawfillbox (500, 300, 750, 600, 53)
drawfillbox (0, 600, 750, 750, 53)
% Horizon Below (Ground)
drawfillbox (0, 0, 750, 300, 45)
% Tree (Left)
drawfillbox (0, 0, 150, 400, red)
% Tree (Left) Leaves
drawfillbox (125, 225, 225, 325, green)
drawfillbox (115, 305, 250, 500, green)
drawfillbox (0, 365, 125, 550, green)
% Tree (Right)
drawfillbox (600, 0, 750, 375, red)
% Tree (Right) Leaves
drawfillbox (625, 375, 750, 550, green)
drawfillbox (500, 325, 625, 500, green)
drawfillbox (525, 225, 625, 325, green)
% Selection Boxes (Level)
Font.Draw ("Select Your Level", 220, 565, f14, black)
Font.Draw ("Division", 302, 625, f14, black)
drawfillbox (305, 380, 440, 480, 43) % Back
drawfillbox (315, 390, 430, 470, 44)
Font.Draw ("Back", 350, 425, f15, black)
drawfillbox (305, 275, 440, 375, 43) % Easy
drawfillbox (315, 285, 430, 365, 44)
Font.Draw ("Novice", 345, 320, f16, black)
drawfillbox (305, 170, 440, 270, 43) % Moderate
drawfillbox (315, 180, 430, 260, 44)
Font.Draw ("Moderate", 335, 210, f17, black)
drawfillbox (305, 65, 440, 165, 43) % Hard
drawfillbox (315, 75, 430, 155, 44)
Font.Draw ("Expert", 345, 100, f18, black)
buttonwait ("down", x, y, bnum, bud)
if x > 305 and x < 440 and y > 275 and y < 375 then % Easy
colorback (53)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 1, 8)
randint (b, 1, 8)
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = ", 285, 565, f14, black)
get answer
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = " + intstr (answer), 285, 565, f14, black)
if answer = a * b div a then
Font.Draw ("Correct!", 300, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b div a), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b div a then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 170 and y < 270 then % Normal
colorback (68)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, 1, 10)
randint (b, 1, 10)
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b div a then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Correct Answer Is " + intstr (a * b div a), 90, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b div a then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
elsif x > 305 and x < 440 and y > 65 and y < 165 then % Hard
colorback (40)
for i : 1 .. NUM_OF_QUESTIONS
cls
randint (a, -5, 10)
randint (b, -5, 10)
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = ", 90, 565, f14, black)
get answer
Font.Draw (intstr (a * b) + " / " + intstr (a) + " = " + intstr (answer), 90, 565, f14, black)
if answer = a * b div a then
Font.Draw ("Correct!", 90, 450, f14, black)
else
Font.Draw ("Sorry, The Right Answer Is " + intstr (a * b div a), 80, 400, f14, black)
end if
Font.Draw ("Press The Enter Key To Continue...", 40, 300, f14, black)
loop
exit when hasch
end loop
if answer = a * b div a then
count := count + 1
end if
cls
colorback (68)
Font.Draw ("You Got " + intstr (count) + " Out Of 5", 250, 500, f14, black)
delay (300)
end for
% Ending the Music
% Stops the background music.
finished3 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
else
fork BTM
exit
end if
delay (500)
% Ending the Music
% Stops the background music.
finished4 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Divide End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Exit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
elsif x > 310 and x < 445 and y > 165 and y < 265 then
fork CM
cls
delay (500)
drawfillbox (0, 0, 750, 750, white)
delay (3000)
for yy : 0 .. maxy by 100
Font.Draw ("Magic Math", 200, yy, f9, 43)
delay (2000)
cls
end for
for yyy : 0 .. maxy by 100
Font.Draw ("Done By: Jawad Khan", 280, yyy, f10, 43)
delay (2000)
cls
end for
for yyyy : 0 .. maxy by 100
Font.Draw ("Infor-Games, In Cooperation With", 200, yyyy, f11, 43)
delay (2000)
cls
end for
for yyyyy : 0 .. maxy by 100
Pic.ScreenLoad ("EA2.jpg", 230, yyyyy, picCopy)
delay (1500)
cls
end for
delay (500)
Font.Draw ("Magic Math", 200, 500, f9, 43)
cls
% Ending the Music
% Stops the background music.
finished5 := true % The flag
Music.PlayFileStop % Music.PlayFile will return immediately
exit
end if
end loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Exit End %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5%%%%%%%%%%%%%%%%%%%%%
|