tfv: add player select screen

This commit is contained in:
Vince Weaver 2018-07-18 00:11:55 -04:00
parent 40c1ac5cfe
commit c18d2e10e0
5 changed files with 61 additions and 2 deletions

Binary file not shown.

View File

@ -108,6 +108,9 @@ tfv_map.o: tfv_map.c
tfv_opener.o: tfv_opener.c ../tfv_utils.h
$(CC) $(CFLAGS) -c tfv_opener.c
tfv_player_select.o: tfv_player_select.c
$(CC) $(CFLAGS) -c tfv_player_select.c
tfv_random.o: tfv_random.c
$(CC) $(CFLAGS) -c tfv_random.c
@ -137,14 +140,16 @@ tfv.o: tfv.c ../gr-sim.h tfv_backgrounds.h tfv_sprites.h
tfv: tfv.o tfv_backgrounds.o tfv_battle.o tfv_credits.o tfv_dialog.o \
tfv_ending.o tfv_flying.o \
tfv_game_over.o tfv_help.o tfv_info.o tfv_map.o \
tfv_opener.o tfv_random.o tfv_sprites.o tfv_textentry.o \
tfv_opener.o tfv_player_select.o \
tfv_random.o tfv_sprites.o tfv_textentry.o \
tfv_title.o tfv_worldmap.o tfv_mapinfo.h \
$(GR_SIM)
$(CC) $(LFLAGS) $(SDL_LIBS) -o tfv tfv.o \
tfv_backgrounds.o tfv_battle.o tfv_credits.o tfv_dialog.o \
tfv_ending.o tfv_flying.o \
tfv_game_over.o tfv_help.o tfv_info.o tfv_map.o \
tfv_opener.o tfv_random.o tfv_sprites.o tfv_textentry.o \
tfv_opener.o tfv_player_select.o \
tfv_random.o tfv_sprites.o tfv_textentry.o \
tfv_title.o tfv_worldmap.o \
$(GR_SIM)

View File

@ -68,6 +68,9 @@ title_loop:
play_game:
nameo[0]=0;
/* Get player */
player_select();
/* Get Name */
name_screen();
if (nameo[0]==0) {

View File

@ -37,3 +37,5 @@ int city_map(void);
int credits(void);
int random_8(void);
int player_select(void);

View File

@ -0,0 +1,49 @@
#include <unistd.h>
#include "gr-sim.h"
#include "tfv_utils.h"
#include "tfv_zp.h"
#include "tfv_sprites.h"
int player_select(void) {
int which_player=0;
int ch,saved;
saved=ram[DRAW_PAGE];
ram[DRAW_PAGE]=8;
clear_top_a(0);
ram[DRAW_PAGE]=saved;
while(1) {
gr_copy_to_current(0xc00);
color_equals(COLOR_AQUA);
vlin(6+(which_player*16),22+(which_player*16),15);
vlin(6+(which_player*16),22+(which_player*16),22);
grsim_put_sprite(tfv_walk_right,17,8);
grsim_put_sprite(tfg_walk_right,17,24);
ram[CH]=13;
ram[CV]=21;
move_and_print("SELECT PLAYER");
page_flip();
ch=grsim_input();
if (ch==13) break;
if ((ch==APPLE_UP) || (ch==APPLE_DOWN) ||
(ch==APPLE_RIGHT) || (ch==APPLE_LEFT)) {
which_player=!which_player;
}
usleep(100000);
}
return which_player;
}