paar neue Texturen

main
JanEhehalt 3 years ago
parent c98aaf3328
commit 6f0f0b37b7

@ -9,7 +9,11 @@ IsometricMap * IsometricMapInit(int layer){
IsometricMap* map = (IsometricMap *) malloc(sizeof(IsometricMap)); IsometricMap* map = (IsometricMap *) malloc(sizeof(IsometricMap));
map->tileTextures[0] = LoadTexture("assets/grass.png"); map->tileTextures[0] = LoadTexture("assets/grass.png");
map->tileTextures[1] = LoadTexture("assets/tower.png"); map->tileTextures[1] = LoadTexture("assets/grass_selected.png");
map->tileTextures[2] = LoadTexture("assets/tower.png");
//map->tileTextures[0] = LoadTexture("assets/desert.png");
//map->tileTextures[1] = LoadTexture("assets/bigtower.png");
map->originX = 0; map->originX = 0;
map->originY = -layer * map->tileTextures[0].width / 4; map->originY = -layer * map->tileTextures[0].width / 4;

@ -48,10 +48,11 @@ void IsometricRendererRenderIsometricMap(IsometricMap **map, InputHandler *input
if(map[n]->tiles[i][j]->textureId != -1){ if(map[n]->tiles[i][j]->textureId != -1){
Vector2 *offset = IsometricMapCalcOffsetForTileAt(i,j, map[n]->textureWidth); Vector2 *offset = IsometricMapCalcOffsetForTileAt(i,j, map[n]->textureWidth);
int textureId = map[n]->tiles[i][j]->textureId;
float x = map[n]->originX + offset->x; float x = map[n]->originX + offset->x;
float y = map[n]->originY + offset->y; float y = map[n]->originY + offset->y + map[n]->textureHeight - map[n]->tileTextures[textureId].height;
int textureId = map[n]->tiles[i][j]->textureId;
DrawTexture(map[n]->tileTextures[textureId], x, y, WHITE); DrawTexture(map[n]->tileTextures[textureId], x, y, WHITE);
free(offset); free(offset);

@ -20,6 +20,9 @@ Fantasy Welt oder Realistisch?
+ Die Inputs sollten den Kamera Zoom beachten, aktuell geht noch alles kaputt wenn man den zoom umstellt + Die Inputs sollten den Kamera Zoom beachten, aktuell geht noch alles kaputt wenn man den zoom umstellt
+ Funktion, um die ganzen Sprites nach ihrer y-Koordinaten sortiert zu drawen + Funktion, um die ganzen Sprites nach ihrer y-Koordinaten sortiert zu drawen
+ Dokumentation anfangen + Dokumentation anfangen
+ storing maps in files
+ MapEditor
+ Parser for Mapfiles
### WiP ### WiP

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

@ -89,7 +89,7 @@ Game *GameInit()
case 2: case 2:
if (i > 40 && i < 44 && j > 50 && j < 54) if (i > 40 && i < 44 && j > 50 && j < 54)
{ {
IsometricMapAddTile(((game->layers))[n], i, j, 1); IsometricMapAddTile(((game->layers))[n], i, j, 2);
} }
break; break;
} }
@ -118,7 +118,7 @@ Game *GameInit()
IsometricMapAddTile(((game->layers))[n], i, j, 0); IsometricMapAddTile(((game->layers))[n], i, j, 0);
if (n == 9) if (n == 9)
{ {
IsometricMapAddTile(((game->layers))[n], i, j, 1); IsometricMapAddTile(((game->layers))[n], i, j, 2);
} }
} }
} }

BIN
game.o

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
list.o

Binary file not shown.

BIN
main.o

Binary file not shown.

BIN
spiel

Binary file not shown.

Binary file not shown.

BIN
tile.o

Binary file not shown.
Loading…
Cancel
Save