Last change
on this file since 2161 was
2037,
checked in by adrian, 20 years ago
|
orxonox/branches/burli: Repeating ground grid (plus player-centered view for testing)
|
File size:
1.3 KB
|
Line | |
---|
1 | |
---|
2 | |
---|
3 | |
---|
4 | #ifndef WORLD_H |
---|
5 | #define WORLD_H |
---|
6 | |
---|
7 | #include <stdlib.h> |
---|
8 | #include <cmath> |
---|
9 | |
---|
10 | #include "npc.h" |
---|
11 | #include "player.h" |
---|
12 | #include "environment.h" |
---|
13 | #include "shoot_laser.h" |
---|
14 | #include "shoot_rocket.h" |
---|
15 | #include "stdincl.h" |
---|
16 | #include "data_tank.h" |
---|
17 | |
---|
18 | const long GRIDWIDTH = 100; |
---|
19 | const long GRIDLENGTH = 120; |
---|
20 | |
---|
21 | class World { |
---|
22 | |
---|
23 | public: |
---|
24 | World (); |
---|
25 | ~World (); |
---|
26 | |
---|
27 | float primitiveMove; |
---|
28 | |
---|
29 | /* for easier use: map the first two player here */ |
---|
30 | Player *localPlayer; |
---|
31 | Player *player1; |
---|
32 | Player *player2; |
---|
33 | |
---|
34 | /* a list of all players */ |
---|
35 | struct playerList { |
---|
36 | playerList* next; |
---|
37 | Player* player; |
---|
38 | int number; |
---|
39 | }; |
---|
40 | playerList* lastPlayer; |
---|
41 | |
---|
42 | /* a list of all non-player-characters */ |
---|
43 | struct npcList { |
---|
44 | npcList* next; |
---|
45 | NPC* npc; |
---|
46 | int number; |
---|
47 | }; |
---|
48 | npcList* lastNPC; |
---|
49 | |
---|
50 | /* a list of all environmental objects */ |
---|
51 | struct envList { |
---|
52 | envList* next; |
---|
53 | Environment* env; |
---|
54 | int number; |
---|
55 | }; |
---|
56 | envList* lastEnv; |
---|
57 | |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | bool addPlayer(Player* player); |
---|
62 | bool removePlayer(Player* player); |
---|
63 | Player* getLocalPlayer(); |
---|
64 | bool addNPC(NPC* npc); |
---|
65 | bool removeNPC(NPC* npc); |
---|
66 | bool addEnv(Environment* env); |
---|
67 | |
---|
68 | void drawWorld(void); |
---|
69 | void initEnvironement(void); |
---|
70 | void setWorldStep(float step); |
---|
71 | void updateWorld(void); |
---|
72 | void detectCollision(void); |
---|
73 | void testThaTest(void); |
---|
74 | |
---|
75 | private: |
---|
76 | float surface[GRIDWIDTH][GRIDLENGTH]; |
---|
77 | float step; |
---|
78 | |
---|
79 | |
---|
80 | }; |
---|
81 | |
---|
82 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.