from erdslangetjie.data import filepath, load
from erdslangetjie.level import Level
+from erdslangetjie.player import ThePlayer, Nemesis
class GameWindow(FloatLayout):
self.level_obj.load(level_data)
level_data.close()
+ self.player = ThePlayer()
+ self.level_obj.load_tiles()
+ if not self.level_obj.enter_pos:
+ raise RuntimeError('No entry point')
+
+ self.player.pos = self.level_obj.enter_pos
+
def build(self):
self.clear_widgets()
tiles = self.level_obj.get_tiles()
bx += tile_size
by += tile_size
+ player_pos = (self.player.pos[0] * tile_size,
+ self.player.pos[1] * tile_size)
+ player_tile = Widget(size=(tile_size, tile_size),
+ pos=player_pos)
+ with player_tile.canvas:
+ Color(1, 1, 1)
+ Rectangle(pos=player_pos, size=player_tile.size,
+ texture=self.player.sprite.texture)
+ self.add_widget(player_tile)
+
class GameApp(App):