+PRSBACW2@42
xy=48,96
wh=24,32
+
+# begin animation list section. must come after sprite sheet
+*animation
+
+# Chikyuu, forward, standing and walking animation cycles
++PRSBFCW_STANDING@10
+sprite=PRSBFCW1
+
++PRSBFCW_WALKING@11
+sprite=PRSBFCW0
+delay=3
+-newframe
+sprite=PRSBFCW1
+delay=3
+event=@100 # in this example, signal the game engine the frame is one that can immediately transition to "standing"
+-newframe
+sprite=PRSBFCW2
+delay=3
+-newframe
+sprite=PRSBFCW1
+delay=3
+event=@100 # in this example, signal the game engine the frame is one that can immediately transition to "standing"
+
+# Chikyuu, left, standing and walking animation cycles
++PRSBLCW_STANDING@20
+sprite=PRSBLCW1
+
++PRSBLCW_WALKING@21
+sprite=PRSBLCW0
+delay=3
+-newframe
+sprite=PRSBLCW1
+delay=3
+event=@100 # in this example, signal the game engine the frame is one that can immediately transition to "standing"
+-newframe
+sprite=PRSBLCW2
+delay=3
+-newframe
+sprite=PRSBLCW1
+delay=3
+event=@100 # in this example, signal the game engine the frame is one that can immediately transition to "standing"
+
+# Chikyuu, right, standing and walking animation cycles
++PRSBRCW_STANDING@30
+sprite=PRSBRCW1
+
++PRSBRCW_WALKING@31
+sprite=PRSBRCW0
+delay=3
+-newframe
+sprite=PRSBRCW1
+delay=3
+event=@100 # in this example, signal the game engine the frame is one that can immediately transition to "standing"
+-newframe
+sprite=PRSBRCW2
+delay=3
+-newframe
+sprite=PRSBRCW1
+delay=3
+event=@100 # in this example, signal the game engine the frame is one that can immediately transition to "standing"
+
+# Chikyuu, away, standing and walking animation cycles
++PRSBACW_STANDING@40
+sprite=PRSBACW1
+
++PRSBACW_WALKING@41
+sprite=PRSBACW0
+delay=3
+-newframe
+sprite=PRSBACW1
+delay=3
+event=@100 # in this example, signal the game engine the frame is one that can immediately transition to "standing"
+-newframe
+sprite=PRSBACW2
+delay=3
+-newframe
+sprite=PRSBACW1
+delay=3
+event=@100 # in this example, signal the game engine the frame is one that can immediately transition to "standing"
+
enti->spt=(TILEWH/(enti->speed)); //speed per tile wwww\r
enti->invq=1;\r
enti->pred = enti->d;\r
+ enti->overdraww=0;\r
+ enti->overdrawh=4;\r
}\r
\r
//init player!\r
#define VMEMPAGEDATA2 GVARVIDEO->page[2].data\r
unsigned int i,o,o2; int j;\r
int x,y,rx,ry,w,h;\r
- int overdraww = 0, overdrawh = 4; // how many pixels to "overdraw" so that moving sprites with edge pixels don't leave streaks.\r
- // if the sprite's edge pixels are clear anyway, you can set this to 0.\r
+\r
VGA_RAM_PTR omemptr;\r
\r
// Depending on delay, update indices\r
\r
// render box bounds. y does not need modification, but x and width must be multiple of 4\r
if(!GVARVIDEO->rss){\r
- if (x >= overdraww) rx = (x - overdraww) & (~3);\r
+ if (x >= enti->overdraww) rx = (x - enti->overdraww) & (~3);\r
else rx = -(GVARVIDEO->page[0].dx);\r
- if (y >= overdrawh) ry = (y - overdrawh);\r
+ if (y >= enti->overdrawh) ry = (y - enti->overdrawh);\r
else ry = -(GVARVIDEO->page[0].dy);\r
- h = enti->spri->sprite_vrl_cont->vrl_header->height + overdrawh + y - ry;\r
- w = (x + enti->spri->sprite_vrl_cont->vrl_header->width + (overdraww*2) + 3 - rx) & (~3) - overdraww;//round up\r
+ h = enti->spri->sprite_vrl_cont->vrl_header->height + enti->overdrawh + y - ry;\r
+ w = (x + enti->spri->sprite_vrl_cont->vrl_header->width + (enti->overdraww*2) + 3 - rx) & (~3) - enti->overdraww;//round up\r
if ((rx+w) > GVARVIDEO->page[0].width) w = GVARVIDEO->page[0].width-rx;\r
if ((ry+h) > GVARVIDEO->page[0].height) h = GVARVIDEO->page[0].height-ry;\r
\r
word spt; //speed per tile\r
struct sprite *spri; // sprite used by entity\r
sword hp; //hitpoints of the entity\r
+ nibble overdraww, overdrawh; // how many pixels to "overdraw" so that moving sprites with edge pixels don't leave streaks.\r
+ // if the sprite's edge pixels are clear anyway, you can set this to 0.\r
int persist_aniframe; // gonna be increased to 1 before being used, so 0 is ok for default\r
} entity_t;\r
\r
byte *ptr;\r
memptr pal;\r
\r
+bitmap_t *ptmpdata;\r
+\r
void main(int argc, char *argv[])\r
{\r
static global_game_variables_t gvar;\r
}\r
FUNCTIONKEYFUNCTIONS;\r
if(IN_KeyDown(sc_L)){ modexClearRegion(&gvar.video.page[0], player[0].enti.x, player[0].enti.y, 16, 16, 1); }\r
+ if(IN_KeyDown(sc_J)){ read_vrs(&gvar, "data/spri/ptmp.vrs", player[0].enti.spri->spritesheet); *ptmpdata = bitmapLoadPcx("data/ptmp.pcx", &gvar); modexPalUpdate1(ptmpdata->palette); }\r
+ if(IN_KeyDown(sc_K)){ read_vrs(&gvar, "data/spri/chikyuu.vrs", player[0].enti.spri->spritesheet); PCXBMP = bitmapLoadPcx("data/chikyuu.pcx", &gvar); modexPalUpdate1(&PCXBMP->palette); }\r
\r
//9\r
#ifdef FADE\r