equal
deleted
inserted
replaced
11 #include "Input.hh" |
11 #include "Input.hh" |
12 #include "Rope.hh" |
12 #include "Rope.hh" |
13 #include "GraphicsPointer.hh" |
13 #include "GraphicsPointer.hh" |
14 #include <vector> |
14 #include <vector> |
15 |
15 |
|
16 /** |
|
17 * A Player is a PhysicsObject that represents a player - a remote client on the server, a local singleplayer player, a |
|
18 * local network-client player, a remote network-client player, etc. |
|
19 */ |
16 class Player : public PhysicsObject { |
20 class Player : public PhysicsObject { |
17 friend class Rope; |
21 friend class Rope; |
18 |
22 |
19 public: |
23 public: |
20 GameState &state; |
24 GameState &state; |
97 static bool skin_loaded; |
101 static bool skin_loaded; |
98 static CL_Surface skin_surface; |
102 static CL_Surface skin_surface; |
99 virtual void draw (Graphics *g, PixelCoordinate camera); |
103 virtual void draw (Graphics *g, PixelCoordinate camera); |
100 }; |
104 }; |
101 |
105 |
|
106 /** |
|
107 * A LocalPlayer is a Player that we handle input for - so this is our own player on the client/singleplayer, or all |
|
108 * the remote clients on a server - the name is a bit misleading. |
|
109 * |
|
110 * This inherits virtually from Player so that subclasses can also define custom behaviour for the base Player class. |
|
111 */ |
102 class LocalPlayer : public virtual Player { |
112 class LocalPlayer : public virtual Player { |
103 private: |
113 private: |
104 /* |
114 /* |
105 * Calculates projectil position/velocity and calls handleCreateProjectile |
115 * Calculates projectil position/velocity and calls handleCreateProjectile |
106 */ |
116 */ |
123 * As Player, but also draws the current weapon name if displayWeapon |
133 * As Player, but also draws the current weapon name if displayWeapon |
124 */ |
134 */ |
125 virtual void draw (Graphics *g, bool displayWeapon, PixelCoordinate camera); |
135 virtual void draw (Graphics *g, bool displayWeapon, PixelCoordinate camera); |
126 }; |
136 }; |
127 |
137 |
|
138 /** |
|
139 * A RemotePlayer is a Player that we don't handle input for - they are a remote client connected to a remote server. |
|
140 * |
|
141 * This inherits virtually from Player so that subclasses can also define custom behaviour for the base Player class. |
|
142 */ |
|
143 |
128 class RemotePlayer : public virtual Player { |
144 class RemotePlayer : public virtual Player { |
129 protected: |
145 protected: |
130 }; |
146 }; |
131 |
147 |
132 |
148 |