Skip to content

Commit

Permalink
Slight camera logic change -- not sure I like it...
Browse files Browse the repository at this point in the history
  • Loading branch information
pop committed Jun 29, 2020
1 parent 8555504 commit feac903
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
9 changes: 9 additions & 0 deletions assets/levels/00.level
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
############
# # ###
# SVHD G LE#
# # ###
# # ## ####
# # K #
# C S #
# # #
#########
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion src/entity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,23 @@ pub(crate) fn make_camera(world: &mut World, level_handle: &Handle<GameLevel>) -
level.dimensions
};

let x_cam_dim: f32 = {
let initial: f32 = (16 * size_x).into();
initial * 1.4
};
let y_cam_dim: f32 = {
let initial: f32 = (9 * size_y).into();
initial * 1.4
};

let (x_adjust, y_adjust): (f32, f32) = (
(size_x * GRID_SIZE / 2).into(),
(size_y * GRID_SIZE / 2).into(),
);

world
.create_entity()
.with(Camera::standard_2d(1280.0/8.0, 720.0/8.0))
.with(Camera::standard_2d(x_cam_dim, y_cam_dim))
.with({
// I just want to call Transform::from_xyz(x, y, z)...
let mut transform = Transform::default();
Expand Down

0 comments on commit feac903

Please sign in to comment.