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.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. level5 = Class{}
  2. local levelLoaded = false
  3. local M = {}
  4. function level5.load()
  5. shipsleft = 1
  6. local planetImage = love.graphics.newImage("entities/planet/planet" .. math.random(1, 18) .. ".png")
  7. planetsleft = 5
  8. gameStatus = "setup"
  9. playbutts = {}
  10. guibutts = {}
  11. thrusterMax = 100
  12. firstShip.fuel = 100
  13. VCAM.x, VCAM.y = 0, WINDOW_HEIGHT/2
  14. explosions = {}
  15. shipIsHit = false
  16. guimenu = mainMenu()
  17. reachedGoal = false
  18. lvlbase = base(50, 2000)
  19. levelLoaded = true
  20. table.insert(playbutts, menu:addButton("Return to setup", function()
  21. gameStatus = "setup"
  22. levelgeneral.reset()
  23. end ))
  24. table.insert(guibutts, menu:addButton("Release brake!", function ()
  25. if shipsleft == 0 then
  26. selectedItem = "none"
  27. gameStatus = "play"
  28. end
  29. end
  30. ))
  31. table.insert(guibutts, menu:addButton("To menu", function ()
  32. levelgeneral.goBack()
  33. end))
  34. table.insert(planets, planet(0, 2000, 50, 0.3, planetImage, "nodelete"))
  35. table.insert(planets, planet(100, 2000, 50, 0.3, planetImage, "nodelete"))
  36. table.insert(planets, planet(50, 1700, 50, 0.3, planetImage, "nodelete"))
  37. end
  38. function level5.reset()
  39. firstShip:reset()
  40. for k in pairs(planets) do
  41. if planets[k].deletable then
  42. planets[k] = nil
  43. end
  44. end
  45. local planetImage = love.graphics.newImage("entities/planet/planet" .. math.random(1, 18) .. ".png")
  46. shipsleft = 1
  47. firstShip.fuel = 100
  48. shipIsHit = false
  49. planetsleft = 5
  50. end
  51. function level5.GUIControl()
  52. if (love.keyboard.isDown('w') and VCAM.y > -WINDOW_WIDTH) then
  53. VCAM.y = VCAM.y - 10
  54. end
  55. if (love.keyboard.isDown('s') and VCAM.y < WINDOW_WIDTH*2) then
  56. VCAM.y = VCAM.y + 10
  57. end
  58. end
  59. function level5.hint()
  60. GUIDraw("up")
  61. love.graphics.setFont(tinyfont)
  62. if (VCAM.y > -WINDOW_WIDTH) then
  63. love.graphics.print("↑[W]",50,10)
  64. end
  65. if (VCAM.y < WINDOW_WIDTH*2) then
  66. love.graphics.print("↓[D]",50,100)
  67. end
  68. end
  69. function level5.goBack()
  70. levelgeneral.goBack()
  71. end
  72. return level5