A pong clone, but with a twist!
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

72 Zeilen
2.3 KiB

  1. local player1anim = false
  2. local player2anim = false
  3. local player1animend = false
  4. local player2animaend = false
  5. local effectRange = {[0] = 0,[1] = 0}
  6. local diseffectRange = {[0] = 0,[1] = 0}
  7. function superanimator(type, param)
  8. if type == 'tensehit' then
  9. if param == 1 then
  10. print("Animation called!")
  11. player1anim = true
  12. end
  13. if param == 2 then
  14. print("Animation called!")
  15. player2anim = true
  16. end
  17. end
  18. end
  19. function staticanimatorcounter(dt)
  20. if (player1anim) then
  21. print("Effect range: " .. effectRange[0])
  22. effectRange[0] = effectRange[0] + dt*24
  23. if effectRange[0] > 7500/ballSpeed then
  24. player1animend = true
  25. end
  26. end
  27. if player1animend then
  28. print("DISEffect range: " .. diseffectRange[0])
  29. diseffectRange[0] = diseffectRange[0] + dt*24
  30. if diseffectRange[0] > 50 then
  31. effectRange[0] = 0
  32. diseffectRange[0] = 0
  33. player1anim = false
  34. player1animend = false
  35. end
  36. end
  37. if (player2anim) then
  38. print("Effect range: " .. effectRange[1])
  39. effectRange[1] = effectRange[1] + dt*24
  40. if effectRange[1] > 7500/ballSpeed then
  41. player2animend = true
  42. end
  43. end
  44. if player2animend then
  45. print("DISEffect range: " .. diseffectRange[1])
  46. diseffectRange[1] = diseffectRange[1] + dt*24
  47. if diseffectRange[1] > 50 then
  48. effectRange[1] = 0
  49. diseffectRange[1] = 0
  50. player2anim = false
  51. player2animend = false
  52. end
  53. end
  54. end
  55. function staticanimator()
  56. if player1anim then
  57. love.graphics.setColor(140/255,70/255,70/255,1)
  58. love.graphics.circle("fill", player1.x, player1.y , effectRange[0]*100, 100)
  59. end
  60. if player1animend then
  61. love.graphics.setColor(40/255,40/255,40/255,1)
  62. love.graphics.circle("fill", player1.x, player1.y , diseffectRange[0]*100, 100)
  63. end
  64. if player2anim then
  65. love.graphics.setColor(70/255,70/255,140/255,1)
  66. love.graphics.circle("fill", player2.x, player2.y , effectRange[1]*100, 100)
  67. end
  68. if player2animend then
  69. love.graphics.setColor(40/255,40/255,40/255,1)
  70. love.graphics.circle("fill", player2.x, player2.y , diseffectRange[1]*100, 100)
  71. end
  72. end