aboutsummaryrefslogtreecommitdiff
path: root/original/main.h
blob: 6074a1a57a4c1b5fb271fcdaa5e28c90dc5ceca1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#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