mirror of
https://gitlab.com/drummyfish/anarch.git
synced 2024-11-21 00:15:04 -05:00
Add plasma sprite
This commit is contained in:
parent
efc467b77c
commit
e608a2c548
19
assets.h
19
assets.h
@ -542,6 +542,25 @@ SFG_PROGRAM_MEMORY uint8_t SFG_effectSprites[][SFG_TEXTURE_STORE_SIZE] =
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0
|
||||
},
|
||||
{ // 2, plasma
|
||||
175,199,126,213,198,215,118,46,125,204,124,134,45,117,135,116,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,1,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,68,16,0,0,0,0,0,0,0,0,0,0,16,
|
||||
1,17,20,17,16,16,16,0,0,0,0,0,0,0,17,18,7,113,20,17,119,1,1,0,0,0,0,0,0,1,17,65,
|
||||
16,34,67,50,33,17,16,0,0,0,0,0,0,1,36,34,1,19,153,51,33,65,0,0,0,0,0,0,0,14,37,
|
||||
34,32,51,57,163,35,50,16,0,0,0,0,0,0,114,37,82,2,17,51,170,51,34,17,0,0,0,0,0,0,
|
||||
18,51,83,34,17,3,152,138,43,178,16,0,0,0,0,1,20,34,52,83,163,32,123,136,199,34,
|
||||
17,0,0,0,0,1,17,18,35,51,51,34,18,34,194,36,68,0,0,0,0,0,17,17,104,109,250,51,
|
||||
18,34,34,51,17,0,0,0,0,1,7,113,34,134,136,34,211,70,34,131,17,0,0,0,0,0,16,34,
|
||||
34,134,34,34,97,17,102,98,16,0,0,0,0,0,1,18,85,84,17,98,97,33,22,98,1,0,0,0,0,1,
|
||||
17,37,83,242,68,70,18,146,33,23,16,0,0,0,0,1,50,53,35,134,133,65,39,185,37,17,1,
|
||||
0,0,0,0,0,19,147,34,136,51,81,39,190,36,65,32,0,0,0,0,0,17,18,34,131,34,83,39,0,
|
||||
35,34,32,0,0,0,0,1,1,17,34,34,34,57,50,114,49,34,0,0,0,0,0,0,16,17,34,34,83,147,
|
||||
67,33,64,0,0,0,0,0,0,0,1,2,33,35,81,17,68,68,65,0,0,0,0,0,0,0,0,2,33,21,17,17,
|
||||
17,17,16,0,0,0,0,0,0,0,0,0,0,20,65,0,1,17,0,0,0,0,0,0,0,0,0,0,0,1,65,16,0,16,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
}
|
||||
};
|
||||
|
||||
|
BIN
assets/effect_plasma.png
Normal file
BIN
assets/effect_plasma.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 864 B |
16
main.c
16
main.c
@ -328,6 +328,7 @@ typedef struct
|
||||
|
||||
#define SFG_PROJECTILE_EXPLOSION 0
|
||||
#define SFG_PROJECTILE_FIREBALL 1
|
||||
#define SFG_PROJECTILE_PLASMA 2
|
||||
|
||||
#define SFG_EXPLOSION_DURATION_DOUBLE_FRAMES \
|
||||
(SFG_EXPLOSION_DURATION / SFG_MS_PER_FRAME)
|
||||
@ -1569,9 +1570,11 @@ void SFG_gameStep()
|
||||
{
|
||||
// fire
|
||||
|
||||
if (SFG_player.weapon == SFG_WEAPON_ROCKER_LAUNCHER)
|
||||
if (SFG_player.weapon == SFG_WEAPON_ROCKER_LAUNCHER ||
|
||||
SFG_player.weapon == SFG_WEAPON_PLASMAGUN)
|
||||
SFG_launchProjectile(
|
||||
SFG_PROJECTILE_FIREBALL,
|
||||
SFG_player.weapon == SFG_WEAPON_ROCKER_LAUNCHER ?
|
||||
SFG_PROJECTILE_FIREBALL : SFG_PROJECTILE_PLASMA,
|
||||
SFG_player.camera.position,
|
||||
SFG_player.camera.height,
|
||||
RCL_angleToDirection(SFG_player.camera.direction),
|
||||
@ -2324,8 +2327,11 @@ void SFG_drawWeapon(int16_t bobOffset)
|
||||
bobOffset +=
|
||||
((animationLength - shotAnimationFrame) * SFG_WEAPON_IMAGE_SCALE * 20)
|
||||
/ animationLength;
|
||||
|
||||
if (shotAnimationFrame < animationLength / 2)
|
||||
|
||||
if (
|
||||
SFG_player.weapon != SFG_WEAPON_KNIFE &&
|
||||
SFG_player.weapon != SFG_WEAPON_PLASMAGUN &&
|
||||
shotAnimationFrame < animationLength / 2)
|
||||
SFG_blitImage(SFG_effectSprites[0],
|
||||
SFG_WEAPON_IMAGE_POSITION_X,
|
||||
SFG_WEAPON_IMAGE_POSITION_Y - (SFG_TEXTURE_SIZE / 3) * SFG_WEAPON_IMAGE_SCALE + bobOffset,
|
||||
@ -2460,7 +2466,7 @@ void SFG_draw()
|
||||
RCL_mapToScreen(worldPosition,proj->position[2],SFG_player.camera);
|
||||
|
||||
const uint8_t *s =
|
||||
SFG_effectSprites[proj->type == SFG_PROJECTILE_FIREBALL ? 1 : 0];
|
||||
SFG_effectSprites[proj->type];
|
||||
|
||||
int16_t spriteSize = SFG_GAME_RESOLUTION_Y / 3;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user