worldmap_object.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Flexlay - A Generic 2D Game Editor
  2. # Copyright (C) 2015 Karkus476 <karkus476@yahoo.com>
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. from flexlay.property import (
  17. BoolProperty,
  18. StringProperty,
  19. )
  20. from supertux.property import (
  21. SpriteProperty,
  22. InlineTilePosProperty,
  23. )
  24. from supertux.gameobj import GameObj, make_sprite_object
  25. class WorldmapLevel(GameObj):
  26. label = "WorldmapLevel"
  27. identifier = "level"
  28. sprite = "images/worldmap/common/leveldot_green.png"
  29. def __init__(self) -> None:
  30. super().__init__()
  31. self.objmap_object = make_sprite_object(self, self.sprite)
  32. self.signal_connect()
  33. self.properties = [
  34. StringProperty("Level File", "name", ""),
  35. StringProperty("Extro Script", "extro-script", "", optional=True),
  36. BoolProperty("auto-play", "auto-play", False, optional=True),
  37. SpriteProperty("Sprite", "sprite"),
  38. InlineTilePosProperty()
  39. ]
  40. class SpecialTile(GameObj):
  41. label = "SpecialTile"
  42. identifier = "special-tile"
  43. sprite = "images/worldmap/common/leveldot.sprite"
  44. def __init__(self) -> None:
  45. super().__init__()
  46. self.objmap_object = make_sprite_object(self, self.sprite)
  47. self.signal_connect()
  48. self.properties = [
  49. StringProperty("Name", "name", "main"),
  50. InlineTilePosProperty()
  51. ]
  52. class WorldmapSpawnpoint(GameObj):
  53. label = "WorldmapSpawnpoint"
  54. identifier = "worldmap-spawnpoint"
  55. sprite = "images/worldmap/common/tux.sprite"
  56. def __init__(self) -> None:
  57. super().__init__()
  58. self.objmap_object = make_sprite_object(self, self.sprite)
  59. self.signal_connect()
  60. self.properties = [
  61. StringProperty("Name", "name", "main"),
  62. InlineTilePosProperty()
  63. ]
  64. # EOF #