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.

22 lines
510 B

  1. base = Class{}
  2. G = 6.67e-5
  3. function base:init(x, y)
  4. self.x = x
  5. self.y = y
  6. self.image = love.graphics.newImage("entities/base/base.png")
  7. self.w = self.image:getWidth()
  8. self.h = self.image:getHeight()
  9. end
  10. function base:update(dt)
  11. local distanceToShip = math.sqrt((firstShip.x - self.x)^2 + (firstShip.y - self.y)^2)
  12. if distanceToShip < self.w/2 then
  13. reachedGoal = true
  14. end
  15. end
  16. function base:draw()
  17. love.graphics.draw(self.image, self.x, self.y, 0, 1, 1, self.w/2, self.w/2)
  18. end