Skip to content

Commit

Permalink
Replaced font and cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
cmgo412 committed Dec 7, 2022
1 parent 4e6804a commit 0f72abd
Show file tree
Hide file tree
Showing 14 changed files with 123 additions and 174 deletions.
Binary file added assets/buttons/PressStart2P.ttf
Binary file not shown.
Binary file removed assets/buttons/joystix monospace.ttf
Binary file not shown.
40 changes: 20 additions & 20 deletions src/battle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,17 @@ pub(crate) fn setup_battle_stats(
TextBundle::from_sections([
// health header for player's monster
TextSection::new(
"Health:",
"HEALTH:",
TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 40.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 28.0,
color: Color::BLACK,
},
),
// health of player's monster
TextSection::from_style(TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 40.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 28.0,
color: Color::BLACK,
}),
])
Expand All @@ -202,19 +202,19 @@ pub(crate) fn setup_battle_stats(
TextBundle::from_sections([
// level header for player's monster
TextSection::new(
"Level:",
"LEVEL:",
TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 40.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 28.0,
color: Color::BLACK,
},
),
// level of player's monster
TextSection::new(
my_lvl.to_string(),
TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 40.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 28.0,
color: Color::BLACK,
},
),
Expand All @@ -239,17 +239,17 @@ pub(crate) fn setup_battle_stats(
TextBundle::from_sections([
// health header for enemy's monster
TextSection::new(
"Health:",
"HEALTH:",
TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 40.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 28.0,
color: Color::BLACK,
},
),
// health of enemy's monster
TextSection::from_style(TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 40.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 28.0,
color: Color::BLACK,
}),
])
Expand All @@ -274,19 +274,19 @@ pub(crate) fn setup_battle_stats(
TextBundle::from_sections([
// level header for player's monster
TextSection::new(
"Level:",
"LEVEL:",
TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 40.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 28.0,
color: Color::BLACK,
},
),
// level of player's monster
TextSection::new(
enemy_lvl.to_string(),
TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 40.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 28.0,
color: Color::BLACK,
},
),
Expand Down
20 changes: 0 additions & 20 deletions src/game_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,6 @@ pub(crate) struct ReadyToSpawnFriend {}

pub(crate) struct EnemyMonsterSpawned {}

// #[derive(Debug)]
// pub(crate) struct Package {
// pub(crate) message: String,
// }

// impl Package {
// pub(crate) fn new(message: String) -> Self {
// Package { message }
// }
// }

// impl fmt::Display for Package {
// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// write!(f, "{}", self.message)
// }
// }

/// Choose a random port of the known, normally open UDP ports
pub(crate) fn get_randomized_port() -> i32 {
let port_list = vec![
Expand All @@ -57,9 +40,6 @@ pub(crate) fn get_randomized_port() -> i32 {

/// Get the local address to bind a socket to
pub(crate) fn get_addr() -> Vec<SocketAddr> {
// let ip_addr = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1));
// let socket_addr = SocketAddr::new(ip_addr, 0 as u16);
// socket_addr
let my_ip_address = local_ip().unwrap();
vec![
SocketAddr::from((my_ip_address, 9800)),
Expand Down
32 changes: 16 additions & 16 deletions src/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ pub(crate) fn setup_help(
.spawn_bundle(TextBundle::from_section(
"HELP",
TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 40.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 28.0,
color: Color::BLACK,
},
))
Expand All @@ -84,8 +84,8 @@ pub(crate) fn setup_help(
.spawn_bundle(TextBundle::from_section(
"MAIN CONTROLS",
TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 35.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 30.0,
color: Color::BLACK,
},
))
Expand All @@ -102,10 +102,10 @@ pub(crate) fn setup_help(

commands
.spawn_bundle(TextBundle::from_section(
"W: move up, S: move down, A: move left, D: move right\nP: party size, G: game progress, I: inventory\nEsc: pause, Q: quit",
"W: move up, S: move down, A: move left, \nD: move right, P: party size, G: game progress, \nI: inventory, Esc: pause, Q: quit",
TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 30.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 25.0,
color: Color::BLACK,
},
))
Expand All @@ -124,8 +124,8 @@ pub(crate) fn setup_help(
.spawn_bundle(TextBundle::from_section(
"BATTLE CONTROLS",
TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 35.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 30.0,
color: Color::BLACK,
},
))
Expand All @@ -144,8 +144,8 @@ pub(crate) fn setup_help(
.spawn_bundle(TextBundle::from_section(
"A: attack, E: elemental, D: defend, S: special\n1: heal item, 2: buff item",
TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 30.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 25.0,
color: Color::BLACK,
},
))
Expand All @@ -164,8 +164,8 @@ pub(crate) fn setup_help(
.spawn_bundle(TextBundle::from_section(
"TRADE CONTROLS",
TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 35.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 30.0,
color: Color::BLACK,
},
))
Expand All @@ -182,10 +182,10 @@ pub(crate) fn setup_help(

commands
.spawn_bundle(TextBundle::from_section(
"3: trade heal item, 4: trade buff item, M: trade monster",
"3: trade heal item, 4: trade buff item, \nM: trade monster",
TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 30.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 25.0,
color: Color::BLACK,
},
))
Expand Down
12 changes: 4 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,6 @@ pub fn display_text(
mut text_buffer: ResMut<TextBuffer>,
) {
// take the text buffer and display it on the screen
// let text = text_buffer.bottom_middle.pop_front();
// if text.is_none() {
// return;
// }
let display_latest = 725.0;
for i in 0..text_buffer.bottom_text.len() {
let mut text = text_buffer.bottom_text.get_mut(i);
Expand All @@ -291,14 +287,14 @@ pub fn display_text(
TextSection::new(
text.as_ref().unwrap().text.clone(),
TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 30.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 28.0,
color: Color::BLACK,
},
),
TextSection::from_style(TextStyle {
font: asset_server.load("buttons/joystix monospace.ttf"),
font_size: 30.0,
font: asset_server.load("buttons/PressStart2P.ttf"),
font_size: 28.0,
color: Color::BLACK,
}),
])
Expand Down
2 changes: 0 additions & 2 deletions src/monster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ pub(crate) struct Boss;
// bundle stores all relevant compnents of monsters
#[derive(Bundle, Component, Copy, Clone, Serialize, Deserialize)]
pub(crate) struct MonsterStats {
// we need a &str that is texture of our monster
// might need name as well
pub(crate) typing: Element,
pub(crate) lvl: Level,
pub(crate) hp: Health,
Expand Down
Loading

0 comments on commit 0f72abd

Please sign in to comment.