Tanks Multiplayer  1.5
Public Attributes | Protected Member Functions | List of all members

Implementation of AI bots by overriding methods of the Player class. More...

Inheritance diagram for PlayerBot:

Public Attributes

string myName
int teamIndex
int health
int shield
int ammo
int currentBullet
float range = 6f
 Radius in units for detecting other players. More...
- Public Attributes inherited from Player
Text label
 UI Text displaying the player name. More...
int maxHealth = 10
 Maximum health value at game start. More...
short turretRotation
 Current turret rotation and shooting direction. More...
float fireRate = 0.75f
 Delay between shots. More...
float moveSpeed = 8f
 Movement speed in all directions. More...
Slider healthSlider
 UI Slider visualizing health value. More...
Slider shieldSlider
 UI Slider visualizing shield value. More...
AudioClip shotClip
 Clip to play when a shot has been fired. More...
AudioClip explosionClip
 Clip to play on player death. More...
GameObject shotFX
 Object to spawn on shooting. More...
GameObject explosionFX
 Object to spawn on player death. More...
Transform turret
 Turret to rotate with look direction. More...
Transform shotPos
 Position to spawn new bullets at. More...
GameObject[] bullets
 Array of available bullets for shooting. More...
MeshRenderer[] renderers
 MeshRenderers that should be highlighted in team color. More...
GameObject killedBy
 Last player gameobject that killed this one. More...
FollowTarget camFollow
 Reference to the camera following component. More...

Protected Member Functions

override void RpcRespawn (short senderId)
 Override of the base method to handle bot respawn separately. More...
- Protected Member Functions inherited from Player
void Shoot (Vector2 direction=default(Vector2))
void CmdShoot (short[] position, short angle)
void RpcOnShot ()
void OnHealthChange (int value)
void OnShieldChange (int value)
void RpcGameOver (byte teamIndex)

Additional Inherited Members

- Public Member Functions inherited from Player
override void OnPlayerPropertiesUpdate (Photon.Realtime.Player player, ExitGames.Client.Photon.Hashtable playerAndUpdatedProps)
 This method gets called whenever player properties have been changed on the network. More...
PhotonView GetView ()
 Helper method for getting the current object owner. More...
void TakeDamage (Bullet bullet)
 Server only: calculate damage to be taken by the Player, triggers score increase and respawn workflow on death. More...
void CmdRespawn ()
 Command telling the server and all others that this client is ready for respawn. This is when the respawn delay is over or a video ad has been watched. More...
void ResetPosition ()
 Repositions in team area and resets camera & input variables. This should only be called for the local player. More...

Detailed Description

Implementation of AI bots by overriding methods of the Player class.

Member Function Documentation

override void RpcRespawn ( short  senderId)

Override of the base method to handle bot respawn separately.

Reimplemented from Player.

Member Data Documentation

int ammo
int currentBullet
int health
string myName
float range = 6f

Radius in units for detecting other players.

int shield
int teamIndex

The documentation for this class was generated from the following file: