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

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

Inheritance diagram for PlayerBot:
Player

Public Attributes

float range = 6f
 Radius in units for detecting other players. More...
 
- Public Attributes inherited from Player
string myName
 Player name synced across the network. More...
 
Text label
 UI Text displaying the player name. More...
 
int teamIndex
 Team value assigned by the server. More...
 
int health = 10
 Current health value. More...
 
int maxHealth
 Maximum health value at game start. More...
 
int shield = 0
 Current shield value absorbing hits. More...
 
int turretRotation
 Current turret rotation and shooting direction. More...
 
int ammo = 0
 Amount of special ammunition left. More...
 
int currentBullet = 0
 Index of currently selected bullet. 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 RpcOnShot ()
 
void OnHealthChange (int value)
 
void OnShieldChange (int value)
 

Additional Inherited Members

- Public Member Functions inherited from Player
override void OnStartClient ()
 Initialize synced values on every client. More...
 
override void OnStartLocalPlayer ()
 Initialize camera and input for this local client. This is being called after OnStartClient. 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 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...
 
void RpcGameOver (int teamIndex)
 Called on all clients on game end providing the winning team. This is when a target kill count or goal (e.g. flag captured) was achieved. More...
 

Detailed Description

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

Member Function Documentation

override void RpcRespawn ( short  senderId)
protectedvirtual

Override of the base method to handle bot respawn separately.

Reimplemented from Player.

Member Data Documentation

float range = 6f

Radius in units for detecting other players.


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