Ryan d31c682f30 Version 1.4.0
Tweaked some methods
Working on better thread management
Removed useless methods
Added a pause and resume method (does not work on the main thread)
Added method randomseed(seed)
Invoking internal methods from c# is now supported... May have bugs haven't done much testing yet!
2017-09-06 17:06:26 -04:00

87 lines
2.0 KiB
Plaintext

VERSION 1.3.2
THREAD testthread.txt
[PLAYGAME]{
print("Welcome to my game!")
PAUSE("ENJOY!")
QUIT()
}
[COUNTER]{
::cloop::
sleep(1000)
secs_played=secs_played+1
if secs_played==60 then GOTO("secs")|SKIP(0)
if mins_played==60 then GOTO("mins")|GOTO("cloop")
::secs::
secs_played=0
mins_played=mins_played+1
GOTO("cloop")
::mins::
mins_played=0
hours_played=hours_played+1
GOTO("cloop")
}
[START]{
secs_played=0
mins_played=0
hours_played=0
newThread("COUNTER")
bgm_song=loadSong("Audio/Collapse.mp3")
snd_select=loadSong("Audio/select.mp3")
playSong(bgm_song)
setFancyForm("left")
LOAD("savedata.dat")
write("Name: ")
name=getInput()
clear()
if name=="" then SKIP(-4)|SKIP(0)
"So your name is $name$, thats cool!"
pos=1
sleep(200)
SAVE("savedata.dat")
::loop::
clear()
SAVE("savedata.dat")
setFG(Color_Blue)
fancy(" What to do $name$? Time plsyed $hours_played$:$mins_played$:$secs_played$,/l, Play Game, View Stats, View Credits, Quit Game")
keyUP=isDown("{UP}")
keyDOWN=isDown("{DOWN}")
keyENTER=isDown("{ENTER}")
if keyUP==true then setVarPlay("pos",pos-1)|SKIP(0)
if keyDOWN==true then setVarPlay("pos",pos+1)|SKIP(0)
if keyENTER==true then GOTO("choicemade")|SKIP(0)
writeAt("->",1,pos+2)
sleep(75)
GOTO("loop")
::choicemade::
playSong(snd_select)
sleep(200)
if pos==1 then JUMP("PLAYGAME")|SKIP(0)
if pos==2 then print("You Pressed Stats")|SKIP(0)
if pos==3 then print("You Pressed Credits")|SKIP(0)
if pos==4 then QUIT()|SKIP(0)
PAUSE("Tests done (Press Enter!)")
QUIT()
}
[PAUSE:function(msg)]{
write(msg)
::loop::
keyENTER=isDown("{ENTER}")
if keyENTER==true then SKIP(0)|GOTO("loop")
print(" ")
}
[testFunc:function(a)]{
"Invoke Test: $a$!"
}
[setVarPlay:function(var,val)]{
setVar(var,val)
if pos<1 then GOTO("toolittle")|SKIP(0)
if pos>4 then GOTO("toomuch")|SKIP(0)
beep()
GOTO("end")
::toolittle::
setVar("pos",1)
GOTO("end")
::toomuch::
setVar("pos",4)
::end::
}