-
Notifications
You must be signed in to change notification settings - Fork 0
/
movement.h
42 lines (33 loc) · 1.13 KB
/
movement.h
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
#ifndef MOVEMENT_H
#define MOVEMENT_H
#include <SDL/SDL.h>
#include "level.h"
int absoluteValue(int val);
// More comprehensive to manipulate pixels
struct coordCartesian{
int x;
int y;
};
// More comprehensive to manipulate cases
struct coordgrid{
int l;
int c;
};
// More comprehensive to manipulate offset for the images
struct offset{
int xOffset;
int yOffset;
};
// Different states of a direction
enum {Null, Left, Right, Up, Down};
/****************************************************
* Functions linked with the interaction of the user
* **************************************************/
int direction(SDL_Event &eventM, coordCartesian &mouseDown, coordCartesian mouseDownReleased, coordCartesian swipe);
int hitboxMonster(level grid, coordCartesian mouse, int &k);
/***************************************************
* Functions linked with the update of the level
* *************************************************/
void updateLevel(level &grid, int monsterId, int dir, bool &outOfGrid, SDL_Surface *screen, SDL_Surface *imgObject, SDL_Surface *fondJeu);
void suppOccIce(level &grid,int idIce);
#endif