summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/camera.rs10
-rw-r--r--src/constants.rs6
-rw-r--r--src/world.rs2
3 files changed, 8 insertions, 10 deletions
diff --git a/src/camera.rs b/src/camera.rs
index 07745e5..bcb8f69 100644
--- a/src/camera.rs
+++ b/src/camera.rs
@@ -1,5 +1,5 @@
+use ggez::conf::Conf;
use ggez::nalgebra::Point2;
-use ggez::Context;
use crate::constants;
@@ -10,13 +10,11 @@ pub struct Camera {
}
impl Camera {
- pub fn new(context: &mut Context, map_dimensions: (f32, f32)) -> Camera {
+ pub fn new(map_dimensions: (f32, f32)) -> Camera {
+ let conf = Conf::new();
Camera {
draw: Point2::new(0.0, 0.0),
- window_dimensions: (
- context.conf.window_mode.width,
- context.conf.window_mode.height,
- ),
+ window_dimensions: (conf.window_mode.width, conf.window_mode.height),
map_dimensions,
}
}
diff --git a/src/constants.rs b/src/constants.rs
index 0da4772..1f6bb9f 100644
--- a/src/constants.rs
+++ b/src/constants.rs
@@ -1,9 +1,9 @@
pub const TILE_WIDTH: f32 = 16.0;
pub const TILE_HEIGHT: f32 = 16.0;
-pub const TILE_SCALE: f32 = 3.0;
+pub const TILE_SCALE: f32 = 2.5;
-pub const PLAYER_SPEED: f32 = 2.5;
-pub const WANDER_DISTANCE: f32 = 150.0;
+pub const PLAYER_SPEED: f32 = 3.0;
+pub const WANDER_DISTANCE: f32 = 200.0;
pub const GOAL_DISTANCE: f32 = 10.0;
pub const WAIT_TIME: u64 = 3;
diff --git a/src/world.rs b/src/world.rs
index 0de8726..f89e9e7 100644
--- a/src/world.rs
+++ b/src/world.rs
@@ -30,7 +30,7 @@ impl World {
Ok(World {
map: map.clone(),
spritebatch: SpriteBatch::new(image),
- camera: Camera::new(context, map.get_dimensions()),
+ camera: Camera::new(map.get_dimensions()),
player: Player::new(
&tileset,
map.get_spawn_points("player")[0],