diff options
30 files changed, 40 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/build
\ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 7a89823..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "files.associations": { - "*.ejs": "html", - "initializer_list": "c", - "type_traits": "c", - "xutility": "c" - } -}
\ No newline at end of file diff --git a/build/zombies.exe b/build/zombies.exe Binary files differindex 7a62eac..4b57496 100644 --- a/build/zombies.exe +++ b/build/zombies.exe diff --git a/data/imgs/players/Black/Gunner_Black_Crouch.png b/data/imgs/players/Black/Gunner_Black_Crouch.png Binary files differnew file mode 100644 index 0000000..92493c3 --- /dev/null +++ b/data/imgs/players/Black/Gunner_Black_Crouch.png diff --git a/data/imgs/players/Black/Gunner_Black_Death.png b/data/imgs/players/Black/Gunner_Black_Death.png Binary files differnew file mode 100644 index 0000000..2be6095 --- /dev/null +++ b/data/imgs/players/Black/Gunner_Black_Death.png diff --git a/data/imgs/players/Black/Gunner_Black_Idle.png b/data/imgs/players/Black/Gunner_Black_Idle.png Binary files differnew file mode 100644 index 0000000..217a4a7 --- /dev/null +++ b/data/imgs/players/Black/Gunner_Black_Idle.png diff --git a/data/imgs/players/Black/Gunner_Black_Jump.png b/data/imgs/players/Black/Gunner_Black_Jump.png Binary files differnew file mode 100644 index 0000000..69fcd7c --- /dev/null +++ b/data/imgs/players/Black/Gunner_Black_Jump.png diff --git a/data/imgs/players/Black/Gunner_Black_Run.png b/data/imgs/players/Black/Gunner_Black_Run.png Binary files differnew file mode 100644 index 0000000..9c5b96f --- /dev/null +++ b/data/imgs/players/Black/Gunner_Black_Run.png diff --git a/data/imgs/players/Green/Gunner_Green_Crouch.png b/data/imgs/players/Green/Gunner_Green_Crouch.png Binary files differnew file mode 100644 index 0000000..29c8f98 --- /dev/null +++ b/data/imgs/players/Green/Gunner_Green_Crouch.png diff --git a/data/imgs/players/Green/Gunner_Green_Death.png b/data/imgs/players/Green/Gunner_Green_Death.png Binary files differnew file mode 100644 index 0000000..f979b1d --- /dev/null +++ b/data/imgs/players/Green/Gunner_Green_Death.png diff --git a/data/imgs/players/Green/Gunner_Green_Idle.png b/data/imgs/players/Green/Gunner_Green_Idle.png Binary files differnew file mode 100644 index 0000000..62c409e --- /dev/null +++ b/data/imgs/players/Green/Gunner_Green_Idle.png diff --git a/data/imgs/players/Green/Gunner_Green_Jump.png b/data/imgs/players/Green/Gunner_Green_Jump.png Binary files differnew file mode 100644 index 0000000..9e5e954 --- /dev/null +++ b/data/imgs/players/Green/Gunner_Green_Jump.png diff --git a/data/imgs/players/Green/Gunner_Green_Run.png b/data/imgs/players/Green/Gunner_Green_Run.png Binary files differnew file mode 100644 index 0000000..4d71311 --- /dev/null +++ b/data/imgs/players/Green/Gunner_Green_Run.png diff --git a/data/imgs/players/Red/Gunner_Red_Crouch.png b/data/imgs/players/Red/Gunner_Red_Crouch.png Binary files differnew file mode 100644 index 0000000..1fd9470 --- /dev/null +++ b/data/imgs/players/Red/Gunner_Red_Crouch.png diff --git a/data/imgs/players/Red/Gunner_Red_Death.png b/data/imgs/players/Red/Gunner_Red_Death.png Binary files differnew file mode 100644 index 0000000..0e1227b --- /dev/null +++ b/data/imgs/players/Red/Gunner_Red_Death.png diff --git a/data/imgs/players/Red/Gunner_Red_Idle.png b/data/imgs/players/Red/Gunner_Red_Idle.png Binary files differnew file mode 100644 index 0000000..993a2e2 --- /dev/null +++ b/data/imgs/players/Red/Gunner_Red_Idle.png diff --git a/data/imgs/players/Red/Gunner_Red_Jump.png b/data/imgs/players/Red/Gunner_Red_Jump.png Binary files differnew file mode 100644 index 0000000..35820eb --- /dev/null +++ b/data/imgs/players/Red/Gunner_Red_Jump.png diff --git a/data/imgs/players/Red/Gunner_Red_Run.png b/data/imgs/players/Red/Gunner_Red_Run.png Binary files differnew file mode 100644 index 0000000..d641ef1 --- /dev/null +++ b/data/imgs/players/Red/Gunner_Red_Run.png diff --git a/data/imgs/players/Yellow/Gunner_Yellow_Crouch.png b/data/imgs/players/Yellow/Gunner_Yellow_Crouch.png Binary files differnew file mode 100644 index 0000000..b90b937 --- /dev/null +++ b/data/imgs/players/Yellow/Gunner_Yellow_Crouch.png diff --git a/data/imgs/players/Yellow/Gunner_Yellow_Death.png b/data/imgs/players/Yellow/Gunner_Yellow_Death.png Binary files differnew file mode 100644 index 0000000..fa21a8e --- /dev/null +++ b/data/imgs/players/Yellow/Gunner_Yellow_Death.png diff --git a/data/imgs/players/Yellow/Gunner_Yellow_Idle.png b/data/imgs/players/Yellow/Gunner_Yellow_Idle.png Binary files differnew file mode 100644 index 0000000..bd4d31d --- /dev/null +++ b/data/imgs/players/Yellow/Gunner_Yellow_Idle.png diff --git a/data/imgs/players/Yellow/Gunner_Yellow_Jump.png b/data/imgs/players/Yellow/Gunner_Yellow_Jump.png Binary files differnew file mode 100644 index 0000000..ca6531e --- /dev/null +++ b/data/imgs/players/Yellow/Gunner_Yellow_Jump.png diff --git a/data/imgs/players/Yellow/Gunner_Yellow_Run.png b/data/imgs/players/Yellow/Gunner_Yellow_Run.png Binary files differnew file mode 100644 index 0000000..e6ee52d --- /dev/null +++ b/data/imgs/players/Yellow/Gunner_Yellow_Run.png diff --git a/include/asset_defs.h b/include/asset_defs.h index 417e890..192044b 100644 --- a/include/asset_defs.h +++ b/include/asset_defs.h @@ -46,6 +46,19 @@ image* img_molotov_explode; // Players image* img_gunner_blue_run; image* img_gunner_blue_idle; + +image* img_gunner_black_run; +image* img_gunner_black_idle; + +image* img_gunner_green_run; +image* img_gunner_green_idle; + +image* img_gunner_yellow_run; +image* img_gunner_yellow_idle; + +image* img_gunner_red_run; +image* img_gunner_red_idle; + image* img_alien_run; // Guns diff --git a/include/game.h b/include/game.h index 869d64c..60c170c 100644 --- a/include/game.h +++ b/include/game.h @@ -8,7 +8,7 @@ #include "../include/game.h" #define SERVER_TICK_RATE (1.0f/60.0f) -#define SERVER_MAX_PLAYERS (10) +#define SERVER_MAX_PLAYERS (5) #define SERVER_PATHFINDING_INTERVAL (0.25f) typedef enum t_game_state { diff --git a/include/players.h b/include/players.h index 5e512c5..7607788 100644 --- a/include/players.h +++ b/include/players.h @@ -10,7 +10,7 @@ #include "guns.h" #include "sprite.h" -#define MAX_PLAYERS 10 +#define MAX_PLAYERS 5 #define MAX_POINT_ANIMATIONS 10 #define GUN_OFFSET_FROM_PLAYER 0.8f diff --git a/libSDL2.a b/libSDL2.a Binary files differdeleted file mode 100644 index 08f332d..0000000 --- a/libSDL2.a +++ /dev/null diff --git a/libSDL2_mixer.a b/libSDL2_mixer.a Binary files differdeleted file mode 100644 index c64f55a..0000000 --- a/libSDL2_mixer.a +++ /dev/null diff --git a/src/asset_defs.c b/src/asset_defs.c index 24491fa..43d9c38 100644 --- a/src/asset_defs.c +++ b/src/asset_defs.c @@ -47,8 +47,20 @@ void load_assets() { img_metal_wall2 = assets_load_image_from_file("data/imgs/objects/metal_wall2.png"); // Players + img_gunner_black_run = assets_load_image_from_file("data/imgs/players/Black/Gunner_Black_Run.png"); + img_gunner_black_idle = assets_load_image_from_file("data/imgs/players/Black/Gunner_Black_Idle.png"); + img_gunner_blue_run = assets_load_image_from_file("data/imgs/players/Blue/Gunner_Blue_Run.png"); img_gunner_blue_idle = assets_load_image_from_file("data/imgs/players/Blue/Gunner_Blue_Idle.png"); + + img_gunner_green_run = assets_load_image_from_file("data/imgs/players/Green/Gunner_Green_Run.png"); + img_gunner_green_idle = assets_load_image_from_file("data/imgs/players/Green/Gunner_Green_Idle.png"); + + img_gunner_red_run = assets_load_image_from_file("data/imgs/players/Red/Gunner_Red_Run.png"); + img_gunner_red_idle = assets_load_image_from_file("data/imgs/players/Red/Gunner_Red_Idle.png"); + + img_gunner_yellow_run = assets_load_image_from_file("data/imgs/players/Yellow/Gunner_Yellow_Run.png"); + img_gunner_yellow_idle = assets_load_image_from_file("data/imgs/players/Yellow/Gunner_Yellow_Idle.png"); img_alien_run = assets_load_image_from_file("data/imgs/players/alien_run.png"); // Guns diff --git a/src/players.c b/src/players.c index 0f6087c..b2ebfae 100644 --- a/src/players.c +++ b/src/players.c @@ -458,6 +458,17 @@ color get_color_tint_by_player_index(int index) { return c; } +image* get_player_run_sprite_from_index(int index) { + image* imgs[] = { + img_gunner_blue_run, + img_gunner_black_run, + img_gunner_green_run, + img_gunner_yellow_run, + img_gunner_red_run, + }; + return imgs[index]; +} + void draw_player(platform_window* window, player* p, int index) { float size = get_player_size(window); map_info info = get_map_info(window); @@ -476,7 +487,7 @@ void draw_player(platform_window* window, player* p, int index) { frame = sprite_swap_frame_horizontally(frame); } - renderer->render_image_quad_partial(img_gunner_blue_run, + renderer->render_image_quad_partial(get_player_run_sprite_from_index(index), player_render_x, player_render_y, player_render_x, player_render_y + size, player_render_x + size, player_render_y + size, |
