labyrinth
This commit is contained in:
parent
da36acbade
commit
cb97acba42
@ -11,8 +11,8 @@ mod prelude {
|
|||||||
pub use legion::systems::CommandBuffer;
|
pub use legion::systems::CommandBuffer;
|
||||||
pub use legion::world::SubWorld;
|
pub use legion::world::SubWorld;
|
||||||
pub use legion::*;
|
pub use legion::*;
|
||||||
pub const SCREEN_WIDTH: i32 = 60;
|
pub const SCREEN_WIDTH: i32 = 80;
|
||||||
pub const SCREEN_HEIGHT: i32 = 40;
|
pub const SCREEN_HEIGHT: i32 = 50;
|
||||||
pub const DISPLAY_WIDTH: i32 = SCREEN_WIDTH / 2;
|
pub const DISPLAY_WIDTH: i32 = SCREEN_WIDTH / 2;
|
||||||
pub const DISPLAY_HEIGHT: i32 = SCREEN_HEIGHT / 2;
|
pub const DISPLAY_HEIGHT: i32 = SCREEN_HEIGHT / 2;
|
||||||
pub use crate::camera::*;
|
pub use crate::camera::*;
|
||||||
|
@ -2,17 +2,17 @@ use crate::prelude::*;
|
|||||||
|
|
||||||
const FORTRESS: (&str, i32, i32) = (
|
const FORTRESS: (&str, i32, i32) = (
|
||||||
"
|
"
|
||||||
------------
|
#-##########
|
||||||
---######---
|
#-#--------#
|
||||||
---#----#---
|
#-#-######-#
|
||||||
---#-M--#---
|
#-#-#MMMM#-#
|
||||||
-###----###-
|
#-#-#MMMM#-#
|
||||||
--M---------
|
#-#-#----#-#
|
||||||
-###----###-
|
#-#-####-#-#
|
||||||
---#----#---
|
#-#------#-#
|
||||||
---#----#---
|
#-########-#
|
||||||
---######---
|
#----------#
|
||||||
------------
|
############
|
||||||
",
|
",
|
||||||
12,
|
12,
|
||||||
11,
|
11,
|
||||||
|
@ -52,7 +52,6 @@ pub fn player_input(
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
let mut enemies = <(Entity, &Point)>::query().filter(component::<Enemy>());
|
let mut enemies = <(Entity, &Point)>::query().filter(component::<Enemy>());
|
||||||
|
|
||||||
let mut did_something = false;
|
|
||||||
if delta.x != 0 || delta.y != 0 {
|
if delta.x != 0 || delta.y != 0 {
|
||||||
let mut hit_something = false;
|
let mut hit_something = false;
|
||||||
enemies
|
enemies
|
||||||
@ -60,7 +59,6 @@ pub fn player_input(
|
|||||||
.filter(|(_, pos)| **pos == destination)
|
.filter(|(_, pos)| **pos == destination)
|
||||||
.for_each(|(entity, _)| {
|
.for_each(|(entity, _)| {
|
||||||
hit_something = true;
|
hit_something = true;
|
||||||
did_something = true;
|
|
||||||
|
|
||||||
commands.push((
|
commands.push((
|
||||||
(),
|
(),
|
||||||
@ -72,7 +70,6 @@ pub fn player_input(
|
|||||||
});
|
});
|
||||||
|
|
||||||
if !hit_something {
|
if !hit_something {
|
||||||
did_something = true;
|
|
||||||
commands.push((
|
commands.push((
|
||||||
(),
|
(),
|
||||||
WantsToMove {
|
WantsToMove {
|
||||||
|
Loading…
Reference in New Issue
Block a user