which included commits to RCS files with non-trunk default branches. git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@14 e016b1c5-ed68-44aa-a2f7-31cac88cffde
113 lines
2.9 KiB
Plaintext
Executable File
113 lines
2.9 KiB
Plaintext
Executable File
----
|
|
|
|
11.11.2004
|
|
|
|
Andrew 'arghvark' Davis
|
|
Adrian 'driAn' Henke
|
|
|
|
----
|
|
|
|
ActionCube coding
|
|
|
|
|
|
The class system
|
|
|
|
|
|
|
|
0. Inheriting
|
|
|
|
|
|
ac_game That's the basis/parent class. This class includes all data
|
|
| for the gameplay such as fraglimit, timeleft. It has all the other objects such
|
|
| ac_players, ac_vehicle, ac_light, etc. as instance!
|
|
|
|
|
+-->ac_ctf Inherits from ac_game. This class can be used. The only difference between
|
|
| ac_game and ac_ctf are the methods. The methods of ac_ctf declare the gameplay,
|
|
| how the flag stuff works, etc. The whole gameplay can be changed in those methods.
|
|
|
|
|
+-->ac_tf Same as above.
|
|
|
|
|
|
|
|
### all the other game modes
|
|
|
|
|
|
|
|
|
|
ac_actor This is the basic class of anything that can be controled by a player.Contains all
|
|
| the junk that is universal to any object in the world that is player (or ai) controled.
|
|
|
|
|
+-->ac_player This class inherits from ac_actor and contains data specific to players, such as ammo
|
|
| health ect.
|
|
|
|
|
+-->ac_bot This class inherits from player class and replaces monster.cpp It will contain AI code
|
|
| so we can add bots and single player later.
|
|
|
|
|
+-->ac_vehicale Inherits from actor, this could be used for user controled vehicles. Could have vehicales
|
|
| like airplane, automobile, and boat inherit from it.
|
|
|
|
|
+-->ac_boat ...
|
|
|
|
|
|
|
|
### all the other vehicales
|
|
|
|
|
|
|
|
|
|
ac_entity A parent class of all enties in the map. An entity is anything that can not be controled
|
|
| by the player
|
|
|
|
|
+-->ac_light ...
|
|
|
|
|
|
|
|
### all the other entities
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1. Data flow and storage tree
|
|
|
|
It shows only how the data will be stored and where the specific functions/methods are.
|
|
|
|
|
|
+ means a instance
|
|
@ means a method
|
|
|
|
Example: a game running in the ctf mode
|
|
|
|
|
|
ac_ctf
|
|
|
|
|
+->timeleft
|
|
+->fraglimit
|
|
+->friendlyfire (bool for on/off)
|
|
+->players array/vector of ac_player. All players are stored here. See below what ac_player includes!
|
|
+->bots ...
|
|
+->entities ...
|
|
|
|
|
@->Shoot(ac_player,ac_player) Get called when a player shoots another player. If those are in the same team, the shooted
|
|
| player lose his health only when friendlyfire is TRUE. If health<=0 set the shooted players
|
|
| state to AC_FRAGGED. If the fragged guy took a flag, the fragger gets few bonus points (?)
|
|
| Sets players[fragger]->frags+=1 if the shooted guy has no HP left.
|
|
|
|
|
@->GotFlag(ac_player) Sets players[x]->gotflag=TRUE. Alerts the enemy team that their flag was stealed.
|
|
|
|
|
@->FlagReturn(ac_player) Give this player few extra points.
|
|
|
|
|
@->Kick(ac_player)
|
|
|
|
|
@->Spawn(ac_player) Controls the time based spawning. Sets players[x]->state=AC_DEFAULT.
|
|
|
|
|
@->Suicide(ac_player) Take few frags/points.
|
|
|
|
|
@->ChangeTeam(ac_player,team) Set players[x]->frags=0 and players[x]->team=team.
|
|
|
|
|
@->Vote(ac_player,anydata) Some voting stuff. If they vote a new game mode, ac_ctf gets killed and another class, as
|
|
| example ac_tf gets started.
|
|
#
|
|
|
|
|
|
|
|
|