Skip to content

Commit 8f32b6f

Browse files
run cargo fmt
1 parent 89e373e commit 8f32b6f

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

src/components/cloud.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl Cloud {
2020
pos_x,
2121
pos_y,
2222
scale,
23-
speed
23+
speed,
2424
}
2525
}
2626

@@ -46,7 +46,7 @@ impl Cloud {
4646
let delta_time = ggez::timer::delta(ctx).as_secs_f32();
4747

4848
self.pos_x += delta_time * self.speed;
49-
49+
5050
if self.pos_x > WIDTH + 100. {
5151
self.pos_x = -100.;
5252
}

src/components/player.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ use ggez_goodies::{
44
nalgebra_glm::Vec2,
55
};
66

7-
use crate::{HEIGHT, utils::lerp};
7+
use crate::{utils::lerp, HEIGHT};
88

99
use super::bullet::Turbofish;
1010

1111
pub enum Direction {
1212
Left,
1313
Right,
14-
None
14+
None,
1515
}
1616

1717
pub struct Player {
@@ -23,7 +23,7 @@ pub struct Player {
2323
velocity: f32,
2424
going_boom: bool,
2525
lerp_to: Option<f32>,
26-
direction: Direction
26+
direction: Direction,
2727
}
2828

2929
impl Player {
@@ -36,7 +36,7 @@ impl Player {
3636
velocity: 0.,
3737
going_boom: false,
3838
lerp_to: None,
39-
direction: Direction::None
39+
direction: Direction::None,
4040
}
4141
}
4242

@@ -90,13 +90,11 @@ impl Player {
9090
if let Some(l) = self.lerp_to {
9191
if self.pos_x as i32 == l as i32 {
9292
self.lerp_to = None;
93-
}
94-
95-
else {
93+
} else {
9694
self.pos_x = lerp(self.pos_x, l, 0.4);
9795
}
9896
}
99-
97+
10098
if self.going_boom {
10199
self.pos_y -= self.velocity;
102100

src/game.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@ use ggez_goodies::{
1616
use graphics::{Font, Image, TextFragment};
1717
use rand::Rng;
1818

19-
use crate::{HEIGHT, Screen, WIDTH, components::{barrel::Barrel, bullet::Turbofish, cloud::Cloud, enemy::Enemy, player::{Direction, Player}, tile::{Tile, TileType}}};
19+
use crate::{
20+
components::{
21+
barrel::Barrel,
22+
bullet::Turbofish,
23+
cloud::Cloud,
24+
enemy::Enemy,
25+
player::{Direction, Player},
26+
tile::{Tile, TileType},
27+
},
28+
Screen, HEIGHT, WIDTH,
29+
};
2030

2131
pub struct Game {
2232
ground: Vec<Tile>,
@@ -123,7 +133,7 @@ impl Game {
123133
rng.gen_range(0., WIDTH),
124134
rng.gen_range(10., 40.),
125135
rng.gen_range(0.1, 0.3),
126-
rng.gen_range(10., 35.)
136+
rng.gen_range(10., 35.),
127137
));
128138
}
129139

@@ -461,6 +471,7 @@ impl Game {
461471
}
462472
}
463473
KeyCode::Up => {
474+
// TODO: Add chromatic aberration on slow motion.
464475
self.tics = Some(6);
465476
}
466477
_ => (),

0 commit comments

Comments
 (0)