diff --git a/game/assets/character/player_run.png b/game/assets/character/player_run.png index d06842a..54adfba 100644 Binary files a/game/assets/character/player_run.png and b/game/assets/character/player_run.png differ diff --git a/game/assets/character/player_run_old.png b/game/assets/character/player_run_old.png index 87b5997..d06842a 100644 Binary files a/game/assets/character/player_run_old.png and b/game/assets/character/player_run_old.png differ diff --git a/game/assets/configs/application.json b/game/assets/configs/application.json index f8f92bb..fb1ab95 100644 --- a/game/assets/configs/application.json +++ b/game/assets/configs/application.json @@ -49,5 +49,5 @@ 188 ] }, - "animation_fps": 15 + "animation_fps": 23 } diff --git a/game/assets/levels/level_1/Level_2.psd b/game/assets/levels/level_1/Level_2.psd new file mode 100644 index 0000000..2765cbe Binary files /dev/null and b/game/assets/levels/level_1/Level_2.psd differ diff --git a/game/assets/levels/level_1/appearing_platforms.png b/game/assets/levels/level_1/appearing_platforms.png new file mode 100644 index 0000000..88a63b2 Binary files /dev/null and b/game/assets/levels/level_1/appearing_platforms.png differ diff --git a/game/assets/levels/level_1/background.png b/game/assets/levels/level_1/background.png new file mode 100644 index 0000000..140b63e Binary files /dev/null and b/game/assets/levels/level_1/background.png differ diff --git a/game/assets/levels/level_1/colliders.json b/game/assets/levels/level_1/colliders.json new file mode 100644 index 0000000..6011650 --- /dev/null +++ b/game/assets/levels/level_1/colliders.json @@ -0,0 +1,86 @@ +[ + { + "x": -500, + "y": 800, + "width": 16000, + "height": 10 + }, + { + "x": 576, + "y": 512, + "width": 352, + "height": 32 + }, + { + "x": 960, + "y": 352, + "width": 352, + "height": 32 + }, + { + "x": 1728, + "y": 352, + "width": 352, + "height": 32 + }, + { + "x": 2112, + "y": 512, + "width": 352, + "height": 32 + }, + { + "x": 4256, + "y": 544, + "width": 352, + "height": 32 + }, + { + "x": 4608, + "y": 480, + "width": 352, + "height": 96 + }, + { + "x": 5632, + "y": 288, + "width": 608, + "height": 64 + }, + { + "x": 6976, + "y": 480, + "width": 608, + "height": 64 + }, + { + "x": 7968, + "y": 480, + "width": 608, + "height": 64 + }, + { + "x": 1344, + "y": 512, + "width": 352, + "height": 32 + }, + { + "x": 4928, + "y": 544, + "width": 5280, + "height": 32 + }, + { + "x": 2496, + "y": 736, + "width": 640, + "height": 64 + }, + { + "x": 4608, + "y": 768, + "width": 5376, + "height": 32 + } +] diff --git a/game/assets/levels/level_1/disappearing_platforms.png b/game/assets/levels/level_1/disappearing_platforms.png new file mode 100644 index 0000000..d2181cc Binary files /dev/null and b/game/assets/levels/level_1/disappearing_platforms.png differ diff --git a/game/assets/levels/level_1/level0.xcf b/game/assets/levels/level_1/level0.xcf new file mode 100644 index 0000000..186b613 Binary files /dev/null and b/game/assets/levels/level_1/level0.xcf differ diff --git a/game/assets/levels/level_1/platforms.png b/game/assets/levels/level_1/platforms.png new file mode 100644 index 0000000..979f2ae Binary files /dev/null and b/game/assets/levels/level_1/platforms.png differ diff --git a/game/assets/levels/level_1/zones.json b/game/assets/levels/level_1/zones.json new file mode 100644 index 0000000..b787b50 --- /dev/null +++ b/game/assets/levels/level_1/zones.json @@ -0,0 +1,54 @@ +{ + "appear": [ + { + "x": 2496, + "y": 736, + "width": 640, + "height": 64 + }, + { + "x": 4608, + "y": 768, + "width": 5376, + "height": 32 + }, + { + "x": 10176, + "y": 0, + "width": 64, + "height": 576 + } + ], + "disappear": [ + { + "x": 2880, + "y": 352, + "width": 352, + "height": 32 + }, + { + "x": 4256, + "y": 576, + "width": 352, + "height": 224 + }, + { + "x": 7520, + "y": 0, + "width": 64, + "height": 480 + }, + { + "x": 9216, + "y": 480, + "width": 704, + "height": 64 + } + ], + "win": { + "x": 12000, + "y": 0, + "width": 100, + "height": 3000 + } +} diff --git a/game/assets/levels/levels.json b/game/assets/levels/levels.json index 614f9a8..768078c 100644 --- a/game/assets/levels/levels.json +++ b/game/assets/levels/levels.json @@ -1,3 +1,3 @@ [ - "level_0" + "level_1" ] diff --git a/game/src/character/mod.rs b/game/src/character/mod.rs index 4ee74e9..2c014cd 100644 --- a/game/src/character/mod.rs +++ b/game/src/character/mod.rs @@ -40,13 +40,13 @@ impl MainCharacter { movement_force: Vector2::zero(), velocity: Vector2::zero(), base_velocity: Vector2::new(0.0, GRAVITY_PPS), - size: Vector2::new(60.0, 100.0), + size: Vector2::new(85.0, 100.0), sprite_sheet: AnimatedSpriteSheet::new( sprite_sheet, - Vector2::new(300.0, 300.0), - 3, - 8, - 6, + Vector2::new(258.0, 277.0), + 4, + 15, + 0, ), current_state: CharacterState::default(), state_set_timestamp: Utc::now(), diff --git a/game/src/character/render.rs b/game/src/character/render.rs index 8f1430e..1c2f845 100644 --- a/game/src/character/render.rs +++ b/game/src/character/render.rs @@ -22,7 +22,7 @@ pub fn render_character_in_camera_space( // Calculate the frame ID to render let frame_id = match player.current_state { - crate::character::CharacterState::Jumping => 4, + crate::character::CharacterState::Jumping => 6, _ => (frames_since_state_change % player.sprite_sheet.sprite_count as f32).floor() as usize, }; @@ -35,7 +35,7 @@ pub fn render_character_in_camera_space( raylib, player .position - .sub(Vector2::new(player.size.y, player.size.y).div(4.0)), + .sub(Vector2::new(player.size.y, player.size.y).div(3.0)), Some(Vector2::new(player.size.y, player.size.y)), Some(frame_id), );