Setup for basic Editor for map, started gameplay screen
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
from game.screens.base_screen import BaseScreen
|
||||
import pygame as pg
|
||||
import pygame_gui as pgi
|
||||
|
||||
class GamePlay(BaseScreen):
|
||||
def __init__(self, game):
|
||||
super().__init__(game)
|
||||
|
||||
self.tile_multiplicator = 2.0
|
||||
self.width, self.height = pg.display.get_surface().get_size()
|
||||
self.map_screen = pg.surface.Surface((int(self.width/4*3),int(self.height/6*5)))
|
||||
|
||||
self.scroll = [0, 0]
|
||||
|
||||
self.map = 'test'
|
||||
self.path = 'assets/maps/' + str(self.map) + '.json'
|
||||
|
||||
try:
|
||||
self.game.tilemap.load(self.path)
|
||||
except FileNotFoundError:
|
||||
print('File not Found')
|
||||
|
||||
def process_event(self, event):
|
||||
pass
|
||||
|
||||
def update(self, dt):
|
||||
pass
|
||||
|
||||
def draw(self, surface):
|
||||
self.map_screen.fill((40, 40, 40))
|
||||
|
||||
render_scroll = (int(self.scroll[0]), int(self.scroll[1]))
|
||||
self.game.tilemap.render(self.map_screen, offset=render_scroll)
|
||||
|
||||
self.game.window.blit(self.map_screen, (0, self.height/6))
|
||||
Reference in New Issue
Block a user