diff options
| author | tslil clingman <> | 2021-09-09 23:18:56 -0400 |
|---|---|---|
| committer | tslil clingman <> | 2021-09-09 23:29:10 -0400 |
| commit | d2f6860430f93291a52d1cdaccf6831cd57be9a5 (patch) | |
| tree | 27d7698d79e678cad961647ea6295da53b6a8a49 /src/main.zig | |
| parent | cf1eb8fc551f5f3ee3bc0054fc236ff7d201f44a (diff) | |
Added ceilings and pos_z to sprites (they can now be on the ceiling)
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.zig b/src/main.zig index 2def0e8..8f8753d 100644 --- a/src/main.zig +++ b/src/main.zig @@ -85,8 +85,9 @@ pub fn main() !void { map.cells.items[16 * 7 + 7] = level.Cell{ .height = constants.MAX_HEIGHT, .wall_texture = 1 }; map.cells.items[16 * 7 + 6] = level.Cell{ .height = constants.MAX_HEIGHT / 3, .wall_texture = 1, .floor_texture = 1 }; - try map.objects.append(level.Object{ .pos_x = 6.5, .pos_y = 8.5, .texture = 0, .height = 1, .width = 1 }); + try map.objects.append(level.Object{ .pos_x = 5.5, .pos_y = 7.5, .pos_z = 0, .texture = 2, .height = 1, .width = 1 }); try map.objects.append(level.Object{ .pos_x = 4, .pos_y = 8.5, .texture = 1, .height = 1, .width = 1 }); + try map.objects.append(level.Object{ .pos_x = 6.5, .pos_y = 8.5, .texture = 0, .height = 1, .width = 1 }); // Initialise SFML //-------------------------------------------------------------------------- @@ -132,14 +133,14 @@ pub fn main() !void { var floors_image = try sf.Image.createFromFile("floors.png"); defer floors_image.destroy(); - var rendered_floors_texture = try sf.Texture.create(.{ .x = constants.PlaneWidth, .y = constants.PlaneHeight / 2 }); + var rendered_floors_texture = try sf.Texture.create(.{ .x = constants.PlaneWidth, .y = constants.PlaneHeight }); defer rendered_floors_texture.destroy(); rendered_floors_texture.setSmooth(false); var rendered_floors_sprite = try sf.Sprite.createFromTexture(rendered_floors_texture); defer rendered_floors_sprite.destroy(); - rendered_floors_sprite.setPosition(.{ .x = 0, .y = constants.ScreenHeight / 2 }); + rendered_floors_sprite.setPosition(.{ .x = 0, .y = 0 }); rendered_floors_sprite.setScale(.{ .x = constants.HFact, .y = constants.VFact }); // Start your engines! |
