Sunday 26 August 2012

Comat Scripting : Melee & Special Attack

Following our recent presentation to evaluate the progress of the game's development, it was evident that the implementation of some game elements will need to be 'fast-tracked' in order to have a working game demo within the time we have left.

To help achieve this goal, I've implemented the two other attacks for the main character, Melee attacks and Special attacks, before the animation sequences have been imported for the character. Now, when the player presses the melee button, the character will execute a melee attack, which will take form of Caruso swinging his sword down onto the enemy in front of him. Pressing the special attack button will execute the special attack which is an area-of-effect attack and will inflict damage on enemies within the attack's radius of effect.

Since the animations for these attacks have yet to be implemented, the attack sequences currently use placeholder objects to help indicate the movement of the attack and where it will hit.

How it works:

Melee:
When the melee button is pressed, the combat script will execute the melee function. doing this will instantiate a 'sword' collider object in front of the player character and apply a rigid body, collider and tag to the object. It will then animate this newly created object so that it rotates downwards to mimic a downwards swing motion of Caruso's sword. If the sword collider complete's it animation sequence without hitting an enemy, it will be destroyed/removed from play, ready for the next sword collider to be instantiated during the next melee attack.

Special
Performing a special attack works in a similar way to the melee attack in that when the special attack function is executed from the combat script, a temporary placeholder collider is created and assigned, at the player's position, then animated in an arc sequence. The special attack is different because instead of rotating vertically, the special attack collider rotates around the player character in a 360 degree arc on a horizontal plane. This sequence is to represent the area of effect attack from Caruso's special attack.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.