attack_manager¶
- class AttackSensor(gameobj, character)¶
Bases: bge.KX_GameObject
Sensor object that detects collisions for MeleeAttackManager
Parameters: - gameobj – The KX_GameObject to mutate (passed on to __new__)
- character – The Character this sensor is attached too
- start_attack(damage)¶
Notifies the sensor to begin dealing hits
Parameters: damage – How much damage hits cause
- end_attack()¶
Notifies the sensor to stop dealing hits
- class MeleeAttackManager(character, attack_sensors, attacks, damage)¶
Handles melee attacks for Character objects
Parameters: - character – The Character this manager is attached to
- attack_sensors – A list of AttackSensor objects to be used for this manager
- attacks – A list of attacks (‘name’, start_frame, end_frame) to use
- damage – How much damage each hit should cause
- class MeleeAttackAnimatonState(character)¶
Bases: scripts.framework.animations.AnimationState
- update()¶
- MeleeAttackManager.update()¶
Update method which should be called every frame to update this manager
- MeleeAttackManager.attack()¶
Have this manager do an attack
- class ProjectileSensor(start_position, projectile, direction, speed, damage, character)¶
Bases: bge.KX_GameObject
Sensor object that detects collisions for RangeAttackManager
Parameters: - start_position – The world position where this sensor is spawned
- projectile – The name of the KX_GameObject to use as a projectile (a replica will be added to the scene)
- direction – A direction vector the projectile will travel along
- speed – How fast the projectile will travel along its direction vector
- damage – How much damage the projectile will cause upon impact
- character – Ignore this character when doing collision checks
- update()¶
Update method which should be called every frame to update this sensor
- class RangeAttackManager(character, projectile, speed, distance, damage, cooldown)¶
Handles ranged attacks for Character objects
Parameters: - character – The Character this manager is attached to
- projectile – The name of the KX_GameObject to use as a projectile (a replica will be added to the scene)
- speed – How fast the projectile will travel along its direction vector
- distance – The maximum range of projectiles
- damage – How much damage each hit should cause
- cooldown – The duration until this manager can attack again after recently attacking
- update()¶
Update method which should be called every frame to update this manager
- attack(start_position, direction)¶
Have this manager do an attack
Parameters: - start_position – The starting position of the projectile
- direction – The direction vector of the projectile
- class MouseRangeAttackManager(obj, projectile, speed, distance, damage, cooldown)¶
Bases: scripts.attack_manager.RangeAttackManager
A RangeAttackManager that uses the character and mouse as starting positions and directions, respectively, for projectiles
Parameters: - character – The Character this manager is attached to
- projectile – The name of the KX_GameObject to use as a projectile (a replica will be added to the scene)
- speed – How fast the projectile will travel along its direction vector
- distance – The maximum range of projectiles
- damage – How much damage each hit should cause
- cooldown – The duration until this manager can attack again after recently attacking
- attack()¶
Have this manager do an attack