̬̬̬̈̬̬̬̬̈̬̬̬̬̬̪쬪̬̬̬̪쬪 >/ `f`fff`flf`ff`flf@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD@DDDDDDDDDDDDDD ;-- title: kill by typing -- title: type words to kill "monsters" -- author: me -- script: lua words={ "apple","banana","orange","grape","melon","peach","cherry","lemon","mango","pear", "table","chair","window","door","floor","ceiling","light","shadow","mirror","clock", "water","fire","earth","air","stone","metal","wood","glass","smoke","steam", "happy","sad","angry","calm","brave","scared","proud","shy","kind","mean", "quick","slow","bright","dark","loud","quiet","soft","hard","warm","cold", "computer","keyboard","screen","mouse","program","code","pixel","sprite","game","engine", "school","student","teacher","lesson","exam","answer","question","learn","study","write", "world","country","city","village","river","mountain","forest","desert","ocean","island", "future","past","present","time","space","energy","power","force","speed","motion", "random","simple","complex","system","logic","memory","input","output","process","data", "creative","imagine","design","build","explore","discover","invent","improve","develop","think", "challenge","problem","solution","effort","focus","practice","progress","result","success","failure" } cx=120 cy=68 w=240 h=136 boss=false typed="" target=string.upper(words[math.random(#words)]) score=0 t=0 boss_ready=true e={} b={} function set_enemy() e={ ehealth=math.random(10,20), ew=math.random(10,25), eh=math.random(10,25), ecol=math.random(2,5), tm=math.random(7,15) } boss=false boss_ready=true end function set_boss() b={ ehealth=math.random(3,5), ew=math.random(30,40), eh=math.random(30,40), ecol=math.random(2,5), tm=math.random(30,45), target=string.upper(words[math.random(#words)]).." "..string.upper(words[math.random(#words)]).." "..string.upper(words[math.random(#words)]) } boss=true typed="" end set_enemy() t123=1 function TIC() if t123<2 then t123=t123+1 return end if score > 0 and score % 5 == 0 and boss_ready then set_boss() boss_ready=false end if boss then boss_fight() return end cls() if e.tm <= 0 then fail() return end read_key() text_and_change() enemy_logic() if t==60 then e.tm=e.tm-1 t=0 end print(e.tm,0,0,12,false,2) t=t+1 end function boss_fight() cls() if b.tm<=0 then fail() return end read_key() print(b.target,cx-3*#b.target,h-cy/1.5,12) print(typed,cx-3*#typed,h-cy/1.75,13) if typed==b.target then typed="" b.target=string.upper(words[math.random(#words)]).." "..string.upper(words[math.random(#words)]).." "..string.upper(words[math.random(#words)]) b.ehealth=b.ehealth-1 end rect(cx-b.ehealth*1.5,40,b.ehealth*3,5,6) print(b.ehealth,cx-(string.len(b.ehealth)*3),40,12) rect(cx-b.ew/2,cy-b.eh/2,b.ew,b.eh,b.ecol) if b.ehealth<=0 then score=score+1 t=0 set_enemy() end if t==60 then b.tm=b.tm-1 t=0 end print(b.tm,0,0,12,false,2) t=t+1 end function fail() cls() print("YOU LOSE",cx/2,cy,12) print("you killed "..score.." enemies",cx/2,cy+10,13) end function enemy_logic() rect(cx-e.ehealth*1.5,40,e.ehealth*3,5,6) print(e.ehealth,cx-(string.len(e.ehealth)*3),40,12) rect(cx-e.ew/2,cy-e.eh/2,e.ew,e.eh,e.ecol) if e.ehealth<=0 then score=score+1 t=0 set_enemy() end end function text_and_change() print(target,cx-3*#target,h-cy/1.5,12) print(typed,cx-3*#typed,h-cy/1.75,13) if typed==target then e.ehealth=e.ehealth-#typed target=string.upper(words[math.random(#words)]) typed="" end end function read_key() for i=0,25 do if keyp(i+1) then typed = typed .. string.char(65+i) end end if keyp(48) then typed=typed.." " end if keyp(51,30,5) then typed = string.sub(typed,1,-2) end end