A pong clone, but with a twist!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
648 B

  1. explosion = Class{}
  2. function explosion:init(x, y, v, color)
  3. self.color = color
  4. self.x = x
  5. self.y = y
  6. self.v = v
  7. self.range = 0
  8. self.killed = false
  9. print(self.i)
  10. end
  11. function explosion:update(dt)
  12. self.range = self.range + dt * 24
  13. if self.range * self.v > VIRTUAL_WIDTH * 2 then
  14. print("killing myself with range" .. self.range)
  15. self.killed = true
  16. end
  17. end
  18. function explosion:render()
  19. print("rendering myself" .. self.x .. " " .. self.y .. " " .. self.range .. " " .. self.v)
  20. love.graphics.setColor(color)
  21. love.graphics.circle("fill", self.x, self.y, self.range * self.v, 100)
  22. end