draft tutorial revisions
This commit is contained in:
parent
838da4571d
commit
48359b5a48
70 changed files with 6216 additions and 28 deletions
|
|
@ -29,13 +29,11 @@ texture = mcrfpy.Texture("assets/kenney_tinydungeon.png", 16, 16)
|
|||
grid = mcrfpy.Grid(
|
||||
pos=(100, 80), # Position on screen (pixels)
|
||||
size=(640, 480), # Display size (pixels)
|
||||
zoom = 2.0,
|
||||
grid_size=(GRID_WIDTH, GRID_HEIGHT), # Size in tiles
|
||||
texture=texture
|
||||
)
|
||||
|
||||
# Set the zoom level for better visibility
|
||||
grid.zoom = 2.0
|
||||
|
||||
# Fill the grid with floor tiles
|
||||
for y in range(GRID_HEIGHT):
|
||||
for x in range(GRID_WIDTH):
|
||||
|
|
@ -118,4 +116,4 @@ scene.on_key = handle_keys
|
|||
# Activate the scene
|
||||
scene.activate()
|
||||
|
||||
print("Part 1 loaded! Use WASD or Arrow keys to move.")
|
||||
print("Part 1 loaded! Use WASD or Arrow keys to move.")
|
||||
|
|
|
|||
|
|
@ -102,9 +102,9 @@ grid = mcrfpy.Grid(
|
|||
pos=(80, 100),
|
||||
size=(720, 480),
|
||||
grid_size=(GRID_WIDTH, GRID_HEIGHT),
|
||||
texture=texture
|
||||
texture=texture,
|
||||
zoom=1.5
|
||||
)
|
||||
grid.zoom = 1.5
|
||||
|
||||
# Build the map
|
||||
create_map(grid)
|
||||
|
|
|
|||
|
|
@ -250,9 +250,9 @@ grid = mcrfpy.Grid(
|
|||
pos=(50, 80),
|
||||
size=(800, 560),
|
||||
grid_size=(GRID_WIDTH, GRID_HEIGHT),
|
||||
texture=texture
|
||||
texture=texture,
|
||||
zoom=1.0
|
||||
)
|
||||
grid.zoom = 1.0
|
||||
|
||||
# Generate the dungeon and get player start position
|
||||
player_start_x, player_start_y = generate_dungeon(grid)
|
||||
|
|
|
|||
|
|
@ -236,9 +236,9 @@ grid = mcrfpy.Grid(
|
|||
pos=(50, 80),
|
||||
size=(800, 560),
|
||||
grid_size=(GRID_WIDTH, GRID_HEIGHT),
|
||||
texture=texture
|
||||
texture=texture,
|
||||
zoom=1.0
|
||||
)
|
||||
grid.zoom = 1.0
|
||||
|
||||
# Generate the dungeon
|
||||
player_start_x, player_start_y = generate_dungeon(grid)
|
||||
|
|
|
|||
|
|
@ -448,9 +448,9 @@ grid = mcrfpy.Grid(
|
|||
pos=(50, 80),
|
||||
size=(800, 560),
|
||||
grid_size=(GRID_WIDTH, GRID_HEIGHT),
|
||||
texture=texture
|
||||
texture=texture,
|
||||
zoom=1.0
|
||||
)
|
||||
grid.zoom = 1.0
|
||||
|
||||
# Generate the dungeon (without player first to get starting position)
|
||||
fill_with_walls(grid)
|
||||
|
|
|
|||
|
|
@ -685,9 +685,9 @@ grid = mcrfpy.Grid(
|
|||
pos=(50, 80),
|
||||
size=(800, 480),
|
||||
grid_size=(GRID_WIDTH, GRID_HEIGHT),
|
||||
texture=texture
|
||||
texture=texture,
|
||||
zoom=1.0
|
||||
)
|
||||
grid.zoom = 1.0
|
||||
|
||||
# Generate initial dungeon structure
|
||||
fill_with_walls(grid)
|
||||
|
|
|
|||
|
|
@ -785,9 +785,9 @@ grid = mcrfpy.Grid(
|
|||
pos=(20, GAME_AREA_Y),
|
||||
size=(800, GAME_AREA_HEIGHT - 20),
|
||||
grid_size=(GRID_WIDTH, GRID_HEIGHT),
|
||||
texture=texture
|
||||
texture=texture,
|
||||
zoom=1.0
|
||||
)
|
||||
grid.zoom = 1.0
|
||||
|
||||
# Generate initial dungeon structure
|
||||
fill_with_walls(grid)
|
||||
|
|
|
|||
|
|
@ -1006,9 +1006,9 @@ grid = mcrfpy.Grid(
|
|||
pos=(20, GAME_AREA_Y),
|
||||
size=(700, GAME_AREA_HEIGHT - 20),
|
||||
grid_size=(GRID_WIDTH, GRID_HEIGHT),
|
||||
texture=texture
|
||||
texture=texture,
|
||||
zoom=1.0
|
||||
)
|
||||
grid.zoom = 1.0
|
||||
|
||||
# Generate initial dungeon
|
||||
fill_with_walls(grid)
|
||||
|
|
|
|||
|
|
@ -1089,9 +1089,9 @@ grid = mcrfpy.Grid(
|
|||
pos=(20, GAME_AREA_Y),
|
||||
size=(700, GAME_AREA_HEIGHT - 20),
|
||||
grid_size=(GRID_WIDTH, GRID_HEIGHT),
|
||||
texture=texture
|
||||
texture=texture,
|
||||
zoom=1.0
|
||||
)
|
||||
grid.zoom = 1.0
|
||||
|
||||
# Generate initial dungeon
|
||||
fill_with_walls(grid)
|
||||
|
|
|
|||
|
|
@ -1385,9 +1385,9 @@ grid = mcrfpy.Grid(
|
|||
pos=(20, GAME_AREA_Y),
|
||||
size=(700, GAME_AREA_HEIGHT - 20),
|
||||
grid_size=(GRID_WIDTH, GRID_HEIGHT),
|
||||
texture=texture
|
||||
texture=texture,
|
||||
zoom=1.0
|
||||
)
|
||||
grid.zoom = 1.0
|
||||
|
||||
# Add FOV layer
|
||||
fov_layer = grid.add_layer("color", z_index=-1)
|
||||
|
|
|
|||
|
|
@ -1583,9 +1583,9 @@ grid = mcrfpy.Grid(
|
|||
pos=(20, GAME_AREA_Y),
|
||||
size=(700, GAME_AREA_HEIGHT - 20),
|
||||
grid_size=(GRID_WIDTH, GRID_HEIGHT),
|
||||
texture=texture
|
||||
texture=texture,
|
||||
zoom=1.0
|
||||
)
|
||||
grid.zoom = 1.0
|
||||
|
||||
fov_layer = grid.add_layer("color", z_index=-1)
|
||||
for y in range(GRID_HEIGHT):
|
||||
|
|
|
|||
|
|
@ -1694,9 +1694,9 @@ grid = mcrfpy.Grid(
|
|||
pos=(20, GAME_AREA_Y),
|
||||
size=(700, GAME_AREA_HEIGHT - 20),
|
||||
grid_size=(GRID_WIDTH, GRID_HEIGHT),
|
||||
texture=texture
|
||||
texture=texture,
|
||||
zoom=1.0
|
||||
)
|
||||
grid.zoom = 1.0
|
||||
|
||||
fov_layer = grid.add_layer("color", z_index=-1)
|
||||
for y in range(GRID_HEIGHT):
|
||||
|
|
|
|||
|
|
@ -1662,9 +1662,9 @@ grid = mcrfpy.Grid(
|
|||
pos=(20, GAME_AREA_Y),
|
||||
size=(700, GAME_AREA_HEIGHT - 20),
|
||||
grid_size=(GRID_WIDTH, GRID_HEIGHT),
|
||||
texture=texture
|
||||
texture=texture,
|
||||
zoom=1.0
|
||||
)
|
||||
grid.zoom = 1.0
|
||||
|
||||
fov_layer = grid.add_layer("color", z_index=-1)
|
||||
for y in range(GRID_HEIGHT):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue