2020-04-12 13:38:07 +00:00
|
|
|
use crate::*;
|
2020-04-24 17:06:17 +00:00
|
|
|
use crate::game::{RoomType, RoomFormat};
|
2020-04-12 11:48:07 +00:00
|
|
|
|
|
|
|
pub mod image {
|
2020-04-12 13:28:11 +00:00
|
|
|
use crate::Image;
|
2020-04-12 11:48:07 +00:00
|
|
|
|
2020-04-28 17:00:31 +00:00
|
|
|
#[inline]
|
2020-04-29 17:53:39 +00:00
|
|
|
pub fn chequers_1() -> Image {
|
2020-04-12 11:48:07 +00:00
|
|
|
Image {
|
|
|
|
pixels: vec![
|
2020-04-18 15:58:30 +00:00
|
|
|
1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1,
|
|
|
|
0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0,
|
2020-04-12 11:48:07 +00:00
|
|
|
0, 1, 0, 1, 0, 1, 0, 1,
|
2020-04-18 15:58:30 +00:00
|
|
|
],
|
2020-04-12 11:48:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-28 17:00:31 +00:00
|
|
|
#[inline]
|
2020-04-12 11:48:07 +00:00
|
|
|
pub fn chequers_2() -> Image {
|
|
|
|
Image {
|
|
|
|
pixels: vec![
|
2020-04-18 15:58:30 +00:00
|
|
|
0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0,
|
|
|
|
1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1,
|
|
|
|
1, 0, 1, 0, 1, 0, 1, 0,
|
|
|
|
],
|
2020-04-12 11:48:07 +00:00
|
|
|
}
|
|
|
|
}
|
2020-04-29 07:27:35 +00:00
|
|
|
|
|
|
|
#[inline]
|
|
|
|
pub fn animation_frames() -> Vec<Image> {
|
|
|
|
vec![
|
|
|
|
Image {
|
|
|
|
pixels: vec![
|
|
|
|
1,0,0,1,1,0,0,1,
|
|
|
|
0,0,1,1,0,0,1,1,
|
|
|
|
0,1,1,0,0,1,1,0,
|
|
|
|
1,1,0,0,1,1,0,0,
|
|
|
|
1,0,0,1,1,0,0,1,
|
|
|
|
0,0,1,1,0,0,1,1,
|
|
|
|
0,1,1,0,0,1,1,0,
|
|
|
|
1,1,0,0,1,1,0,0,
|
|
|
|
]
|
|
|
|
},
|
|
|
|
Image {
|
|
|
|
pixels: vec![
|
|
|
|
1,1,0,0,1,1,0,0,
|
|
|
|
1,0,0,1,1,0,0,1,
|
|
|
|
0,0,1,1,0,0,1,1,
|
|
|
|
0,1,1,0,0,1,1,0,
|
|
|
|
1,1,0,0,1,1,0,0,
|
|
|
|
1,0,0,1,1,0,0,1,
|
|
|
|
0,0,1,1,0,0,1,1,
|
|
|
|
0,1,1,0,0,1,1,0,
|
|
|
|
]
|
|
|
|
},
|
|
|
|
Image {
|
|
|
|
pixels: vec![
|
|
|
|
0,1,1,0,0,1,1,0,
|
|
|
|
1,1,0,0,1,1,0,0,
|
|
|
|
1,0,0,1,1,0,0,1,
|
|
|
|
0,0,1,1,0,0,1,1,
|
|
|
|
0,1,1,0,0,1,1,0,
|
|
|
|
1,1,0,0,1,1,0,0,
|
|
|
|
1,0,0,1,1,0,0,1,
|
|
|
|
0,0,1,1,0,0,1,1,
|
|
|
|
]
|
|
|
|
},
|
|
|
|
Image {
|
|
|
|
pixels: vec![
|
|
|
|
0,0,1,1,0,0,1,1,
|
|
|
|
0,1,1,0,0,1,1,0,
|
|
|
|
1,1,0,0,1,1,0,0,
|
|
|
|
1,0,0,1,1,0,0,1,
|
|
|
|
0,0,1,1,0,0,1,1,
|
|
|
|
0,1,1,0,0,1,1,0,
|
|
|
|
1,1,0,0,1,1,0,0,
|
|
|
|
1,0,0,1,1,0,0,1,
|
|
|
|
]
|
|
|
|
},
|
|
|
|
]
|
|
|
|
}
|
2020-04-12 11:48:07 +00:00
|
|
|
}
|
|
|
|
|
2020-04-28 17:00:31 +00:00
|
|
|
#[inline]
|
2020-04-26 12:31:20 +00:00
|
|
|
pub fn avatar() -> Sprite {
|
|
|
|
Sprite {
|
2020-06-18 13:44:20 +00:00
|
|
|
id: "0".to_string(),
|
2020-04-12 11:48:07 +00:00
|
|
|
animation_frames: vec![
|
|
|
|
Image {
|
|
|
|
pixels: vec![
|
2020-04-18 15:58:30 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1,
|
|
|
|
1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
|
1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0,
|
|
|
|
],
|
2020-04-12 11:48:07 +00:00
|
|
|
},
|
|
|
|
Image {
|
|
|
|
pixels: vec![
|
2020-04-18 15:58:30 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1,
|
|
|
|
1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1,
|
|
|
|
1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0,
|
|
|
|
],
|
2020-04-12 11:48:07 +00:00
|
|
|
},
|
|
|
|
],
|
2020-04-18 14:49:33 +00:00
|
|
|
name: None,
|
2020-06-18 13:44:20 +00:00
|
|
|
room_id: Some("0".to_string()),
|
2020-04-26 12:31:20 +00:00
|
|
|
position: Some(Position { x: 2, y: 5 }),
|
2020-04-13 23:40:29 +00:00
|
|
|
colour_id: None,
|
2020-04-26 12:31:20 +00:00
|
|
|
dialogue_id: None,
|
|
|
|
items: vec![]
|
2020-04-12 11:48:07 +00:00
|
|
|
}
|
|
|
|
}
|
2020-04-12 12:35:17 +00:00
|
|
|
|
2020-04-28 17:00:31 +00:00
|
|
|
#[inline]
|
2020-04-13 15:19:59 +00:00
|
|
|
pub fn tile_default() -> Tile {
|
|
|
|
Tile {
|
2020-06-18 16:47:54 +00:00
|
|
|
id: "a".to_string(),
|
2020-07-19 07:36:20 +00:00
|
|
|
name: Some("block".to_string()),
|
2020-04-13 23:40:29 +00:00
|
|
|
wall: None,
|
2020-04-18 15:58:30 +00:00
|
|
|
animation_frames: vec![Image {
|
|
|
|
pixels: vec![
|
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1,
|
|
|
|
1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1,
|
|
|
|
1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
colour_id: None,
|
2020-04-13 15:19:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-29 23:32:59 +00:00
|
|
|
#[inline]
|
|
|
|
pub fn tile_background() -> Tile {
|
|
|
|
Tile {
|
|
|
|
id: "0".to_string(),
|
|
|
|
name: None,
|
|
|
|
wall: None,
|
|
|
|
animation_frames: vec![Image {pixels: vec![0; 64]}],
|
|
|
|
colour_id: None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-28 17:00:31 +00:00
|
|
|
#[inline]
|
2020-04-12 16:13:08 +00:00
|
|
|
pub fn sprite() -> Sprite {
|
2020-04-12 12:35:17 +00:00
|
|
|
Sprite {
|
2020-06-18 13:44:20 +00:00
|
|
|
id: "a".to_string(),
|
2020-04-12 12:35:17 +00:00
|
|
|
name: Some("hatch".to_string()),
|
2020-04-18 15:58:30 +00:00
|
|
|
animation_frames: vec![Image {
|
|
|
|
pixels: vec![
|
2020-06-28 16:47:43 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 1, 1, 1, 1, 0, 0, 0,
|
|
|
|
0, 1, 0, 0, 1, 0, 0, 0,
|
|
|
|
0, 0, 1, 1, 1, 1, 0, 0,
|
|
|
|
0, 0, 1, 1, 1, 1, 0, 0,
|
|
|
|
0, 1, 0, 1, 1, 1, 1, 0,
|
|
|
|
0, 1, 0, 1, 1, 1, 1, 0,
|
2020-04-18 15:58:30 +00:00
|
|
|
0, 1, 1, 0, 1, 1, 1, 1,
|
|
|
|
],
|
|
|
|
}],
|
2020-07-19 07:36:20 +00:00
|
|
|
dialogue_id: Some("0".to_string()),
|
2020-06-18 13:44:20 +00:00
|
|
|
room_id: Some("4".to_string()),
|
2020-04-13 23:40:29 +00:00
|
|
|
position: Some(Position { x: 9, y: 7 }),
|
|
|
|
colour_id: None,
|
2020-04-26 12:31:20 +00:00
|
|
|
items: vec![]
|
2020-04-12 12:35:17 +00:00
|
|
|
}
|
|
|
|
}
|
2020-04-12 12:46:55 +00:00
|
|
|
|
2020-07-19 07:36:20 +00:00
|
|
|
pub mod item {
|
|
|
|
use crate::item::Item;
|
|
|
|
use crate::image::Image;
|
|
|
|
|
|
|
|
pub fn key() -> Item {
|
|
|
|
Item {
|
|
|
|
id: "1".to_string(),
|
|
|
|
animation_frames: vec![
|
|
|
|
Image { pixels: vec![
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 1, 1, 1, 1, 0, 0,
|
|
|
|
0, 0, 1, 0, 0, 1, 0, 0,
|
|
|
|
0, 0, 1, 1, 1, 1, 0, 0,
|
|
|
|
0, 0, 0, 1, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 1, 1, 0, 0, 0,
|
|
|
|
0, 0, 0, 1, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 1, 1, 0, 0, 0
|
|
|
|
]}
|
|
|
|
],
|
|
|
|
name: Some("key".to_string()),
|
|
|
|
dialogue_id: Some("2".to_string()),
|
|
|
|
colour_id: None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-12 12:46:55 +00:00
|
|
|
pub fn item() -> Item {
|
|
|
|
Item {
|
2020-06-18 13:44:20 +00:00
|
|
|
id: "6".to_string(),
|
2020-04-18 15:58:30 +00:00
|
|
|
animation_frames: vec![Image {
|
|
|
|
pixels: vec![
|
2020-07-19 07:36:20 +00:00
|
|
|
0, 1, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 1, 0, 0,
|
|
|
|
0, 0, 1, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0,
|
2020-04-18 15:58:30 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 1, 0,
|
|
|
|
],
|
|
|
|
}],
|
2020-04-12 12:46:55 +00:00
|
|
|
name: Some("door".to_string()),
|
2020-07-19 07:36:20 +00:00
|
|
|
dialogue_id: Some("2".to_string()),
|
2020-04-18 15:58:30 +00:00
|
|
|
colour_id: None,
|
2020-04-12 12:46:55 +00:00
|
|
|
}
|
|
|
|
}
|
2020-04-12 13:28:11 +00:00
|
|
|
|
2020-04-28 17:00:31 +00:00
|
|
|
#[inline]
|
2020-04-12 13:28:11 +00:00
|
|
|
pub fn room() -> Room {
|
|
|
|
Room {
|
2020-06-18 13:44:20 +00:00
|
|
|
id: "a".to_string(),
|
|
|
|
palette_id: Some("9".to_string()),
|
2020-04-12 13:28:11 +00:00
|
|
|
name: Some("cellar 7".to_string()),
|
|
|
|
tiles: vec![
|
2020-04-18 15:58:30 +00:00
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"1l".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"y".to_string(),
|
|
|
|
"x".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"1j".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"1j".to_string(),
|
|
|
|
"1l".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"1j".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"1j".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"y".to_string(),
|
|
|
|
"y".to_string(),
|
|
|
|
"x".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"1c".to_string(),
|
|
|
|
"1x".to_string(),
|
|
|
|
"1y".to_string(),
|
|
|
|
"1m".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"y".to_string(),
|
|
|
|
"y".to_string(),
|
|
|
|
"y".to_string(),
|
|
|
|
"x".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"s".to_string(),
|
|
|
|
"s".to_string(),
|
|
|
|
"s".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"1g".to_string(),
|
|
|
|
"1f".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"1i".to_string(),
|
|
|
|
"1u".to_string(),
|
|
|
|
"1u".to_string(),
|
|
|
|
"1u".to_string(),
|
|
|
|
"1v".to_string(),
|
|
|
|
"11".to_string(),
|
|
|
|
"19".to_string(),
|
|
|
|
"1b".to_string(),
|
|
|
|
"1a".to_string(),
|
|
|
|
"1e".to_string(),
|
|
|
|
"10".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"11".to_string(),
|
|
|
|
"12".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"10".to_string(),
|
|
|
|
"17".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"18".to_string(),
|
|
|
|
"1e".to_string(),
|
|
|
|
"12".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"1k".to_string(),
|
|
|
|
"14".to_string(),
|
|
|
|
"15".to_string(),
|
|
|
|
"16".to_string(),
|
|
|
|
"1h".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"10".to_string(),
|
|
|
|
"1d".to_string(),
|
|
|
|
"1v".to_string(),
|
|
|
|
"1r".to_string(),
|
|
|
|
"1s".to_string(),
|
|
|
|
"1r".to_string(),
|
|
|
|
"1q".to_string(),
|
|
|
|
"1z".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"12".to_string(),
|
|
|
|
"10".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"1i".to_string(),
|
|
|
|
"1n".to_string(),
|
|
|
|
"1o".to_string(),
|
|
|
|
"1o".to_string(),
|
|
|
|
"1o".to_string(),
|
|
|
|
"1p".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"10".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"11".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"12".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"z".to_string(),
|
|
|
|
"10".to_string(),
|
|
|
|
"12".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"k".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
2020-04-12 13:28:11 +00:00
|
|
|
],
|
|
|
|
items: vec![
|
2020-04-18 15:58:30 +00:00
|
|
|
Instance {
|
|
|
|
position: Position { x: 11, y: 5 },
|
|
|
|
id: "d".to_string(),
|
|
|
|
},
|
|
|
|
Instance {
|
|
|
|
position: Position { x: 8, y: 3 },
|
|
|
|
id: "e".to_string(),
|
|
|
|
},
|
|
|
|
Instance {
|
|
|
|
position: Position { x: 1, y: 0 },
|
|
|
|
id: "5".to_string(),
|
|
|
|
},
|
|
|
|
Instance {
|
|
|
|
position: Position { x: 2, y: 1 },
|
|
|
|
id: "6".to_string(),
|
|
|
|
},
|
|
|
|
Instance {
|
|
|
|
position: Position { x: 3, y: 2 },
|
|
|
|
id: "6".to_string(),
|
2020-04-12 13:28:11 +00:00
|
|
|
},
|
|
|
|
],
|
2020-04-18 15:58:30 +00:00
|
|
|
exits: vec![ExitInstance {
|
|
|
|
position: Position { x: 3, y: 3 },
|
|
|
|
exit: Exit {
|
2020-06-18 13:44:20 +00:00
|
|
|
room_id: "3".to_string(),
|
2020-04-18 15:58:30 +00:00
|
|
|
position: Position { x: 10, y: 6 },
|
|
|
|
effect: Transition::None,
|
|
|
|
},
|
2020-04-28 07:34:35 +00:00
|
|
|
transition: None,
|
|
|
|
dialogue_id: None
|
2020-04-18 15:58:30 +00:00
|
|
|
}],
|
|
|
|
endings: vec![Instance {
|
|
|
|
position: Position { x: 8, y: 7 },
|
|
|
|
id: "undefined".to_string(),
|
|
|
|
}],
|
2020-04-18 13:39:17 +00:00
|
|
|
walls: vec![],
|
2020-04-12 13:28:11 +00:00
|
|
|
}
|
|
|
|
}
|
2020-04-12 13:38:07 +00:00
|
|
|
|
2020-04-28 17:00:31 +00:00
|
|
|
#[inline]
|
2020-04-12 16:13:08 +00:00
|
|
|
pub fn game_default() -> Game {
|
2020-04-12 13:38:07 +00:00
|
|
|
Game {
|
|
|
|
name: "Write your game's title here".to_string(),
|
2020-07-19 07:36:20 +00:00
|
|
|
version: Some(Version { major: 7, minor: 1 }),
|
2020-04-24 17:06:17 +00:00
|
|
|
room_format: Some(RoomFormat::CommaSeparated),
|
|
|
|
room_type: RoomType::Room,
|
2020-04-18 09:45:01 +00:00
|
|
|
font: Font::AsciiSmall,
|
|
|
|
custom_font: None,
|
|
|
|
text_direction: TextDirection::LeftToRight,
|
2020-04-18 15:58:30 +00:00
|
|
|
palettes: vec![Palette {
|
2020-06-18 13:44:20 +00:00
|
|
|
id: "0".to_string(),
|
2020-07-19 07:36:20 +00:00
|
|
|
name: Some("blueprint".to_string()),
|
2020-04-18 15:58:30 +00:00
|
|
|
colours: vec![
|
|
|
|
Colour {
|
|
|
|
red: 0,
|
|
|
|
green: 82,
|
|
|
|
blue: 204,
|
|
|
|
},
|
|
|
|
Colour {
|
|
|
|
red: 128,
|
|
|
|
green: 159,
|
|
|
|
blue: 255,
|
|
|
|
},
|
|
|
|
Colour {
|
|
|
|
red: 255,
|
|
|
|
green: 255,
|
|
|
|
blue: 255,
|
|
|
|
},
|
2020-04-12 13:38:07 +00:00
|
|
|
],
|
2020-04-18 15:58:30 +00:00
|
|
|
}],
|
|
|
|
rooms: vec![Room {
|
2020-06-18 13:44:20 +00:00
|
|
|
id: "0".to_string(),
|
|
|
|
palette_id: Some("0".to_string()),
|
2020-07-19 07:36:20 +00:00
|
|
|
name: Some("example room".to_string()),
|
2020-04-18 15:58:30 +00:00
|
|
|
tiles: vec![
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"a".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
"0".to_string(),
|
|
|
|
],
|
|
|
|
items: vec![],
|
|
|
|
exits: vec![],
|
|
|
|
endings: vec![],
|
|
|
|
walls: vec![],
|
|
|
|
}],
|
|
|
|
tiles: vec![self::tile_default()],
|
2020-06-18 16:46:30 +00:00
|
|
|
sprites: vec![
|
|
|
|
Sprite {
|
|
|
|
id: "A".to_string(),
|
|
|
|
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,
|
|
|
|
1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0,
|
|
|
|
0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0,
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
name: None,
|
|
|
|
room_id: Some("0".to_string()),
|
|
|
|
position: Option::from(Position { x: 4, y: 4 }),
|
|
|
|
colour_id: None,
|
|
|
|
dialogue_id: None,
|
|
|
|
items: vec![]
|
|
|
|
},
|
|
|
|
Sprite {
|
|
|
|
id: "a".to_string(),
|
2020-07-19 07:36:20 +00:00
|
|
|
name: Some("cat".to_string()),
|
2020-06-18 16:46:30 +00:00
|
|
|
animation_frames: vec![Image {
|
|
|
|
pixels: vec![
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1,
|
|
|
|
1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1,
|
|
|
|
1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0,
|
|
|
|
],
|
|
|
|
}],
|
2020-07-19 07:36:20 +00:00
|
|
|
dialogue_id: Some("0".to_string()),
|
2020-06-18 16:46:30 +00:00
|
|
|
room_id: Some("0".to_string()),
|
|
|
|
position: Some(Position { x: 8, y: 12 }),
|
|
|
|
colour_id: None,
|
|
|
|
items: vec![]
|
|
|
|
},
|
|
|
|
],
|
2020-07-19 07:36:20 +00:00
|
|
|
items: vec![
|
|
|
|
Item {
|
|
|
|
id: "0".to_string(),
|
|
|
|
animation_frames: vec![Image {
|
|
|
|
pixels: vec![
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1,
|
|
|
|
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
name: Some("tea".to_string()),
|
|
|
|
dialogue_id: Some("1".to_string()),
|
|
|
|
colour_id: None,
|
|
|
|
},
|
|
|
|
item::key()
|
|
|
|
],
|
2020-04-12 13:38:07 +00:00
|
|
|
dialogues: vec![
|
|
|
|
Dialogue {
|
2020-07-19 07:36:20 +00:00
|
|
|
id: "0".to_string(),
|
2020-04-12 13:38:07 +00:00
|
|
|
contents: "I'm a cat".to_string(),
|
2020-07-19 07:36:20 +00:00
|
|
|
name: Some("cat dialog".to_string()),
|
2020-04-12 13:38:07 +00:00
|
|
|
},
|
|
|
|
Dialogue {
|
2020-07-19 07:36:20 +00:00
|
|
|
id: "1".to_string(),
|
2020-04-12 13:38:07 +00:00
|
|
|
contents: "You found a nice warm cup of tea".to_string(),
|
2020-07-19 07:36:20 +00:00
|
|
|
name: Some("tea dialog".to_string()),
|
2020-04-12 13:38:07 +00:00
|
|
|
},
|
2020-07-19 07:36:20 +00:00
|
|
|
Dialogue {
|
|
|
|
id: "2".to_string(),
|
|
|
|
contents: "A key! {wvy}What does it open?{wvy}".to_string(),
|
|
|
|
name: Some("key dialog".to_string())
|
|
|
|
}
|
2020-04-12 13:38:07 +00:00
|
|
|
],
|
|
|
|
endings: vec![],
|
2020-04-18 15:58:30 +00:00
|
|
|
variables: vec![Variable {
|
|
|
|
id: "a".to_string(),
|
|
|
|
initial_value: "42".to_string(),
|
|
|
|
}],
|
2020-04-23 15:42:01 +00:00
|
|
|
font_data: None,
|
|
|
|
line_endings_crlf: false
|
2020-04-12 13:38:07 +00:00
|
|
|
}
|
|
|
|
}
|