diff --git a/!TheEsc/!MapEdit,ff8 b/!TheEsc/!MapEdit,ff8 index dc8328e..2365393 100644 Binary files a/!TheEsc/!MapEdit,ff8 and b/!TheEsc/!MapEdit,ff8 differ diff --git a/!TheEsc/!RunImage,ff8 b/!TheEsc/!RunImage,ff8 index 72b0aa0..d7cdaa5 100644 Binary files a/!TheEsc/!RunImage,ff8 and b/!TheEsc/!RunImage,ff8 differ diff --git a/!TheEsc/Makefile,fe1 b/!TheEsc/Makefile,fe1 index b3839e8..59a8bca 100644 --- a/!TheEsc/Makefile,fe1 +++ b/!TheEsc/Makefile,fe1 @@ -40,14 +40,18 @@ Squeezeflags = -o $@ # Dynamic dependencies: -o.Graphics: c.Graphics -o.Graphics: C:h.swis -o.Graphics: C:h.kernel -o.Graphics: C:h.kernel o.Input: c.Input o.Input: C:h.swis o.Input: C:h.kernel o.Input: C:h.kernel +o.Graphics: c.Graphics +o.Graphics: C:h.swis +o.Graphics: C:h.kernel +o.Graphics: C:h.kernel +o.Graphics: c.Graphics +o.Graphics: C:h.swis +o.Graphics: C:h.kernel +o.Graphics: C:h.kernel o.CTheEscape: c.CTheEscape o.CTheEscape: C:h.swis o.CTheEscape: C:h.kernel diff --git a/!TheEsc/Spr,ff9 b/!TheEsc/Spr,ff9 index e782cf4..a63a304 100644 Binary files a/!TheEsc/Spr,ff9 and b/!TheEsc/Spr,ff9 differ diff --git a/!TheEsc/c/Graphics b/!TheEsc/c/Graphics index 1518a54..8861e1c 100644 --- a/!TheEsc/c/Graphics +++ b/!TheEsc/c/Graphics @@ -139,6 +139,42 @@ void draw_sprite(char* spritename,int x, int y) _kernel_swi(OS_SpriteOp,&inreg,&outreg); } +void draw_sprite_flippedh(char* spritename,int x, int y) +{ + // SpriteOp 32 + inreg.r[0] = 256+33; + inreg.r[1] = (int) buffer; + inreg.r[2] = (int) spritename; + _kernel_swi(OS_SpriteOp,&inreg,&outreg); + + draw_sprite(spritename,x,y); + + // SpriteOp 32 + inreg.r[0] = 256+33; + inreg.r[1] = (int) buffer; + inreg.r[2] = (int) spritename; + _kernel_swi(OS_SpriteOp,&inreg,&outreg); + +} + +void draw_sprite_flippedv(char* spritename,int x, int y) +{ + // SpriteOp 47 + inreg.r[0] = 256+47; + inreg.r[1] = (int) buffer; + inreg.r[2] = (int) spritename; + _kernel_swi(OS_SpriteOp,&inreg,&outreg); + + draw_sprite(spritename,x,y); + + // SpriteOp 47 + inreg.r[0] = 256+47; + inreg.r[1] = (int) buffer; + inreg.r[2] = (int) spritename; + _kernel_swi(OS_SpriteOp,&inreg,&outreg); + +} + void draw_letter(char* spritename,int x, int y) { // SpriteOp 34 to put sprite at a location diff --git a/!TheEsc/c/Mission2 b/!TheEsc/c/Mission2 index cb9798f..37c1baf 100644 --- a/!TheEsc/c/Mission2 +++ b/!TheEsc/c/Mission2 @@ -37,6 +37,11 @@ struct Area_s { struct Area_s Areas[AREAS]; +#define DIRECTION_DOWN 0 +#define DIRECTION_UP 1 +#define DIRECTION_LEFT 2 +#define DIRECTION_RIGHT 3 + struct TilePlayer_s { struct EntityLocation_s location; struct EntityLocation_s lastlocation; @@ -48,6 +53,7 @@ struct TilePlayer_s { struct EntityLocation_s lastmapoffset; struct EntityLocation_s localtile; int rawtile; + unsigned char direction; }; struct TilePlayer_s TilePlayer; @@ -270,6 +276,8 @@ void game2_setup() TilePlayer.drawbox_tr.X = 80; TilePlayer.drawbox_tr.Y = 80; + TilePlayer.direction = DIRECTION_DOWN; + memset(map[0],0xFF,100); memset(map[1],0xFF,100); memset(map[2],0xFF,100); @@ -329,6 +337,7 @@ void game2_tick_input() game2_fillmap(TilePlayer.mapoffset.X,TilePlayer.mapoffset.Y); } movedy = 1; + TilePlayer.direction = DIRECTION_UP; } else if(input_readkey(41))// Down arrow { @@ -344,6 +353,7 @@ void game2_tick_input() TilePlayer.location.Y = TilePlayer.lastlocation.Y; } } + TilePlayer.direction = DIRECTION_DOWN; movedy = 1; } @@ -373,6 +383,7 @@ void game2_tick_input() TilePlayer.mapoffset.X += 10; game2_fillmap(TilePlayer.mapoffset.X,TilePlayer.mapoffset.Y); } + TilePlayer.direction = DIRECTION_RIGHT; } else if(input_readkey(25))// Left arrow { @@ -388,6 +399,7 @@ void game2_tick_input() TilePlayer.location.X = TilePlayer.lastlocation.X; } } + TilePlayer.direction = DIRECTION_LEFT; } if(game2_check_collide()) @@ -475,7 +487,22 @@ int game2_tick() game2_tick_input(); - draw_sprite("man",TilePlayer.location.X,TilePlayer.location.Y); + if(TilePlayer.direction == DIRECTION_DOWN) + { + draw_sprite("man",TilePlayer.location.X,TilePlayer.location.Y); + } + else if(TilePlayer.direction == DIRECTION_UP) + { + draw_sprite_flippedh("man",TilePlayer.location.X,TilePlayer.location.Y); + } + else if(TilePlayer.direction == DIRECTION_RIGHT) + { + draw_sprite("manrot",TilePlayer.location.X,TilePlayer.location.Y); + } + else if(TilePlayer.direction == DIRECTION_LEFT) + { + draw_sprite_flippedv("manrot",TilePlayer.location.X,TilePlayer.location.Y); + } #ifdef M2_DEBUG_HITBOXES draw_rectangle(