Add level reset

master
BeardedBread 2020-10-01 16:13:57 +08:00 committed by En Yi
parent f993c6b7ba
commit aa13a95664
3 changed files with 24 additions and 4 deletions

11
TODO 100644
View File

@ -0,0 +1,11 @@
Add Level Restart Key:
- Easiest: Go to end of level to deallocate everything and reconstruct all
Add Timer function:
- Need to reset on level start
Add Level Complete:
- When all targets on the level is destroyed
- Print a complete text
- R to reset, continue to return to menu
Add Level start:
- countdown before allow player movement
- Print Go on screen

9
main.c
View File

@ -137,6 +137,15 @@ void play_test_level(Camera2D camera){
if (IsKeyPressed(KEY_Q)){ if (IsKeyPressed(KEY_Q)){
break; break;
} }
if (IsKeyPressed(KEY_R)){
struct target_obj_node *target_current = target_HEAD;
while(target_current){
target_current->obj->destroyed = false;
target_current = target_current->next;
}
set_position(&player.kinematic, 400, 100);
}
player_input_check(&player); player_input_check(&player);
update_squishy(&sqr); update_squishy(&sqr);

View File

@ -1,12 +1,12 @@
#include "header.h" #include "header.h"
#include <raymath.h> #include <raymath.h>
#define PLAYER_ACCEL 1600 #define PLAYER_ACCEL 2750
#define AIR_ACCEL 800 #define AIR_ACCEL 900
#define RUN_INIT_SPD 230 #define RUN_INIT_SPD 250
#define JUMP_SPD 350 #define JUMP_SPD 350
#define GRAV 1200 #define GRAV 1200
#define DASH_SPD 550 #define DASH_SPD 600
#define DEFAULT_JUMP_COUNT 1 #define DEFAULT_JUMP_COUNT 1
static bool allow_move = true; static bool allow_move = true;