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.

69 lines
1.5 KiB

  1. gameState = "menu"
  2. animationSecsLeft = 3
  3. require 'src/dependencies'
  4. math.randomseed(os.time())
  5. --VARIABLES
  6. RESOLUTION_SET = 0
  7. isFullscreen = 0
  8. DIFFERENCE_X = 1
  9. DIFFERENCE_Y = 1
  10. WINDOW_WIDTH = 1280
  11. WINDOW_HEIGHT = 720
  12. OFFSET_X = 0
  13. OFFSET_Y = 0
  14. currentLevel = 0
  15. saveData = {
  16. levelsBeaten = 0
  17. }
  18. planets = {}
  19. buttons = {}
  20. menu = mainMenu()
  21. function love.load()
  22. testwalls = love.filesystem.load("save")
  23. if testwalls ~= nil then
  24. saveData = love.filesystem.load("save")()
  25. --print("Save file found")
  26. else
  27. --print("No save file found!")
  28. end
  29. tick.framerate = 60
  30. camera = Camera()
  31. BG = love.graphics.newImage("entities/background.jpg")
  32. logo = love.graphics.newImage("logo.png")
  33. simpleScale.setWindow(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_WIDTH, WINDOW_HEIGHT)
  34. firstShip = ship(-500, -500, "entities/ship/smol_white_01.png")
  35. VCAM = VCAM(WINDOW_WIDTH/2, WINDOW_HEIGHT/2)
  36. smallfont = love.graphics.newFont("font.ttf", 25)
  37. titlefont = love.graphics.newFont("font.ttf", 50)
  38. --table.insert(planets, planet(100, WINDOW_HEIGHT/2-100, 1010000000, 1))
  39. buttonClutter()
  40. --planet2 = planet(1000, 300, 1000000000, 20)
  41. end
  42. function love.update(dt)
  43. stateUpdate(dt)
  44. end
  45. function love.draw()
  46. simpleScale.set()
  47. love.graphics.clear(30 / 255,30 / 255,30 / 255,1)
  48. stateDraw()
  49. simpleScale.unSet()
  50. end
  51. function love.mousereleased(x, y, button)
  52. love.keyboard.mouseisReleased = true
  53. end
  54. function objReset()
  55. firstShip:reset()
  56. planets = {}
  57. end