update example projects

This commit is contained in:
Corwin 2022-03-07 20:41:04 +00:00
parent 8c2931aca5
commit 586f35265b
2 changed files with 8 additions and 8 deletions

View file

@ -85,15 +85,15 @@ agb::include_gfx!("gfx/tile_sheet.toml");
use agb::{ use agb::{
display::{ display::{
background::BackgroundRegular, background::BackgroundRegular,
object::{Object, ObjectController, Sprite, Tag, TagMap}, object::{Graphics, Object, ObjectController, Sprite, Tag, TagMap},
Priority, HEIGHT, WIDTH, Priority, HEIGHT, WIDTH,
}, },
fixnum::{FixedNum, Vector2D}, fixnum::{FixedNum, Vector2D},
input::{self, Button, ButtonController}, input::{self, Button, ButtonController},
}; };
const SPRITE_TAGS: (&[Sprite], &TagMap) = agb::include_aseprite!("gfx/sprites.aseprite"); const GRAPHICS: &Graphics = agb::include_aseprite!("gfx/sprites.aseprite");
const TAG_MAP: &TagMap = SPRITE_TAGS.1; const TAG_MAP: &TagMap = GRAPHICS.tags();
const WALKING: &Tag = TAG_MAP.get("Walking"); const WALKING: &Tag = TAG_MAP.get("Walking");
const JUMPING: &Tag = TAG_MAP.get("Jumping"); const JUMPING: &Tag = TAG_MAP.get("Jumping");

View file

@ -15,7 +15,7 @@ use rng::get_random;
use agb::{ use agb::{
display::{ display::{
background::{BackgroundDistributor, BackgroundRegular}, background::{BackgroundDistributor, BackgroundRegular},
object::{Object, ObjectController, Sprite, Tag, TagMap}, object::{Graphics, Object, ObjectController, Sprite, Tag, TagMap},
Priority, HEIGHT, WIDTH, Priority, HEIGHT, WIDTH,
}, },
fixnum::{FixedNum, Rect, Vector2D}, fixnum::{FixedNum, Rect, Vector2D},
@ -23,9 +23,8 @@ use agb::{
}; };
use generational_arena::Arena; use generational_arena::Arena;
const SPRITE_TAGS: (&[Sprite], &TagMap) = const GRAPHICS: &Graphics = agb::include_aseprite!("gfx/objects.aseprite", "gfx/boss.aseprite");
agb::include_aseprite!("gfx/objects.aseprite", "gfx/boss.aseprite"); const TAG_MAP: &TagMap = GRAPHICS.tags();
const TAG_MAP: &TagMap = SPRITE_TAGS.1;
const LONGSWORD_IDLE: &Tag = TAG_MAP.get("Idle - longsword"); const LONGSWORD_IDLE: &Tag = TAG_MAP.get("Idle - longsword");
const LONGSWORD_WALK: &Tag = TAG_MAP.get("Walk - longsword"); const LONGSWORD_WALK: &Tag = TAG_MAP.get("Walk - longsword");
@ -2011,7 +2010,8 @@ impl<'a> Game<'a> {
self.input.update(); self.input.update();
if let UpdateInstruction::CreateParticle(data, position) = if let UpdateInstruction::CreateParticle(data, position) =
self.player.update(object_controller, &self.input, &self.level, sfx) self.player
.update(object_controller, &self.input, &self.level, sfx)
{ {
let new_particle = Particle::new(object_controller, data, position); let new_particle = Particle::new(object_controller, data, position);