Add Footsteps on Sand
This commit is contained in:
parent
fff8d1ee45
commit
7eb2832f9b
4 changed files with 20 additions and 10 deletions
BIN
data/icons2.png
BIN
data/icons2.png
Binary file not shown.
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
@ -720,6 +720,9 @@ void tickTile(int x, int y){
|
||||||
if(getTile(x,y+1)==TILE_DIRT) if((rand()%25) == 0) setTile(TILE_GRASS,x,y+1);
|
if(getTile(x,y+1)==TILE_DIRT) if((rand()%25) == 0) setTile(TILE_GRASS,x,y+1);
|
||||||
if(getTile(x,y-1)==TILE_DIRT) if((rand()%25) == 0) setTile(TILE_GRASS,x,y-1);
|
if(getTile(x,y-1)==TILE_DIRT) if((rand()%25) == 0) setTile(TILE_GRASS,x,y-1);
|
||||||
break;
|
break;
|
||||||
|
case TILE_SAND:
|
||||||
|
if(data > 0) setData(--data,x,y);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1324,6 +1327,9 @@ void entityTileInteract(Entity*e, int tile, int x, int y){
|
||||||
if(rand()%20 == 0)setTile(TILE_DIRT,x,y);
|
if(rand()%20 == 0)setTile(TILE_DIRT,x,y);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
case TILE_SAND:
|
||||||
|
setData(10,x,y);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -418,7 +418,7 @@ void checkSurrTiles4(int xt, int yt, int id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 tData = 0;
|
u8 tData = 0;
|
||||||
void renderTile(int i, int x, int y) {
|
void renderTile(int i, int d, int x, int y) {
|
||||||
int age = 0;
|
int age = 0;
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case TILE_GRASS:
|
case TILE_GRASS:
|
||||||
|
@ -430,7 +430,7 @@ void renderTile(int i, int x, int y) {
|
||||||
renderConnectedTile4(x, y, 112, 16, grassColor);
|
renderConnectedTile4(x, y, 112, 16, grassColor);
|
||||||
break;
|
break;
|
||||||
case TILE_TREE:
|
case TILE_TREE:
|
||||||
renderTile(TILE_GRASS, x, y);
|
renderTile(TILE_GRASS, 0, x, y);
|
||||||
|
|
||||||
checkSurrTiles8(x >> 4, y >> 4, TILE_TREE);
|
checkSurrTiles8(x >> 4, y >> 4, TILE_TREE);
|
||||||
|
|
||||||
|
@ -460,6 +460,10 @@ void renderTile(int i, int x, int y) {
|
||||||
checkSurrTiles4(x >> 4, y >> 4, TILE_SAPLING_CACTUS);
|
checkSurrTiles4(x >> 4, y >> 4, TILE_SAPLING_CACTUS);
|
||||||
|
|
||||||
renderConnectedTile4(x, y, 112, 16, sandColor);
|
renderConnectedTile4(x, y, 112, 16, sandColor);
|
||||||
|
|
||||||
|
if (d > 0) {
|
||||||
|
render16b(x, y, 128, 0, 0, sandColor);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case TILE_WATER:
|
case TILE_WATER:
|
||||||
checkSurrTiles4(x >> 4, y >> 4, TILE_WATER);
|
checkSurrTiles4(x >> 4, y >> 4, TILE_WATER);
|
||||||
|
@ -487,16 +491,16 @@ void renderTile(int i, int x, int y) {
|
||||||
renderConnectedTile4(x, y, 176, 16, 0xFF383838);
|
renderConnectedTile4(x, y, 176, 16, 0xFF383838);
|
||||||
break;
|
break;
|
||||||
case TILE_CACTUS:
|
case TILE_CACTUS:
|
||||||
renderTile(TILE_SAND, x, y);
|
renderTile(TILE_SAND, 0, x, y);
|
||||||
render16(x, y, 48, 0, 0);
|
render16(x, y, 48, 0, 0);
|
||||||
break;
|
break;
|
||||||
case TILE_FLOWER:
|
case TILE_FLOWER:
|
||||||
renderTile(TILE_GRASS, x, y);
|
renderTile(TILE_GRASS, 0, x, y);
|
||||||
render16(x, y, 64, 0, getData(x >> 4, y >> 4));
|
render16(x, y, 64, 0, getData(x >> 4, y >> 4));
|
||||||
break;
|
break;
|
||||||
case TILE_STAIRS_DOWN:
|
case TILE_STAIRS_DOWN:
|
||||||
if (currentLevel == 0)
|
if (currentLevel == 0)
|
||||||
renderTile(TILE_CLOUD, x, y);
|
renderTile(TILE_CLOUD, 0, x, y);
|
||||||
render16(x, y, 96, 0, 0);
|
render16(x, y, 96, 0, 0);
|
||||||
break;
|
break;
|
||||||
case TILE_STAIRS_UP:
|
case TILE_STAIRS_UP:
|
||||||
|
@ -519,15 +523,15 @@ void renderTile(int i, int x, int y) {
|
||||||
renderConnectedTile4(x, y, 64, 32, 0xFFFFFFFF);
|
renderConnectedTile4(x, y, 64, 32, 0xFFFFFFFF);
|
||||||
break;
|
break;
|
||||||
case TILE_CLOUDCACTUS:
|
case TILE_CLOUDCACTUS:
|
||||||
renderTile(TILE_CLOUD, x, y);
|
renderTile(TILE_CLOUD, 0, x, y);
|
||||||
render16(x, y, 80, 0, 0);
|
render16(x, y, 80, 0, 0);
|
||||||
break;
|
break;
|
||||||
case TILE_SAPLING_TREE:
|
case TILE_SAPLING_TREE:
|
||||||
renderTile(TILE_GRASS, x, y);
|
renderTile(TILE_GRASS, 0, x, y);
|
||||||
render16(x, y, 32, 0, 0);
|
render16(x, y, 32, 0, 0);
|
||||||
break;
|
break;
|
||||||
case TILE_SAPLING_CACTUS:
|
case TILE_SAPLING_CACTUS:
|
||||||
renderTile(TILE_SAND, x, y);
|
renderTile(TILE_SAND, 0, x, y);
|
||||||
render16(x, y, 32, 0, 0);
|
render16(x, y, 32, 0, 0);
|
||||||
break;
|
break;
|
||||||
case TILE_FARM:
|
case TILE_FARM:
|
||||||
|
@ -758,7 +762,7 @@ void renderBackground(int xScroll, int yScroll) {
|
||||||
int x, y;
|
int x, y;
|
||||||
for (x = xo; x <= 13 + xo; ++x) {
|
for (x = xo; x <= 13 + xo; ++x) {
|
||||||
for (y = yo; y <= 8 + yo; ++y)
|
for (y = yo; y <= 8 + yo; ++y)
|
||||||
renderTile(getTile(x, y), x << 4, y << 4);
|
renderTile(getTile(x, y), getData(x, y), x << 4, y << 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ void render16s(s32 xp, s32 yp, u32 tile, u8 bits, u32 color);
|
||||||
|
|
||||||
void renderTitle(int x, int y);
|
void renderTitle(int x, int y);
|
||||||
void renderFrame(int x1, int y1, int x2, int y2, u32 bgColor);
|
void renderFrame(int x1, int y1, int x2, int y2, u32 bgColor);
|
||||||
void renderTile(int i, int x, int y);
|
void renderTile(int i, int d, int x, int y);
|
||||||
void renderConnectedTile4(int x, int y, u32 xTile, u32 yTile, u32 color);
|
void renderConnectedTile4(int x, int y, u32 xTile, u32 yTile, u32 color);
|
||||||
void renderConnectedTile8(int x, int y, u32 xTile, u32 yTile, u32 color);
|
void renderConnectedTile8(int x, int y, u32 xTile, u32 yTile, u32 color);
|
||||||
void renderBackground(int xScroll, int yScroll);
|
void renderBackground(int xScroll, int yScroll);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue