mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-14 13:33:48 +00:00
tfv: add player select screen
This commit is contained in:
parent
40c1ac5cfe
commit
c18d2e10e0
BIN
asoft_presenter/kansasfest_2018/TB1.GR
Normal file
BIN
asoft_presenter/kansasfest_2018/TB1.GR
Normal file
Binary file not shown.
@ -108,6 +108,9 @@ tfv_map.o: tfv_map.c
|
|||||||
tfv_opener.o: tfv_opener.c ../tfv_utils.h
|
tfv_opener.o: tfv_opener.c ../tfv_utils.h
|
||||||
$(CC) $(CFLAGS) -c tfv_opener.c
|
$(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
|
tfv_random.o: tfv_random.c
|
||||||
$(CC) $(CFLAGS) -c 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: tfv.o tfv_backgrounds.o tfv_battle.o tfv_credits.o tfv_dialog.o \
|
||||||
tfv_ending.o tfv_flying.o \
|
tfv_ending.o tfv_flying.o \
|
||||||
tfv_game_over.o tfv_help.o tfv_info.o tfv_map.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 \
|
tfv_title.o tfv_worldmap.o tfv_mapinfo.h \
|
||||||
$(GR_SIM)
|
$(GR_SIM)
|
||||||
$(CC) $(LFLAGS) $(SDL_LIBS) -o tfv tfv.o \
|
$(CC) $(LFLAGS) $(SDL_LIBS) -o tfv tfv.o \
|
||||||
tfv_backgrounds.o tfv_battle.o tfv_credits.o tfv_dialog.o \
|
tfv_backgrounds.o tfv_battle.o tfv_credits.o tfv_dialog.o \
|
||||||
tfv_ending.o tfv_flying.o \
|
tfv_ending.o tfv_flying.o \
|
||||||
tfv_game_over.o tfv_help.o tfv_info.o tfv_map.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_title.o tfv_worldmap.o \
|
||||||
$(GR_SIM)
|
$(GR_SIM)
|
||||||
|
|
||||||
|
@ -68,6 +68,9 @@ title_loop:
|
|||||||
play_game:
|
play_game:
|
||||||
nameo[0]=0;
|
nameo[0]=0;
|
||||||
|
|
||||||
|
/* Get player */
|
||||||
|
player_select();
|
||||||
|
|
||||||
/* Get Name */
|
/* Get Name */
|
||||||
name_screen();
|
name_screen();
|
||||||
if (nameo[0]==0) {
|
if (nameo[0]==0) {
|
||||||
|
@ -37,3 +37,5 @@ int city_map(void);
|
|||||||
int credits(void);
|
int credits(void);
|
||||||
|
|
||||||
int random_8(void);
|
int random_8(void);
|
||||||
|
|
||||||
|
int player_select(void);
|
||||||
|
49
gr-sim/tfv/tfv_player_select.c
Normal file
49
gr-sim/tfv/tfv_player_select.c
Normal 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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user