|
|
|
|
@ -7,7 +7,8 @@
|
|
|
|
|
#include "IsometricMap/isometricMap.h"
|
|
|
|
|
#include "stdio.h"
|
|
|
|
|
|
|
|
|
|
Game * GameInit(){
|
|
|
|
|
Game *GameInit()
|
|
|
|
|
{
|
|
|
|
|
Game *game = (Game *)malloc(sizeof(Game));
|
|
|
|
|
|
|
|
|
|
game->cursorTextures[0] = LoadTexture("assets/cursor.gif");
|
|
|
|
|
@ -17,8 +18,6 @@ Game * GameInit(){
|
|
|
|
|
// game->cursorSprite = (Sprite *) malloc(sizeof(Sprite));
|
|
|
|
|
game->cursorSprite = SpriteCreate(game->cursorTextures, 450, 225);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Image worker1flip = LoadImage("assets/worker/worker-1.png");
|
|
|
|
|
ImageFlipHorizontal(&worker1flip);
|
|
|
|
|
Image worker2flip = LoadImage("assets/worker/worker-2.png");
|
|
|
|
|
@ -53,6 +52,8 @@ Game * GameInit(){
|
|
|
|
|
game->camera->target.y = 0;
|
|
|
|
|
game->camera->rotation = 0.0f;
|
|
|
|
|
game->camera->zoom = 1.0f;
|
|
|
|
|
game->camera->offset.x = 0;
|
|
|
|
|
game->camera->offset.y = 0;
|
|
|
|
|
|
|
|
|
|
game->sprites = ListInit();
|
|
|
|
|
|
|
|
|
|
@ -63,48 +64,55 @@ Game * GameInit(){
|
|
|
|
|
int i = 0;
|
|
|
|
|
int j = 0;
|
|
|
|
|
|
|
|
|
|
for(n = 0; n < 10; n++){
|
|
|
|
|
for (n = 0; n < 10; n++)
|
|
|
|
|
{
|
|
|
|
|
((game->layers))[n] = IsometricMapInit(n);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(n = 0; n <= 10; n++){
|
|
|
|
|
for(i = 0; i < 100; i++){
|
|
|
|
|
for(j = 0; j < 100; j++){
|
|
|
|
|
switch(n){
|
|
|
|
|
for (n = 0; n <= 10; n++)
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < 100; i++)
|
|
|
|
|
{
|
|
|
|
|
for (j = 0; j < 100; j++)
|
|
|
|
|
{
|
|
|
|
|
switch (n)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
IsometricMapAddTile(((game->layers))[n], i, j, 0);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
if(i > 35 && i < 50 && j > 45 && j < 60){
|
|
|
|
|
if (i > 35 && i < 50 && j > 45 && j < 60)
|
|
|
|
|
{
|
|
|
|
|
IsometricMapAddTile(((game->layers))[n], i, j, 0);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printf("ALARM\n");
|
|
|
|
|
for(n = 0; n <= 10; n++){
|
|
|
|
|
for(i = 0; i < 20-n*2; i++){
|
|
|
|
|
for(j = 0; j < 20-n*2; j++){
|
|
|
|
|
for (n = 0; n <= 10; n++)
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < 20 - n * 2; i++)
|
|
|
|
|
{
|
|
|
|
|
for (j = 0; j < 20 - n * 2; j++)
|
|
|
|
|
{
|
|
|
|
|
IsometricMapAddTile(((game->layers))[n], i, j, 0);
|
|
|
|
|
if(n == 9){
|
|
|
|
|
if (n == 9)
|
|
|
|
|
{
|
|
|
|
|
IsometricMapAddTile(((game->layers))[n], i, j, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
printf("ALARM\n");
|
|
|
|
|
|
|
|
|
|
// -------
|
|
|
|
|
|
|
|
|
|
return game;
|
|
|
|
|
|
|
|
|
|
}
|