mirror of
https://gitlab.com/drummyfish/anarch.git
synced 2024-11-25 02:12:19 -05:00
Add health kit
This commit is contained in:
parent
8b94b29388
commit
d1c092cca8
48
assets.h
48
assets.h
@ -45,7 +45,7 @@ static inline uint8_t SFG_getTexel(const uint8_t *texture, uint8_t x, uint8_t y)
|
||||
|
||||
SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
|
||||
{
|
||||
{ // 0: white wooden planks
|
||||
{ // 0, white wooden planks
|
||||
4,21,5,3,20,0,2,26,6,18,57,65,1,16,17,49,0,1,0,3,32,1,33,0,161,64,1,16,64,3,3,
|
||||
32,0,17,16,9,32,1,17,1,161,65,1,16,78,132,35,32,0,17,16,7,32,1,32,17,240,49,0,
|
||||
16,57,99,87,206,0,18,16,6,33,0,16,1,177,48,0,0,97,0,2,0,0,17,32,6,32,1,0,1,178,
|
||||
@ -65,7 +65,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
|
||||
177,49,2,16,66,64,16,3,0,1,0,7,32,1,16,1,82,64,1,16,50,0,16,35,0,1,0,9,33,2,32,
|
||||
0,161,64,1,20,48,0,0,32
|
||||
},
|
||||
{ // 1: skyscraper window
|
||||
{ // 1, skyscraper window
|
||||
4,5,3,6,2,81,0,59,48,128,138,131,66,44,137,129,16,176,208,176,44,33,0,0,1,43,1,
|
||||
13,0,32,29,0,0,176,0,0,12,64,0,17,0,32,0,17,1,32,13,11,0,176,0,208,4,65,0,0,0,
|
||||
34,1,16,1,32,16,0,23,32,0,2,40,66,2,194,230,140,34,208,2,176,17,0,119,76,66,34,
|
||||
@ -87,7 +87,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
|
||||
34,36,68,44,221,192,0,0,10,32,0,16,1,34,16,16,0,11,0,16,13,64,0,0,10,0,0,0,1,34,
|
||||
0,1,1,2,16,0,1,176,27,0,11,33,0,17,0,112,0,1,17,113,16,0
|
||||
},
|
||||
{ // 2: pink high-tech wall
|
||||
{ // 2, pink high-tech wall
|
||||
83,4,12,5,84,20,61,85,13,6,11,3,7,14,15,0,34,32,34,0,32,2,170,34,170,160,170,
|
||||
160,17,17,17,17,34,34,32,34,42,34,170,2,42,42,170,170,17,17,17,17,34,34,34,36,
|
||||
34,160,36,32,160,160,42,10,49,17,17,17,34,34,34,42,34,0,0,0,0,0,0,4,49,49,17,17,
|
||||
@ -111,7 +111,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
|
||||
125,120,116,212,68,114,60,60,57,57,34,117,136,135,135,120,132,136,136,136,136,
|
||||
71,57,57,57,153
|
||||
},
|
||||
{ // 3: partly mossy concrete wall
|
||||
{ // 3, partly mossy concrete wall
|
||||
4,3,5,36,20,37,76,12,11,19,77,130,13,35,2,0,2,0,0,80,32,0,0,1,5,37,1,64,4,25,19,
|
||||
145,0,32,96,32,0,16,48,24,115,48,65,53,48,16,113,11,2,0,0,0,0,0,0,152,3,48,49,
|
||||
48,51,19,1,17,0,32,16,48,0,16,0,8,0,0,1,67,0,23,19,17,2,0,5,48,0,16,0,24,115,65,
|
||||
@ -130,7 +130,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
|
||||
0,21,4,8,64,68,45,4,48,0,23,27,2,32,96,0,0,16,0,1,5,80,0,85,3,16,0,1,2,194,0,0,
|
||||
0,16,48,17,84,85,0,48,64,144,25,17,0,32,96,0,0,0,64,13,3,68,0,5,48,16,0,17
|
||||
},
|
||||
{ // 4: wooden chess pattern
|
||||
{ // 4, wooden chess pattern
|
||||
20,12,11,21,2,43,19,73,1,83,81,10,9,34,42,65,86,82,91,85,89,249,149,153,66,34,
|
||||
40,34,34,114,34,36,0,0,0,48,48,35,0,2,33,18,39,17,17,66,17,18,0,0,5,48,3,96,3,
|
||||
50,33,34,40,33,33,113,17,18,96,0,6,48,3,99,3,50,33,34,23,33,18,129,17,18,80,3,5,
|
||||
@ -151,7 +151,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
|
||||
65,33,20,34,17,66,17,18,3,0,52,51,51,35,48,5,65,33,20,17,17,65,18,18,3,51,54,51,
|
||||
0,35,48,5,32,80,106,0,80,101,6,2,85,85,92,86,86,160,5,82
|
||||
},
|
||||
{ // 5: red brick wall
|
||||
{ // 5, red brick wall
|
||||
13,5,6,21,93,101,4,100,11,7,19,3,106,178,0,0,33,17,22,37,48,8,33,3,54,33,64,0,1,
|
||||
20,5,70,37,0,88,37,85,88,32,64,4,17,64,0,65,20,0,70,32,51,56,37,85,8,33,0,4,17,
|
||||
83,51,81,20,96,70,32,3,52,38,51,8,33,3,4,18,83,51,81,20,85,70,38,6,4,32,51,8,33,
|
||||
@ -172,7 +172,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
|
||||
17,37,51,6,35,3,4,17,212,4,33,3,51,98,1,0,1,36,3,6,35,3,52,18,34,34,33,3,48,177,
|
||||
34,153,146,36,51,54,33,3,52,34,49,17,33,3,48,98,70,102,17,36,0,6
|
||||
},
|
||||
{ // 6: grass-covered concrete wall, tiles with skyscraper window
|
||||
{ // 6, grass-covered concrete wall, tiles with skyscraper window
|
||||
36,37,43,35,4,3,107,34,131,50,42,5,106,110,114,26,3,131,51,128,58,52,0,5,84,56,
|
||||
84,2,0,48,66,0,48,128,5,5,10,112,0,68,0,48,85,68,4,144,32,1,6,32,17,0,7,116,80,
|
||||
0,85,153,36,13,0,1,0,0,16,1,1,0,54,115,3,160,110,234,55,1,208,40,1,0,170,96,0,
|
||||
@ -191,7 +191,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
|
||||
32,167,51,63,62,172,151,113,0,0,2,0,1,17,48,16,16,48,69,4,51,64,64,0,16,8,96,27,
|
||||
16,16,16,62,57,149,0,4,51,0,1,4,7,80,2,0,17,1,51,8,52,0,68,0,32,0,4,68,36,16,32
|
||||
},
|
||||
{ // 7: steel door
|
||||
{ // 7, steel door
|
||||
4,80,3,17,5,59,6,69,58,50,60,2,68,74,70,67,1,17,17,17,17,17,17,17,17,17,17,17,
|
||||
17,17,17,17,22,102,70,102,70,102,70,102,70,100,102,100,102,100,102,97,16,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,1,16,0,32,0,32,0,32,0,32,2,0,2,0,2,0,1,19,189,187,221,189,
|
||||
@ -213,7 +213,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
|
||||
102,70,102,70,102,70,100,102,100,102,97,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,0,
|
||||
32,0,32,0,32,0,32,0,32,2,0,2,0,1,1,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17
|
||||
},
|
||||
{ // 8: white skull on blue
|
||||
{ // 8, white skull on blue
|
||||
6,5,4,59,60,62,218,14,3,13,85,139,74,63,12,15,17,17,17,17,17,18,147,69,72,17,17,
|
||||
17,17,17,17,17,16,16,1,1,16,18,35,51,50,17,1,1,16,16,1,17,16,0,0,0,0,18,36,99,
|
||||
82,16,16,0,0,0,0,17,0,0,0,0,0,18,37,51,82,17,0,0,0,0,0,1,16,0,0,0,0,18,35,179,
|
||||
@ -234,7 +234,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
|
||||
16,0,0,0,0,18,36,99,50,16,16,0,0,0,0,17,16,16,1,1,16,18,35,68,50,17,16,16,16,16,
|
||||
1,17,17,17,17,17,17,18,148,85,88,17,17,17,17,17,17,17
|
||||
},
|
||||
{ // 9: red lava with stones
|
||||
{ // 9, red lava with stones
|
||||
3,4,12,11,83,94,102,92,91,14,93,15,19,20,100,0,3,82,2,83,32,67,84,1,17,17,16,5,
|
||||
32,17,20,0,2,48,0,67,117,118,36,0,33,33,0,5,33,17,17,19,69,64,17,20,67,86,82,36,
|
||||
17,1,0,53,1,17,17,64,56,1,17,17,0,130,50,117,131,64,4,39,0,17,17,0,32,1,17,17,3,
|
||||
@ -255,7 +255,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
|
||||
1,17,64,39,51,69,85,117,53,156,65,1,18,50,38,36,17,17,16,34,0,0,20,67,102,101,
|
||||
115,51,51,130,101,101,32,17,4,84,1,17,33,16,38,148,19,56,56
|
||||
},
|
||||
{ // 10: transparent window
|
||||
{ // 10, transparent window
|
||||
4,175,5,3,59,49,13,60,74,61,50,83,2,12,69,52,2,0,0,2,0,6,0,0,2,0,0,0,0,34,34,0,
|
||||
96,51,160,0,0,0,0,0,0,0,0,10,0,34,98,32,0,3,51,51,51,51,51,51,51,51,51,51,160,
|
||||
34,32,0,0,3,10,85,85,85,85,85,85,85,85,160,32,34,34,32,0,3,49,17,17,17,23,64,17,
|
||||
@ -276,7 +276,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
|
||||
85,85,85,85,85,162,32,38,0,0,32,0,51,34,34,34,34,34,34,34,34,34,48,34,0,0,0,3,
|
||||
162,34,34,34,34,34,34,34,34,42,0,2,96,6,0,0,0,0,0,2,0,0,0,0,96,0,0,34,34,2
|
||||
},
|
||||
{ // 11: broken grey brick wall with transparency
|
||||
{ // 11, broken grey brick wall with transparency
|
||||
4,5,3,175,13,100,20,99,19,21,6,18,12,98,177,168,17,4,16,4,18,33,0,16,0,0,0,17,0,
|
||||
4,16,18,16,1,16,1,0,42,17,65,192,1,12,28,0,17,4,2,16,16,0,16,16,10,16,17,1,0,2,
|
||||
169,16,0,0,0,16,1,4,17,1,33,16,16,4,0,2,16,65,1,1,0,16,64,17,12,17,10,0,1,0,16,
|
||||
@ -298,7 +298,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
|
||||
250,101,85,85,26,0,0,0,16,2,16,2,2,1,2,51,53,150,85,88,42,0,2,0,2,2,16,34,34,34,
|
||||
34,51,251,185,103,221,33,2,0,0,32,2,17,17,17,17,17
|
||||
},
|
||||
{ // 12: gray square-tiled wall
|
||||
{ // 12, gray square-tiled wall
|
||||
4,5,3,13,50,6,12,21,85,20,14,11,19,22,84,0,17,17,17,17,17,17,17,18,17,17,17,17,
|
||||
17,17,17,20,17,3,16,8,17,16,0,18,17,16,1,1,0,3,16,18,16,1,16,1,0,49,17,48,17,1,
|
||||
3,6,0,17,3,2,16,16,0,16,16,24,16,16,17,0,0,23,16,0,0,2,16,1,3,17,1,16,16,18,19,
|
||||
@ -322,7 +322,7 @@ SFG_PROGRAM_MEMORY uint8_t SFG_wallTextures[][SFG_TEXTURE_STORE_SIZE] =
|
||||
|
||||
SFG_PROGRAM_MEMORY uint8_t SFG_itemSprites[][SFG_TEXTURE_STORE_SIZE] =
|
||||
{
|
||||
{ // 0: barrel
|
||||
{ // 0, barrel
|
||||
175,6,84,15,11,19,13,7,176,22,2,0,5,20,83,93,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,0,0,0,0,0,0,8,
|
||||
128,0,0,0,0,0,0,136,136,136,139,139,139,187,187,139,139,187,184,187,187,139,136,
|
||||
@ -344,6 +344,26 @@ SFG_PROGRAM_MEMORY uint8_t SFG_itemSprites[][SFG_TEXTURE_STORE_SIZE] =
|
||||
40,130,68,111,246,98,102,18,97,34,146,34,34,34,34,34,40,130,0,0,0,0,0,0,2,32,0,
|
||||
0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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, health
|
||||
175,7,73,6,174,5,69,4,71,53,3,93,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,34,34,32,0,2,34,34,32,0,0,0,0,0,0,0,2,17,17,18,34,33,17,17,
|
||||
18,0,0,0,0,0,0,0,33,19,51,49,17,19,51,51,53,32,0,0,0,0,0,2,17,54,102,102,102,
|
||||
102,102,102,51,162,0,0,0,0,0,2,85,102,89,89,89,89,89,86,101,162,0,0,0,0,0,2,85,
|
||||
101,149,149,149,149,149,148,101,162,0,0,0,0,0,34,19,129,17,17,17,17,17,52,131,
|
||||
114,0,0,0,0,2,90,19,131,17,17,17,17,17,20,131,114,0,0,0,0,2,42,19,129,20,68,68,
|
||||
68,177,52,131,114,0,0,0,0,2,2,19,131,20,68,68,68,177,20,133,114,0,0,0,0,2,2,161,
|
||||
129,49,49,75,17,49,52,135,32,0,0,0,0,2,0,33,131,19,17,75,19,19,20,135,32,0,0,0,
|
||||
0,2,0,33,129,49,49,75,17,49,52,135,32,0,0,0,0,2,2,161,131,19,17,75,19,19,20,135,
|
||||
32,0,0,0,0,2,2,19,129,20,68,68,68,177,52,133,114,0,0,0,0,2,42,19,131,20,68,68,
|
||||
68,177,20,131,114,0,0,0,0,2,90,19,129,17,17,17,17,17,52,131,114,0,0,0,0,0,34,19,
|
||||
131,17,17,17,17,17,20,131,114,0,0,0,0,0,2,85,105,89,89,89,89,89,84,101,162,0,0,
|
||||
0,0,0,2,85,102,149,149,149,149,149,150,101,162,0,0,0,0,0,2,19,54,102,102,102,
|
||||
102,102,102,53,114,0,0,0,0,0,0,37,51,51,87,119,117,51,51,87,32,0,0,0,0,0,0,2,
|
||||
119,119,114,34,39,119,119,114,0,0,0,0,0,0,0,0,34,34,32,0,2,34,34,32,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
}
|
||||
};
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 670 B |
10
levels.h
10
levels.h
@ -88,9 +88,11 @@ typedef struct
|
||||
*/
|
||||
#define SFG_LEVEL_ELEMENT_NONE 255
|
||||
#define SFG_LEVEL_ELEMENT_BARREL 0x01
|
||||
/* Monsters have lower 4 bits zero and are only distinguished by the 4 upper
|
||||
bits, as this is convenient for the code.
|
||||
*/
|
||||
#define SFG_LEVEL_ELEMENT_HEALTH 0x02
|
||||
|
||||
/* Monsters have lower 4 bits zero and are only distinguished by the 4 upper
|
||||
bits, as this is convenient for the code.
|
||||
*/
|
||||
#define SFG_LEVEL_ELEMENT_MONSTER_SPIDER 0x00
|
||||
|
||||
typedef struct
|
||||
@ -237,7 +239,7 @@ SFG_PROGRAM_MEMORY SFG_Level SFG_level0 =
|
||||
32, // ceilingColor
|
||||
{ // elements
|
||||
{SFG_LEVEL_ELEMENT_BARREL, {9, 1}}, {SFG_LEVEL_ELEMENT_BARREL, {9, 13}},
|
||||
{SFG_LEVEL_ELEMENT_BARREL, {12, 4}}, {SFG_LEVEL_ELEMENT_BARREL, {15, 4}},
|
||||
{SFG_LEVEL_ELEMENT_HEALTH, {12, 4}}, {SFG_LEVEL_ELEMENT_HEALTH, {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_MONSTER_SPIDER, {15, 7}}, {SFG_LEVEL_ELEMENT_MONSTER_SPIDER, {16, 8}},
|
||||
|
8
main.c
8
main.c
@ -1026,7 +1026,8 @@ void SFG_setAndInitLevel(const SFG_Level *level)
|
||||
switch (e->elementType)
|
||||
{
|
||||
case SFG_LEVEL_ELEMENT_BARREL:
|
||||
SFG_LOG("adding barrel");
|
||||
case SFG_LEVEL_ELEMENT_HEALTH:
|
||||
SFG_LOG("adding item");
|
||||
SFG_currentLevel.itemRecords[SFG_currentLevel.itemRecordCount] = i;
|
||||
SFG_currentLevel.itemRecordCount++;
|
||||
break;
|
||||
@ -2246,11 +2247,12 @@ void SFG_draw()
|
||||
RCL_PixelInfo p =
|
||||
RCL_mapToScreen(
|
||||
worldPosition,
|
||||
SFG_floorHeightAt(e.coords[0],e.coords[1]) + RCL_UNITS_PER_SQUARE / 2,
|
||||
SFG_floorHeightAt(e.coords[0],e.coords[1])
|
||||
+ RCL_UNITS_PER_SQUARE / 2,
|
||||
SFG_player.camera);
|
||||
|
||||
if (p.depth > 0)
|
||||
SFG_drawScaledSprite(SFG_itemSprites[0],
|
||||
SFG_drawScaledSprite(SFG_itemSprites[e.elementType - 1],
|
||||
p.position.x * SFG_RAYCASTING_SUBSAMPLE,p.position.y,
|
||||
RCL_perspectiveScale(SFG_GAME_RESOLUTION_Y / 2,p.depth),
|
||||
p.depth / (RCL_UNITS_PER_SQUARE * 2),p.depth);
|
||||
|
Loading…
Reference in New Issue
Block a user