tfv: update graphics

This commit is contained in:
Vince Weaver 2017-07-08 17:06:43 -04:00
parent b2ac412bea
commit d0aee81022
5 changed files with 168 additions and 29 deletions

View File

@ -31,7 +31,7 @@ text.o: text.c
tfv: tfv.o gr-sim.o
$(CC) $(LFLAGS) $(SDL_LIBS) -o tfv tfv.o gr-sim.o
tfv.o: tfv.c backgrounds.h vince_sprites.h
tfv.o: tfv.c backgrounds.h tfv_sprites.h
$(CC) $(CFLAGS) -c tfv.c

View File

@ -4,7 +4,7 @@
#include "gr-sim.h"
#include "vince_sprites.h"
#include "tfv_sprites.h"
#include "backgrounds.h"
#define COLOR1 0x00
@ -80,23 +80,7 @@ static void apple_memset(char *ptr, int value, int length) {
}
int main(int argc, char **argv) {
int ch;
char tempst[BUFSIZ];
char nameo[9];
int i;
int xx,yy;
int name_x=0;
int cursor_x=0,cursor_y=0;
int direction;
grsim_init();
home();
gr();
static int opening(void) {
/* VMW splash */
@ -119,7 +103,11 @@ int main(int argc, char **argv) {
repeat_until_keypressed();
/* Title Screen */
return 0;
}
static int title(void) {
grsim_unrle(title_rle,0x800);
gr_copy(0x800,0x400);
@ -127,9 +115,22 @@ int main(int argc, char **argv) {
repeat_until_keypressed();
return 0;
}
static char nameo[9];
static int name_screen(void) {
unsigned char xx,yy,cursor_x,cursor_y,ch,name_x;
char tempst[BUFSIZ];
text();
home();
cursor_x=0; cursor_y=0; name_x=0;
/* Enter your name */
// 1 2 3
// 0123456789012345678901234567890123456789
@ -285,7 +286,15 @@ int main(int argc, char **argv) {
if (ch==27) break;
}
return 0;
}
static int flying(void) {
int i;
unsigned char ch;
int xx,yy;
int direction;
/************************************************/
/* Flying */
@ -333,6 +342,35 @@ int main(int argc, char **argv) {
usleep(10000);
}
return 0;
}
/*
Map
0 1 2 3
0 BEACH ARTIC AR/\TIC BELAIR
1 BEACH LANDING GR/\ASS FORREST
2 BEACH GRASS GR/\ASS FORREST
3 BEACH BEACH COLLEGE BEACH
*/
static int world_map(void) {
int ch;
int direction=1;
int xx,yy;
xx=20; yy=20;
/************************************************/
/* Landed */
@ -351,6 +389,7 @@ int main(int argc, char **argv) {
color_equals(0);
direction=1;
int odd=0;
grsim_unrle(worldmap_rle,0x800);
gr_copy(0x800,0x400);
@ -359,18 +398,32 @@ int main(int argc, char **argv) {
ch=grsim_input();
if ((ch=='q') || (ch==27)) break;
if ((ch=='i') || (ch==APPLE_UP)) if (yy>10) yy-=2;
if ((ch=='m') || (ch==APPLE_DOWN)) if (yy<39) yy+=2;
if ((ch=='i') || (ch==APPLE_UP)) {
if (yy>8) yy-=2;
odd=!odd;
}
if ((ch=='m') || (ch==APPLE_DOWN)) {
if (yy<27) yy+=2;
odd=!odd;
}
if ((ch=='j') || (ch==APPLE_LEFT)) {
if (direction>0) direction=-1;
if (direction>0) {
direction=-1;
odd=0;
}
else {
odd=!odd;
xx--;
if (xx<0) xx=0;
}
}
if ((ch=='k') || (ch==APPLE_RIGHT)) {
if (direction<0) direction=1;
if (direction<0) {
direction=1;
odd=0;
}
else {
odd=!odd;
xx++;
if (xx>35) xx=35;
}
@ -378,9 +431,14 @@ int main(int argc, char **argv) {
gr_copy(0x800,0x400);
if (direction==-1) grsim_put_sprite(vince_left,xx,yy);
if (direction==1) grsim_put_sprite(vince_right,xx,yy);
if (direction==-1) {
if (odd) grsim_put_sprite(tfv_walk_left,xx,yy);
else grsim_put_sprite(tfv_stand_left,xx,yy);
}
if (direction==1) {
if (odd) grsim_put_sprite(tfv_walk_right,xx,yy);
else grsim_put_sprite(tfv_stand_right,xx,yy);
}
grsim_update();
usleep(10000);
@ -389,3 +447,64 @@ int main(int argc, char **argv) {
return 0;
}
/* Do Battle */
/* Battle.
Forest? Grassland? Artic? Ocean?
|
---------------------------------------|
| HP LIMIT | -> FIGHT/LIMIT
GRUMPO | DEATER 128/255 128 | ZAP
| | REST
| | RUN AWAY
Sound effects?
List hits
****** ** **** **** ** ** ****** **** ****** ****** ******
** ** **** ** ** ** ** ** ** ** ** ** ** **
** ** ** **** **** ****** **** ****** ** ****** ******
** ** ** ** ** ** ** ** ** ** ** ** **
****** ****** ****** **** ** **** ****** ** ****** **
*/
static int do_battle(void) {
return 0;
}
int main(int argc, char **argv) {
grsim_init();
home();
gr();
/* Do Opening */
opening();
/* Title Screen */
title();
/* Get Name */
name_screen();
/* Flying */
flying();
/* World Map */
world_map();
/* Do Battle */
do_battle();
return 0;
}

View File

@ -1,4 +1,4 @@
static unsigned char vince_right[]={
static unsigned char tfv_stand_right[]={
0x4,0x6,
0x00,0xDD,0xBD,0x00,
0x00,0xDD,0xDB,0x0B,
@ -8,7 +8,17 @@ static unsigned char vince_right[]={
0x00,0x82,0x80,0x00,
};
static unsigned char vince_left[]={
static unsigned char tfv_walk_right[]={
0x4,0x6,
0x00,0xDD,0xBD,0x00,
0x00,0xDD,0xDB,0x0B,
0x00,0x22,0x00,0x00,
0x00,0x22,0x02,0xB0,
0x22,0x02,0x20,0x00,
0x82,0x00,0x82,0x00,
};
static unsigned char tfv_stand_left[]={
0x4,0x6,
0x00,0xBD,0xDD,0x00,
0x0B,0xDB,0xDD,0x00,
@ -18,6 +28,16 @@ static unsigned char vince_left[]={
0x00,0x80,0x82,0x00,
};
static unsigned char tfv_walk_left[]={
0x4,0x6,
0x00,0xBD,0xDD,0x00,
0x0B,0xDB,0xDD,0x00,
0x00,0x00,0x22,0x00,
0xB0,0x02,0x22,0x00,
0x00,0x20,0x02,0x22,
0x00,0x82,0x00,0x82,
};
#if 0
static unsigned char test_sprite[]={
0x8,0x4,

BIN
tfv/landing.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 412 B