aboutsummaryrefslogtreecommitdiff
#ifndef MAIN_H_INCLUDED
#define MAIN_H_INCLUDED
#include <SDL2/SDL.h>
#include <stdio.h>
#include <SDL2/SDL_image.h>
#define NUM_CAJAS 10
#define GRAVEDAD 1
#define CUADRO 0

typedef struct
{
    int x, y ,w, h;

} Suelo;

typedef struct
{
    int x, y, w, h;
    int dy, dx;
    int facing_left, walking;
} Man;

typedef struct
{
    int x, y, w, h;
} Camara;

typedef struct
{
    Man man;
    Camara camara[3];
    Suelo suelo[NUM_CAJAS];
    SDL_Texture *player;
    SDL_Texture *ladrillo;
    SDL_Renderer *renderer;
    int scrollx;
    int scrolly;
    int salto;
    int i;
} GameState;

int processEvents(SDL_Window *window, GameState *gameState);

void doRender(SDL_Renderer *renderer, GameState *gameState);

void loadScreen(GameState *gameState, SDL_Renderer *renderer);

void collisionDetect(GameState *game);

#endif // MAIN_H_INCLUDED