Test animation

This commit is contained in:
Miloslav Číž 2019-10-17 21:39:13 +02:00
parent 9b85928c71
commit 7a47d4768d
3 changed files with 48 additions and 5 deletions

View File

@ -737,7 +737,7 @@ reused flipped (good for walk anims). */
SFG_PROGRAM_MEMORY uint8_t
SFG_monsterSprites[][SFG_TEXTURE_SIZE * SFG_TEXTURE_SIZE] =
{
{ // 0, idle
{ // 0, monster1 idle
175,175,175,0,0,0,0,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,
175,175,175,0,0,0,0,175,175,175,175,175,0,5,4,95,5,0,175,175,175,175,175,175,
175,175,175,175,175,175,175,175,175,175,0,6,3,5,4,0,175,175,175,0,5,0,2,2,0,5,0,
@ -775,6 +775,49 @@ SFG_PROGRAM_MEMORY uint8_t
95,4,5,0,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,0,5,3,
4,3,0,175,175,175,175,175,0,0,0,0,175,175,175,175,175,175,175,175,175,175,175,
175,175,175,175,175,175,175,0,0,0,0,175,175,175
},
{ // 1, monster1 attacking
175,175,183,183,183,1,1,1,183,22,102,175,175,175,175,175,175,175,175,175,175,
175,175,175,0,0,0,0,0,175,175,175,175,175,183,183,191,183,183,183,183,191,191,
191,175,175,175,175,175,175,175,175,175,175,175,0,6,4,4,5,4,0,0,175,175,175,175,
183,111,183,183,183,191,191,191,183,175,175,175,175,175,175,175,175,175,175,1,6,
7,6,3,4,3,3,3,0,175,175,175,183,111,31,183,31,191,191,183,175,175,175,175,175,
175,175,175,175,175,1,7,7,6,0,0,0,0,0,0,175,175,183,183,191,111,31,31,31,191,
183,183,175,1,175,175,175,175,175,175,175,1,7,7,5,4,0,175,175,175,175,175,175,
175,183,191,191,191,191,191,191,191,191,183,183,1,1,175,175,175,175,175,1,22,23,
5,10,0,175,175,175,175,175,175,175,175,183,191,191,183,183,183,183,191,191,191,
191,20,31,48,175,175,175,1,22,23,22,4,10,0,175,175,175,175,175,175,175,175,183,
183,183,183,20,183,183,183,191,191,191,22,22,5,0,175,175,1,1,1,4,10,4,3,0,0,0,0,
0,175,175,175,175,1,22,101,22,41,41,183,183,191,102,23,31,6,0,175,175,175,175,
175,1,5,3,0,3,4,5,5,4,0,175,175,175,48,20,20,101,41,20,1,31,31,22,31,22,5,4,1,
175,175,175,1,1,3,7,7,6,3,4,4,3,3,0,175,175,0,5,4,102,41,1,1,30,30,31,101,5,4,5,
1,175,175,1,7,7,6,6,5,5,3,10,10,10,0,0,175,175,175,0,0,48,101,31,31,222,31,222,
5,4,4,4,0,175,1,23,23,6,5,5,10,10,10,3,3,0,175,175,175,175,175,0,6,6,31,31,22,
222,7,6,223,4,4,4,4,0,175,0,10,3,3,10,3,3,3,3,4,3,0,175,175,175,175,0,0,0,57,57,
3,62,223,7,223,223,223,4,4,4,120,120,120,18,5,4,18,3,3,0,0,0,0,0,175,175,0,75,
74,65,67,67,145,3,4,223,223,63,62,223,4,120,1,18,3,20,1,5,4,0,0,175,175,175,175,
175,175,0,69,68,67,0,74,74,82,145,4,4,223,7,63,223,120,18,18,3,20,21,3,3,1,175,
175,175,175,175,175,175,175,0,76,75,74,0,67,67,67,145,4,4,223,7,63,223,120,18,
18,3,20,21,3,3,1,175,175,175,175,175,175,175,175,175,0,75,74,65,74,74,145,3,4,
223,223,63,62,223,4,120,1,18,3,20,1,5,4,0,0,175,175,175,175,175,175,175,175,0,0,
0,65,65,3,62,223,7,222,223,223,4,4,4,120,120,120,18,5,4,18,3,3,0,0,0,0,0,175,
175,175,0,6,6,6,6,5,223,7,31,222,222,4,4,4,0,175,1,3,3,3,10,3,3,3,3,4,3,0,175,
175,175,175,0,0,0,20,31,31,222,31,222,22,20,4,4,0,175,1,7,7,7,7,7,10,10,10,3,3,
0,175,175,175,175,0,5,4,102,41,1,1,30,30,31,101,22,4,5,1,1,175,1,22,5,6,6,7,7,3,
10,10,10,0,0,175,175,48,101,20,101,41,20,1,31,22,31,22,22,5,4,1,175,175,175,1,1,
3,5,6,6,3,4,4,3,3,0,175,183,183,22,101,22,41,183,183,183,23,23,31,31,6,0,175,
175,175,175,175,0,5,3,0,3,4,5,5,4,0,175,175,183,183,183,41,183,183,183,191,183,
183,101,22,22,5,0,175,175,1,1,1,3,10,4,3,0,0,0,0,0,175,175,175,183,191,183,183,
183,183,191,191,191,183,98,20,31,0,175,175,175,1,22,7,7,5,10,0,175,175,175,175,
175,175,175,175,183,191,191,191,191,191,191,191,183,183,1,1,48,175,175,175,175,
175,1,22,6,7,10,0,175,175,175,175,175,175,175,175,183,183,111,31,31,31,191,183,
183,1,175,1,175,175,175,175,175,175,175,1,23,7,5,4,0,175,175,175,175,175,175,
175,175,102,111,31,31,31,191,191,183,9,175,175,175,175,175,175,175,175,175,175,
1,22,6,6,0,0,0,0,0,0,175,175,175,183,183,111,111,111,191,191,191,183,175,175,
175,175,175,175,175,175,175,175,175,1,5,6,6,3,4,3,3,3,0,175,175,175,183,191,183,
183,183,191,191,191,15,175,175,175,175,175,175,175,175,175,175,175,0,5,4,4,5,4,
0,0,175,175,175,175,183,183,1,1,183,182,102,183,175,175,175,175,175,175,175,175,
175,175,175,175,175,0,0,0,0,0,175,175,175
}
};

View File

@ -237,7 +237,7 @@ SFG_PROGRAM_MEMORY SFG_Level SFG_level0 =
{SFG_LEVEL_ELEMENT_BARREL, {12, 4}}, {SFG_LEVEL_ELEMENT_BARREL, {15, 4}},
{SFG_LEVEL_ELEMENT_BARREL, {24, 10}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
{SFG_LEVEL_ELEMENT_BARREL, {13, 4}}, {SFG_LEVEL_ELEMENT_BARREL, {12, 6}},
{SFG_LEVEL_ELEMENT_MONSTER1, {15, 7}}, {SFG_LEVEL_ELEMENT_MONSTER1, {16,8}},
{SFG_LEVEL_ELEMENT_MONSTER1, {15, 7}}, {SFG_LEVEL_ELEMENT_MONSTER1, {17,9}},
{SFG_LEVEL_ELEMENT_NONE, {0, 0}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
{SFG_LEVEL_ELEMENT_NONE, {0, 0}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
{SFG_LEVEL_ELEMENT_NONE, {0, 0}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},

6
main.c
View File

@ -458,7 +458,7 @@ void SFG_initPlayer()
SFG_player.headBobFrame = 0;
SFG_player.weapon = 0;
SFG_player.weapon = 1;
}
void SFG_pixelFunc(RCL_PixelInfo *pixel)
@ -718,7 +718,7 @@ void SFG_drawScaledSprite(
#define PRECOMP_SCALE 2048
int16_t precompStepScaled = (SFG_TEXTURE_SIZE * PRECOMP_SCALE) / size;
int16_t precompStepScaled = ((SFG_TEXTURE_SIZE - 1) * PRECOMP_SCALE) / size;
int16_t precompPosScaled = precompFrom * precompStepScaled;
for (int16_t i = precompFrom; i <= precompTo; ++i)
@ -1533,7 +1533,7 @@ void SFG_draw()
SFG_player.camera);
if (p.depth > 0)
SFG_drawScaledSprite(SFG_monsterSprites[0],
SFG_drawScaledSprite(SFG_monsterSprites[ (SFG_gameFrame >> 5) & 0x01 ],
p.position.x * SFG_RAYCASTING_SUBSAMPLE,p.position.y,
RCL_perspectiveScale(SFG_GAME_RESOLUTION_Y,p.depth),
p.depth / (RCL_UNITS_PER_SQUARE * 2),p.depth);