Fix warnings

This commit is contained in:
GBA bot 2022-01-01 12:10:14 +00:00
parent 92d63999e8
commit 6bd4a52f01
2 changed files with 0 additions and 30 deletions

View file

@ -28,13 +28,6 @@ pub enum EnemyUpdateState {
} }
impl<'a> Enemy<'a> { impl<'a> Enemy<'a> {
pub fn is_empty(&self) -> bool {
match self {
Enemy::Empty => true,
_ => false,
}
}
pub fn new_slime(object: &'a ObjectControl, start_pos: Vector2D<FixedNumberType>) -> Self { pub fn new_slime(object: &'a ObjectControl, start_pos: Vector2D<FixedNumberType>) -> Self {
Enemy::Slime(Slime::new(object, start_pos + (0, 1).into())) Enemy::Slime(Slime::new(object, start_pos + (0, 1).into()))
} }

View file

@ -1,33 +1,10 @@
use agb::display::{background::BackgroundRegister, HEIGHT, WIDTH}; use agb::display::{background::BackgroundRegister, HEIGHT, WIDTH};
fn num_digits_iter(mut n: u32) -> impl core::iter::Iterator<Item = u8> {
let mut length = 0;
core::iter::from_fn(move || {
if n == 0 {
length += 1;
if length <= 1 {
Some(0)
} else {
None
}
} else {
length += 1;
let c = n % 10;
n /= 10;
Some(c as u8)
}
})
}
const LEVEL_START: u16 = 12 * 28; const LEVEL_START: u16 = 12 * 28;
const NUMBERS_START: u16 = 12 * 28 + 3; const NUMBERS_START: u16 = 12 * 28 + 3;
const HYPHEN: u16 = 12 * 28 + 11; const HYPHEN: u16 = 12 * 28 + 11;
pub const BLANK: u16 = 11 * 28; pub const BLANK: u16 = 11 * 28;
pub fn new_map_store() -> [u16; 20] {
[BLANK; 20]
}
pub fn write_level(background: &mut BackgroundRegister, world: u32, level: u32) { pub fn write_level(background: &mut BackgroundRegister, world: u32, level: u32) {
let map = background.get_block(); let map = background.get_block();
let mut counter = 0; let mut counter = 0;