summaryrefslogtreecommitdiff
path: root/src/include/data_game.h
blob: 669c0efd1d14972de7c2ed1fd4957196106724cb (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef DATA_GAME_H
#define DATA_GAME_H

#include <SDL.h>

#include "data_ress.h"

#define MAX_LEMMINGS_COUNT 100 /* Should be used also by the parser... */

enum lemmtype {
	/* Well known types */
	faller,walker,climber,floater,stopper,builder,
	digger,basher,miner, /* vertical / horizontal / diagonal */
	jumper, /* a Lemming jumping over a small obstacle */

	/* Lemming disparitions */
	bomber, 
	splat, /* a Lemming dieing from a fall */
	drowning, /* a Lemming drowning in the water */
	trapped, /* a Lemming killed by a trap */
	exiting,

 	/* transitionnal states, special animation*/
	climber_to_walker,
	builder_end, /* a builder Lemmings with no more steps in his backpack (shrugling) */

 	/* transitionnal states, no special animation*/
	floater_start,
	bomber_stopper, /* a stopper that is told to explode */
	
	/* Special states for algorithmic purposes */
	nuke		/* already dead Lemming */
	/*undefined	 No lemm type yet (usefull?) */
};

enum lemmdir { left, right };

typedef struct {
	enum lemmtype type;
	enum lemmdir  dir;
	int x,y; /* Lemming Foot coords */
	int maskX, maskY;
	int frameIdx; /* For animated sprites */
	int counter, counter2; /* counter used for internal state changes */
	int explodeNumCtr, explodeCtr;
	int canFloat, canClimb, canChangeSkill, nuke, hasDied, hasLeft,
	int selectCtr; /** counter used to display the select image in replay mode */

	renderItem_t *renderItem;	
} lemming_t;

enum skills {
	sk_climber=0, sk_floater, sk_blocker, sk_bomber, sk_builder,
	sk_basher, sk_miner, sk_digger, sk_count
};


typedef struct {
		/* Game time counter */
		int tick;

		/* terrain & stencil
			generated by paintTerrain()
			updated by ???()  */
		SDL_Surface *terrain, *stencil;

		lemming_t lemmings[MAX_LEMMINGS_COUNT];
		int remSkills[sk_count];
		int currReleaseRate;

} gameState_t;

#endif /*DATA_GAME_H*/