summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2019-07-23 04:59:52 -0500
committertom barrett <spalf0@gmail.com>2019-07-23 04:59:52 -0500
commitc25884efd8d1a239c88dbafd7a0e12eca3c7401b (patch)
tree63ca4a26fa7ff159ae654841b724e7ca4e876da7 /src
parent2ee665ef6954f6eab9f0398c19284b3ea4c8246d (diff)
update deps
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],