mirror of
https://gitlab.com/drummyfish/anarch.git
synced 2024-12-21 23:08:49 -05:00
Add tree
This commit is contained in:
parent
a5a0c65f2f
commit
6752748ddc
BIN
assets/item_tree.png
Normal file
BIN
assets/item_tree.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
22
images.h
22
images.h
@ -487,6 +487,28 @@ SFG_PROGRAM_MEMORY uint8_t SFG_itemSprites[][SFG_TEXTURE_STORE_SIZE] =
|
||||
0,1,67,17,166,104,136,55,34,153,34,34,37,114,16,0,0,1,52,61,54,102,104,55,34,34,
|
||||
34,34,37,114,16,0,0,0,19,67,29,221,221,245,85,85,85,85,84,84,16,0,0,0,1,52,66,
|
||||
66,66,67,51,17,19,49,17,17,16,0,0,0,0,17,17,17,17,17,17,0,1,16,0,0,0
|
||||
},
|
||||
{ // 5, tree
|
||||
175,0,5,3,4,196,20,114,2,38,115,17,22,192,37,96,0,0,0,0,0,0,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,1,17,16,0,0,0,0,0,0,0,17,22,36,0,0,0,25,
|
||||
153,145,0,0,0,0,0,0,1,36,130,36,0,0,1,153,238,81,0,0,0,0,17,17,1,34,130,36,0,0,
|
||||
1,158,229,167,16,0,0,17,153,238,17,34,130,36,0,0,17,158,85,167,16,0,0,25,85,85,
|
||||
81,34,131,36,0,1,193,229,90,125,16,1,0,1,21,85,81,34,40,68,1,17,193,229,167,113,
|
||||
0,28,16,0,1,218,81,34,72,51,1,204,204,122,119,17,1,193,0,0,25,170,161,36,130,36,
|
||||
0,17,204,103,209,241,22,16,0,1,154,173,17,40,34,36,0,0,17,204,59,179,111,16,0,0,
|
||||
29,216,129,56,98,36,0,0,0,17,22,51,177,0,0,1,102,51,49,36,134,36,0,0,0,0,1,54,
|
||||
61,17,17,28,99,51,177,34,72,52,0,17,17,0,29,214,104,255,182,198,51,187,177,34,
|
||||
36,131,1,153,145,17,204,204,198,59,204,51,59,191,241,34,40,36,1,158,87,204,195,
|
||||
60,204,204,99,51,191,17,17,34,40,36,25,149,90,115,63,220,204,99,51,191,209,85,
|
||||
81,34,36,131,25,229,90,125,241,99,220,63,17,31,182,221,81,34,72,52,30,85,167,
|
||||
113,22,61,204,241,209,1,31,99,209,36,134,36,30,90,167,209,102,251,198,29,113,0,
|
||||
1,179,49,56,98,36,1,170,125,19,63,28,49,119,16,0,1,251,49,40,34,36,0,23,209,87,
|
||||
17,28,177,17,0,0,0,31,177,36,130,36,0,1,21,167,16,22,177,0,0,0,1,145,177,34,72,
|
||||
51,0,1,90,125,16,19,16,0,0,1,25,27,49,34,40,68,0,0,17,17,0,23,16,0,0,25,229,211,
|
||||
49,34,131,36,0,0,0,0,1,153,17,0,0,1,26,173,49,34,130,36,0,0,0,0,25,238,87,16,0,
|
||||
0,1,17,17,34,130,36,0,0,0,0,30,229,167,16,0,0,0,0,1,36,130,36,0,0,0,0,30,90,125,
|
||||
16,0,0,0,0,0,17,22,36,0,0,0,0,1,167,209,0,0,0,0,0,0,0,1,17,0,0,0,0,0,17,16,0,0,
|
||||
0,0,0,0,0,0,0
|
||||
}
|
||||
};
|
||||
|
||||
|
5
levels.h
5
levels.h
@ -92,6 +92,7 @@ typedef struct
|
||||
#define SFG_LEVEL_ELEMENT_BULLETS 0x03
|
||||
#define SFG_LEVEL_ELEMENT_ROCKETS 0x04
|
||||
#define SFG_LEVEL_ELEMENT_PLASMA 0x05
|
||||
#define SFG_LEVEL_ELEMENT_TREE 0x06
|
||||
|
||||
/*
|
||||
Monsters have lower 4 bits zero and are only distinguished by the 4 upper
|
||||
@ -278,8 +279,8 @@ SFG_PROGRAM_MEMORY SFG_Level SFG_level0 =
|
||||
{SFG_LEVEL_ELEMENT_BARREL, {8, 45}}, {SFG_LEVEL_ELEMENT_BARREL, {9, 46}},
|
||||
{SFG_LEVEL_ELEMENT_ROCKETS, {4, 56}}, {SFG_LEVEL_ELEMENT_ROCKETS, {5, 56}},
|
||||
{SFG_LEVEL_ELEMENT_PLASMA, {3, 57}}, {SFG_LEVEL_ELEMENT_PLASMA, {3, 58}},
|
||||
{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_TREE, {16, 44}}, {SFG_LEVEL_ELEMENT_TREE, {16, 45}},
|
||||
{SFG_LEVEL_ELEMENT_TREE, {16, 46}}, {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}}, {SFG_LEVEL_ELEMENT_NONE, {0, 0}},
|
||||
|
9
main.c
9
main.c
@ -2885,18 +2885,23 @@ void SFG_draw()
|
||||
worldPosition.y =
|
||||
SFG_ELEMENT_COORD_TO_RCL_UNITS(e.coords[1]);
|
||||
|
||||
uint8_t size = 0;
|
||||
|
||||
if (e.type == SFG_LEVEL_ELEMENT_TREE)
|
||||
size = 2;
|
||||
|
||||
RCL_PixelInfo p =
|
||||
RCL_mapToScreen(
|
||||
worldPosition,
|
||||
SFG_floorHeightAt(e.coords[0],e.coords[1])
|
||||
+ SFG_SPRITE_SIZE_TO_HEAIGH_ABOVE_GROUND(0),
|
||||
+ SFG_SPRITE_SIZE_TO_HEAIGH_ABOVE_GROUND(size),
|
||||
SFG_player.camera);
|
||||
|
||||
if (p.depth > 0)
|
||||
{
|
||||
SFG_drawScaledSprite(SFG_itemSprites[e.type - 1],
|
||||
p.position.x * SFG_RAYCASTING_SUBSAMPLE,p.position.y,
|
||||
RCL_perspectiveScale(SFG_SPRITE_SIZE(0),p.depth),
|
||||
RCL_perspectiveScale(SFG_SPRITE_SIZE(size),p.depth),
|
||||
p.depth / (RCL_UNITS_PER_SQUARE * 2),p.depth - 1000);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user