Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- timer = os.time();
- dataPlayer={}
- cano={}
- canos=0
- canex=0
- move=false
- nuvem={
- y=math.random(30,250),
- x=900,
- w=math.random(50,100),
- h=math.random(0,30),
- }
- function eventLoop() -- Sistema que Gera/Remove os canos
- if move then
- nuvem.x=nuvem.x-5
- tfm.exec.addPhysicObject(-1,nuvem.x,nuvem.y,{type=12,width=nuvem.w,height=nuvem.h,friction=81,restitution=99,color="0xFFFFFF",miceCollision=false,foreground=false})
- if nuvem.x <= (0-(nuvem.h+20)) then
- nuvem.y=math.random(30,250)
- nuvem.x=900
- w=math.random(50,100)
- h=math.random(10,30)
- end
- if timer < os.time()-3000 then
- canos=canos+1
- local canose={
- id=canos,
- x=850,
- alt=math.random(80,220),
- }
- table.insert(cano,canose)
- timer = os.time();
- end
- local insert=nil
- for i,v in pairs(cano) do
- v.x=v.x-35
- tfm.exec.addPhysicObject(i,v.x,v.alt/2,{type=12,width=50,height=v.alt,friction=81,restitution=99,color="0x17720F"})
- tfm.exec.addPhysicObject(i+10,v.x,v.alt-15,{type=12,width=72,height=40,friction=81,restitution=99,color="0x17720F"})
- tfm.exec.addPhysicObject(i+20,v.x,((400-v.alt)/2)+(v.alt+145),{type=12,width=50,height=400-v.alt,friction=81,restitution=99,color="0x17720F"})
- tfm.exec.addPhysicObject(i+30,v.x,v.alt+145,{type=12,width=72,height=40,friction=81,restitution=99,color="0x17720F"})
- if v.x <= -50 then
- insert=i+canex
- end
- for j,p in pairs(tfm.get.room.playerList) do
- if not p.isDead then
- if v.x == 115 then
- local px=tfm.get.room.playerList[j].x
- local py=tfm.get.room.playerList[j].y
- if py < v.alt+15 or py > v.alt+145 then
- tfm.exec.killPlayer(j)
- else
- tfm.exec.setPlayerScore(j,1,true)
- ui.addTextArea(1,"<font size='40' color='#FFFFFF'>"..tfm.get.room.playerList[j].score+1,j,400,30,0,0,1,1,0,true)
- end
- end
- end
- end
- end
- if insert~=nil then
- tfm.exec.removeObject(insert)
- tfm.exec.removeObject(insert+10)
- tfm.exec.removeObject(insert+20)
- tfm.exec.removeObject(insert+30)
- table.remove(cano, 1)
- canex=canex+1
- end
- end
- end
- function eventNewGame()
- cano={}
- canos=0
- canex=0
- for all in pairs(tfm.get.room.playerList) do
- tfm.exec.setPlayerScore(all,0,false)
- end
- ui.addTextArea(1,"<font size='40' color='#FFFFFF'>0",nil,400,30,0,0,1,1,0,true)
- move=true
- end
- function eventTextAreaCallback(id,name,link)
- if link == "close" then
- ui.removeTextArea(2,name)
- end
- end
- function eventNewPlayer(name)
- dataPlayer[name]={
- maxPoints=0,
- },
- tfm.exec.bindKeyboard(name,32,true,true)
- end
- for a,b in pairs(tfm.get.room.playerList)do eventNewPlayer(a)end;function eventKeyboard(a,c,d,e,f)if c==32 then tfm.exec.movePlayer(a,0,0,true,0,-60,false)end end
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoScore(true)
- tfm.exec.disablePhysicalConsumables(true)
- tfm.exec.disableMortCommand(true)
- tfm.exec.newGame('<C><P aie="" Ca="" /><Z><S><S P="0,0,0.3,0.2,0,0,0,0" L="800" o="1c9cdd" X="400" c="4" Y="200" T="12" H="400" /><S P="0,0,0,0,0,0,0,0" L="17" o="1c9cdd" H="400" Y="200" T="12" X="112" /><S L="17" o="1c9cdd" H="400" X="156" Y="200" T="12" P="0,0,0,0,0,0,0,0" /><S L="75" X="134" H="10" Y="-6" T="3" P="0,0,0,99,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="150" o="0B3707" X="79" c="4" Y="456" T="13" H="10" /><S H="10" L="150" o="0B3707" X="214" c="4" Y="463" T="13" P="0,0,0.3,0.2,0,0,0,0" /><S H="10" L="150" o="0B3707" X="358" c="4" Y="461" T="13" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="150" o="0B3707" X="506" c="4" Y="460" T="13" H="10" /><S H="10" L="150" o="0B3707" X="668" c="4" Y="460" T="13" P="0,0,0.3,0.2,0,0,0,0" /><S P="0,0,0.3,0.2,0,0,0,0" L="150" o="0B3707" X="825" c="4" Y="457" T="13" H="10" /><S P="0,0,0.3,0.2,0,0,0,0" L="668" o="0B3707" X="444" c="4" Y="333" T="12" H="17" /><S H="10" L="150" o="0B3707" X="-49" c="4" Y="443" T="13" P="0,0,0.3,0.2,0,0,0,0" /></S><D><DS Y="133" X="134" /></D><O /></Z></C>')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement