Add machine gun

This commit is contained in:
Miloslav Číž 2019-10-24 02:03:57 +02:00
parent 5882b68f79
commit 36079bed49
3 changed files with 26 additions and 4 deletions

View File

@ -434,7 +434,26 @@ SFG_PROGRAM_MEMORY uint8_t SFG_weaponImages[][SFG_TEXTURE_STORE_SIZE] =
235,85,0,0,0,0,0,0,0,0,0,0,0,0,17,17,122,153,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,17,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
},
{ // 2, rocket launcher
{ // 2, machine gun
175,4,3,0,2,1,6,5,60,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,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,3,51,51,48,0,0,0,0,0,0,0,0,0,0,0,51,54,102,18,67,0,0,0,0,0,0,0,0,0,
3,51,100,70,97,34,69,0,0,0,0,0,0,0,0,51,54,68,102,102,18,34,69,0,0,0,0,0,0,3,51,
100,70,102,102,97,34,34,69,0,0,0,0,0,0,54,102,102,119,113,17,18,34,36,69,0,0,0,
0,0,3,113,17,17,17,17,17,18,34,36,69,0,0,0,0,51,52,17,17,17,18,34,34,34,36,85,
85,0,0,3,51,120,116,17,34,34,33,17,17,17,34,23,119,0,3,54,134,134,100,18,17,17,
17,17,17,17,34,17,23,0,3,72,40,40,132,18,17,17,17,17,17,17,34,17,17,0,3,50,66,
66,36,18,17,17,17,17,17,17,34,17,17,0,0,3,51,69,68,17,119,119,113,17,17,17,34,
17,17,0,0,0,0,51,52,17,17,17,23,119,119,114,36,85,85,0,0,0,0,0,3,33,17,17,17,17,
17,18,34,37,85,0,0,0,0,0,0,52,68,68,34,33,17,18,34,36,69,0,0,0,0,0,0,3,51,69,84,
68,68,66,34,34,69,0,0,0,0,0,0,0,0,51,52,85,68,68,34,34,69,0,0,0,0,0,0,0,0,0,3,
51,69,84,66,34,69,0,0,0,0,0,0,0,0,0,0,0,51,52,68,34,67,0,0,0,0,0,0,0,0,0,0,0,0,
3,51,51,48,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
},
{ // 3, rocket launcher
175,2,0,115,7,117,116,6,37,114,5,38,39,1,25,33,0,0,0,0,0,0,0,0,0,0,0,0,0,2,34,
32,0,0,0,0,0,0,0,0,0,0,0,2,34,42,129,18,0,0,0,0,0,0,0,0,0,0,0,39,119,168,26,18,
0,0,0,0,0,0,0,0,0,0,0,40,136,136,26,18,0,0,0,0,0,0,0,0,0,0,0,33,17,17,17,210,0,

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

9
main.c
View File

@ -109,7 +109,10 @@ void SFG_init();
#define SFG_WEAPON_KNIFE 0
#define SFG_WEAPON_SHOTGUN 1
#define SFG_WEAPON_ROCKER_LAUNCHER 2
#define SFG_WEAPON_MACHINE_GUN 2
#define SFG_WEAPON_ROCKER_LAUNCHER 3
#define SFG_WEAPONS_TOTAL 4
#define SFG_GAME_RESOLUTION_X \
(SFG_SCREEN_RESOLUTION_X / SFG_RESOLUTION_SCALEDOWN)
@ -1097,8 +1100,8 @@ void SFG_init()
void SFG_playerRotateWeapon(uint8_t next)
{
SFG_player.weapon = (SFG_player.weapon + (next * 2 - 1));
SFG_player.weapon %= 3;
SFG_player.weapon += next ? 1 : -1;
SFG_player.weapon %= SFG_WEAPONS_TOTAL;
}
/**