reimplement avatar as a plain sprite; handle sprite items as these are mostly needed for avatar

This commit is contained in:
2020-04-26 13:31:20 +01:00
parent ed6552f39c
commit cf1ca6f1b5
6 changed files with 40 additions and 135 deletions

View File

@@ -25,8 +25,9 @@ pub mod image {
}
}
pub fn avatar() -> Avatar {
Avatar {
pub fn avatar() -> Sprite {
Sprite {
id: 0,
animation_frames: vec![
Image {
pixels: vec![
@@ -44,9 +45,11 @@ pub fn avatar() -> Avatar {
},
],
name: None,
room_id: 0,
position: Position { x: 2, y: 5 },
room_id: Some(0),
position: Some(Position { x: 2, y: 5 }),
colour_id: None,
dialogue_id: None,
items: vec![]
}
}
@@ -81,6 +84,7 @@ pub fn sprite() -> Sprite {
room_id: Some(4),
position: Some(Position { x: 9, y: 7 }),
colour_id: None,
items: vec![]
}
}
@@ -699,7 +703,8 @@ pub fn game_default() -> Game {
walls: vec![],
}],
tiles: vec![self::tile_default()],
avatar: Avatar {
avatar: Sprite {
id: 0,
animation_frames: vec![Image {
pixels: vec![
0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0,
@@ -708,9 +713,11 @@ pub fn game_default() -> Game {
],
}],
name: None,
room_id: 0,
position: Position { x: 4, y: 4 },
room_id: Some(0),
position: Option::from(Position { x: 4, y: 4 }),
colour_id: None,
dialogue_id: None,
items: vec![]
},
sprites: vec![Sprite {
id: 10,
@@ -726,6 +733,7 @@ pub fn game_default() -> Game {
room_id: Some(0),
position: Some(Position { x: 8, y: 12 }),
colour_id: None,
items: vec![]
}],
items: vec![Item {
id: 0,