pub struct Celeste {Show 24 fields
pub mem: Memory,
pub objects: Vec<Rc<RefCell<Object>>>,
pub got_fruit: Vec<bool>,
pub max_djump: u8,
pub deaths: u64,
pub frames: u8,
pub room: Vector,
pub level: u8,
pub has_dashed: bool,
pub has_key: bool,
pub freeze: u8,
pub particles: Vec<Particle>,
pub dead_particles: Vec<DeadParticle>,
pub delay_restart: u8,
pub shake: u8,
pub seconds: u8,
pub minutes: u64,
pub clouds: Vec<Cloud>,
pub start_game_flash: f32,
pub music_timer: i32,
pub start_game: bool,
pub flash_bg: bool,
pub new_bg: bool,
pub pause_player: bool,
}Fields§
§mem: MemoryRepresents the pico-8 display buffers and memory. Go through this for any drawing
objects: Vec<Rc<RefCell<Object>>>§got_fruit: Vec<bool>§max_djump: u8§deaths: u64§frames: u8§room: Vector§level: u8§has_dashed: bool§has_key: bool§freeze: u8§particles: Vec<Particle>§dead_particles: Vec<DeadParticle>§delay_restart: u8§shake: u8§seconds: u8§minutes: u64§clouds: Vec<Cloud>§start_game_flash: f32§music_timer: i32§start_game: bool§flash_bg: bool§new_bg: bool§pause_player: boolImplementations§
Source§impl Celeste
impl Celeste
Sourcepub fn new(
map: String,
sprites: String,
flags: String,
fontatlas: String,
) -> Celeste
pub fn new( map: String, sprites: String, flags: String, fontatlas: String, ) -> Celeste
Returns a new celeste object
§Arguments
map- A string containing the “mapdata” section of a pico-8 cartsprites- A string containing the “sprites” section of the pico-8 cartflags- A string containing the “flags” section of the pico-8 cartsfontatlas- A string with the bitmap data of the pico-8 font
§Examples
// see https://github.com/CoolElectronics/rustic-mountain/blob/main/standalone/src/consts.rs for example values of these constants
let celeste = Celeste::new(MAPDATA,SPRITES,FLAGS,FONTATLAS);Sourcepub fn next_tick(&mut self)
pub fn next_tick(&mut self)
Advances a game tick. Does not draw the screen buffer. Analagous to calling _update() in
the original pico-8 cart. Should be called 30 times a second for real-time gameplay
pub fn is_title(&self) -> bool
pub fn begin_game(&mut self)
pub fn draw(&mut self)
pub fn title_screen(&mut self)
pub fn load_room(&mut self, x: u8, y: u8)
pub fn tile_at(&self, x: f32, y: f32) -> u8
pub fn spikes_at( &self, x1: f32, y1: f32, x2: f32, y2: f32, xspd: f32, yspd: f32, ) -> bool
Sourcepub fn save_state(&mut self) -> Result<String, Error>
pub fn save_state(&mut self) -> Result<String, Error>
returns a savestate in JSON format, as a string
let savestate = celeste.save_state();
celeste.load_state(savestate)Sourcepub fn load_state(&mut self, json: &str)
pub fn load_state(&mut self, json: &str)
loads a savestate in JSON format, as a string slice
let savestate = celeste.save_state();
celeste.load_state(savestate)Trait Implementations§
Source§impl<'de> Deserialize<'de> for Celeste
impl<'de> Deserialize<'de> for Celeste
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Celeste
impl !RefUnwindSafe for Celeste
impl !Send for Celeste
impl !Sync for Celeste
impl Unpin for Celeste
impl !UnwindSafe for Celeste
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more