supertux-portable.rb 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. ## $Id$
  2. ##
  3. ## Flexlay - A Generic 2D Game Editor
  4. ## Copyright (C) 2004 Ingo Ruhnke <grumbel@gmx.de>
  5. ##
  6. ## This program is free software: you can redistribute it and/or modify
  7. ## it under the terms of the GNU General Public License as published by
  8. ## the Free Software Foundation, either version 3 of the License, or
  9. ## (at your option) any later version.
  10. ##
  11. ## This program is distributed in the hope that it will be useful,
  12. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ## GNU General Public License for more details.
  15. ##
  16. ## You should have received a copy of the GNU General Public License
  17. ## along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. require "flexlay_wrap"
  19. include Flexlay_wrap
  20. require "flexlay.rb"
  21. require "tileset.rb"
  22. require "gui.rb"
  23. require "level.rb"
  24. require "controller.rb"
  25. class SuperTuxPortableEditor
  26. def initialize(args)
  27. @levelfile = nil
  28. init_flexlay()
  29. end
  30. def init_flexlay()
  31. $screen_width = 800
  32. $screen_height = 600
  33. $fullscreen = false
  34. ## Init Flexlay itself
  35. $flexlay = Flexlay.new()
  36. $flexlay.init("SuperTux Portable Editor V0.1", $screen_width, $screen_height, $fullscreen, true)
  37. $controller = Controller.new()
  38. $datadir = "/home/ingo/projects/supertux/trunk/supertux-portable/data/"
  39. $tileset = Tileset.new(8)
  40. $tileset.load($datadir + "antarctica.stpts")
  41. $gui = GUI.new()
  42. if ARGV.length == 0 then
  43. Level.new_from_size(256, 32).activate($gui.workspace)
  44. else
  45. Level.new_from_file(ARGV[0]).activate($gui.workspace)
  46. end
  47. end
  48. def run()
  49. $gui.run()
  50. # $flexlay.deinit()
  51. end
  52. end
  53. # EOF #