mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2024-11-26 15:23:38 +00:00
Fixes for #63
- Booster caret location - Game should start tick/control (flag 3) - Extend fade timer for Switch
This commit is contained in:
parent
d7a25f2681
commit
38efa5ded9
|
@ -15,17 +15,18 @@ impl Fade {
|
|||
|
||||
impl GameEntity<()> for Fade {
|
||||
fn tick(&mut self, state: &mut SharedGameState, _custom: ()) -> GameResult {
|
||||
let fade_ticks = state.constants.textscript.fade_ticks;
|
||||
match state.fade_state {
|
||||
FadeState::FadeOut(tick, direction) if tick < 15 => {
|
||||
FadeState::FadeOut(tick, direction) if tick < fade_ticks => {
|
||||
state.fade_state = FadeState::FadeOut(tick + 1, direction);
|
||||
}
|
||||
FadeState::FadeOut(tick, _) if tick == 15 => {
|
||||
FadeState::FadeOut(tick, _) if tick == fade_ticks => {
|
||||
state.fade_state = FadeState::Hidden;
|
||||
}
|
||||
FadeState::FadeIn(tick, direction) if tick > -15 => {
|
||||
FadeState::FadeIn(tick, direction) if tick > -fade_ticks => {
|
||||
state.fade_state = FadeState::FadeIn(tick - 1, direction);
|
||||
}
|
||||
FadeState::FadeIn(tick, _) if tick == -15 => {
|
||||
FadeState::FadeIn(tick, _) if tick == -fade_ticks => {
|
||||
state.fade_state = FadeState::Visible;
|
||||
}
|
||||
_ => {}
|
||||
|
|
|
@ -232,6 +232,7 @@ pub struct TextScriptConsts {
|
|||
pub text_shadow: bool,
|
||||
pub text_speed_normal: u8,
|
||||
pub text_speed_fast: u8,
|
||||
pub fade_ticks: i8,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -1499,6 +1500,7 @@ impl EngineConstants {
|
|||
text_shadow: false,
|
||||
text_speed_normal: 4,
|
||||
text_speed_fast: 1,
|
||||
fade_ticks: 15,
|
||||
},
|
||||
title: TitleConsts {
|
||||
intro_text: "Studio Pixel presents".to_owned(),
|
||||
|
@ -1680,6 +1682,7 @@ impl EngineConstants {
|
|||
self.textscript.text_shadow = true;
|
||||
self.textscript.text_speed_normal = 1;
|
||||
self.textscript.text_speed_fast = 0;
|
||||
self.textscript.fade_ticks = 21;
|
||||
self.soundtracks.insert("Famitracks".to_owned(), "/base/ogg17/".to_owned());
|
||||
self.soundtracks.insert("Ridiculon".to_owned(), "/base/ogg_ridic/".to_owned());
|
||||
self.game.tile_offset_x = 3;
|
||||
|
|
|
@ -414,7 +414,7 @@ impl Player {
|
|||
}
|
||||
}
|
||||
BoosterSwitch::Down if self.controller.trigger_jump() || self.booster_fuel % 3 == 1 => {
|
||||
state.create_caret(self.x, self.y + 0xc00, CaretType::Exhaust, Direction::Up);
|
||||
state.create_caret(self.x, self.y - 0xc00, CaretType::Exhaust, Direction::Up);
|
||||
state.sound_manager.play_sfx(113);
|
||||
}
|
||||
_ => {}
|
||||
|
|
|
@ -365,6 +365,8 @@ impl SharedGameState {
|
|||
next_scene.player1.y = pos_y as i32 * next_scene.stage.map.tile_size.as_int() * 0x200;
|
||||
|
||||
self.reset_map_flags();
|
||||
self.control_flags.set_control_enabled(true);
|
||||
self.control_flags.set_tick_world(true);
|
||||
self.fade_state = FadeState::Hidden;
|
||||
self.textscript_vm.state = TextScriptExecutionState::Running(self.constants.game.new_game_event, 0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue