Advertisement
KananGamer

Old Version Flappy Mouse 2017

Oct 21st, 2017
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.96 KB | None | 0 0
  1. timer = os.time();
  2. dataPlayer={}
  3. cano={}
  4. canos=0
  5. canex=0
  6. move=false
  7. nuvem={
  8. y=math.random(30,250),
  9. x=900,
  10. w=math.random(50,100),
  11. h=math.random(0,30),
  12. }
  13. function eventLoop() -- Sistema que Gera/Remove os canos
  14. if move then
  15. nuvem.x=nuvem.x-5
  16. 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})
  17. if nuvem.x <= (0-(nuvem.h+20)) then
  18. nuvem.y=math.random(30,250)
  19. nuvem.x=900
  20. w=math.random(50,100)
  21. h=math.random(10,30)
  22. end
  23. if timer < os.time()-3000 then
  24. canos=canos+1
  25. local canose={
  26. id=canos,
  27. x=850,
  28. alt=math.random(80,220),
  29. }
  30. table.insert(cano,canose)
  31. timer = os.time();
  32. end
  33. local insert=nil
  34. for i,v in pairs(cano) do
  35. v.x=v.x-35
  36. tfm.exec.addPhysicObject(i,v.x,v.alt/2,{type=12,width=50,height=v.alt,friction=81,restitution=99,color="0x17720F"})
  37. tfm.exec.addPhysicObject(i+10,v.x,v.alt-15,{type=12,width=72,height=40,friction=81,restitution=99,color="0x17720F"})
  38. 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"})
  39. tfm.exec.addPhysicObject(i+30,v.x,v.alt+145,{type=12,width=72,height=40,friction=81,restitution=99,color="0x17720F"})
  40. if v.x <= -50 then
  41. insert=i+canex
  42. end
  43. for j,p in pairs(tfm.get.room.playerList) do
  44. if not p.isDead then
  45. if v.x == 115 then
  46. local px=tfm.get.room.playerList[j].x
  47. local py=tfm.get.room.playerList[j].y
  48. if py < v.alt+15 or py > v.alt+145 then
  49. tfm.exec.killPlayer(j)
  50. else
  51. tfm.exec.setPlayerScore(j,1,true)
  52. ui.addTextArea(1,"<font size='40' color='#FFFFFF'>"..tfm.get.room.playerList[j].score+1,j,400,30,0,0,1,1,0,true)
  53. end
  54. end
  55. end
  56. end
  57. end
  58. if insert~=nil then
  59. tfm.exec.removeObject(insert)
  60. tfm.exec.removeObject(insert+10)
  61. tfm.exec.removeObject(insert+20)
  62. tfm.exec.removeObject(insert+30)
  63. table.remove(cano, 1)
  64. canex=canex+1
  65. end
  66. end
  67. end
  68. function eventNewGame()
  69. cano={}
  70. canos=0
  71. canex=0
  72. for all in pairs(tfm.get.room.playerList) do
  73. tfm.exec.setPlayerScore(all,0,false)
  74. end
  75. ui.addTextArea(1,"<font size='40' color='#FFFFFF'>0",nil,400,30,0,0,1,1,0,true)
  76. move=true
  77. end
  78. function eventTextAreaCallback(id,name,link)
  79. if link == "close" then
  80. ui.removeTextArea(2,name)
  81. end
  82. end
  83. function eventNewPlayer(name)
  84. dataPlayer[name]={
  85. maxPoints=0,
  86. },
  87. tfm.exec.bindKeyboard(name,32,true,true)
  88. end
  89. 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
  90. tfm.exec.disableAutoNewGame(true)
  91. tfm.exec.disableAutoShaman(true)
  92. tfm.exec.disableAutoTimeLeft(true)
  93. tfm.exec.disableAfkDeath(true)
  94. tfm.exec.disableAutoScore(true)
  95. tfm.exec.disablePhysicalConsumables(true)
  96. tfm.exec.disableMortCommand(true)
  97. 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