Merge branch 'isometric' of https://git.tavres.ru/laktionov-as/arcade into isometric
This commit is contained in:
@@ -45,7 +45,7 @@ def to_iso(tile_list):
|
|||||||
col = tile.center_x//TILE_WIDTH
|
col = tile.center_x//TILE_WIDTH
|
||||||
row = tile.center_y//TILE_HEIGHT
|
row = tile.center_y//TILE_HEIGHT
|
||||||
tile.center_x = tile.center_x - TILE_WIDTH//2 * (col-row)
|
tile.center_x = tile.center_x - TILE_WIDTH//2 * (col-row)
|
||||||
tile.center_y = tile.center_y - TILE_HEIGHT//2 * (row+col)
|
tile.center_y = tile.center_y - TILE_HEIGHT//2 * (col+row)
|
||||||
return tile_list
|
return tile_list
|
||||||
|
|
||||||
class Player(arcade.Sprite):
|
class Player(arcade.Sprite):
|
||||||
@@ -118,15 +118,15 @@ class MainView(arcade.View):
|
|||||||
#self.enemys.update(delta_time)
|
#self.enemys.update(delta_time)
|
||||||
def on_mouse_press(self,x,y,but,mod):
|
def on_mouse_press(self,x,y,but,mod):
|
||||||
world_point = self.camera.unproject((x,y))
|
world_point = self.camera.unproject((x,y))
|
||||||
tile_col = world_point.x//TILE_WIDTH
|
tile_col = world_point.x/TILE_WIDTH
|
||||||
tile_row = world_point.y//TILE_HEIGHT
|
tile_row = world_point.y/TILE_HEIGHT
|
||||||
sheet = arcade.load_spritesheet('./assets/tiles/64x64.png')
|
sheet = arcade.load_spritesheet('./assets/tiles/64x64.png')
|
||||||
textures = sheet.get_texture_grid((64,64),16,184)
|
textures = sheet.get_texture_grid((64,64),16,184)
|
||||||
self.walls.append(
|
self.walls.append(
|
||||||
arcade.Sprite(
|
arcade.Sprite(
|
||||||
textures[165],
|
textures[165],
|
||||||
center_x=tile_col*TILE_WIDTH + TILE_WIDTH//2,
|
center_x=world_point.x - world_point.x%(TILE_WIDTH//2),
|
||||||
center_y=tile_row*TILE_HEIGHT+TILE_HEIGHT
|
center_y=world_point.y - world_point.y%(TILE_HEIGHT//2)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
def on_key_press(self,key,mod):
|
def on_key_press(self,key,mod):
|
||||||
|
|||||||
Reference in New Issue
Block a user