Saturday, 28 March 2015
Shop
The shop is basically a set of GUI buttons that when clicked modify a variable. The data stored in those variables is loaded in via xml (as disscussed in the last post). When buying an upgrade to a stat, the score the user has built up during the game becomes money, and is used to pay for the upgrades
Friday, 6 March 2015
Load & Save XML Data
As the game is going to include editable character stats i decided it would be a nice feature to be able to save those stats so that the user could come back to the game and have their character saved from the last session.
I decided the easiest was to do this would be to store the data inside an XML file.
This data was then read in through script, and stored as the variables within the player attributes.
I also decided that the data was also to be loaded seperatly when in the shop menu, as the player attributes script doesn't exist there. Therefore in the shop menu the data is loaded stored as a placeholder variable, and then when the user leaves the shop it is saved, and can be loaded with the updated stats when the game starts
Friday, 30 January 2015
Stun Attack
After getting a melee attack in, the next attack added was a stun attack. This attack stuns an enemy fot a set amount of time, allowing the player to either attack the enemy easier, or run away in order to regain some health.
The stun attack works similar to the melee in that it checks a trigger collider in order to determine whether or not the enemy can be attacked. For this attack to work I added a new bool variable to the AI Attributes to check whether or not the enemy was stunned. This was used by the attack, by checking if the user had pressed the 'KeyPad 1' button, and canAttack was true. If both of these were true then the isStunned bool in the ai attributes was turned to be true.
The timer was set in the AI Attributes script too. In the update loop, there is a check to see if the enemy is stunned, if so then the movement was disabled and the timer would start counting down. when the timer was at zero the the enemy was un-stunned.
The stun attack works similar to the melee in that it checks a trigger collider in order to determine whether or not the enemy can be attacked. For this attack to work I added a new bool variable to the AI Attributes to check whether or not the enemy was stunned. This was used by the attack, by checking if the user had pressed the 'KeyPad 1' button, and canAttack was true. If both of these were true then the isStunned bool in the ai attributes was turned to be true.
The timer was set in the AI Attributes script too. In the update loop, there is a check to see if the enemy is stunned, if so then the movement was disabled and the timer would start counting down. when the timer was at zero the the enemy was un-stunned.
Friday, 5 December 2014
Melee Attack
The melee attack is the main attack in the game. It is a simple attack that deals damage to the ai enemy.
The way it works, is the enemy has a trigger collider on it and when the player enters the colliders bounds it will be marked as able to be attacked. If the enemy is attackable and the user presses the 'keypad 0' button, the enemy will take damage
This is currently a simple version of the attack which will be advanced upon at a later date when advances in other areas have been made to allow for extension to this.
The way it works, is the enemy has a trigger collider on it and when the player enters the colliders bounds it will be marked as able to be attacked. If the enemy is attackable and the user presses the 'keypad 0' button, the enemy will take damage
This is currently a simple version of the attack which will be advanced upon at a later date when advances in other areas have been made to allow for extension to this.
Saturday, 22 November 2014
AI Attributes, Attack & Damage
The AI Attributes are set up in the same way as the players, meaning it has all the basic stats needed for the game (health through to attack points). Aswell as tracking the stats for the enemy, it checks whether or not the enemy has died.
The method for the attack is fairly basic, it checks to see if there is any collision with the player, and if so deal damage.
Currently for taking damage, there is an AI Damage script attached to the weapon that is attacking the AI. This script checks for collision with the AI and deals the amount of damage based upon the attack stat of the player. Before doing any damage, there is a check to see if there is any armour on the AI, and that decided which stat to be attacked first.
The method for the attack is fairly basic, it checks to see if there is any collision with the player, and if so deal damage.
Currently for taking damage, there is an AI Damage script attached to the weapon that is attacking the AI. This script checks for collision with the AI and deals the amount of damage based upon the attack stat of the player. Before doing any damage, there is a check to see if there is any armour on the AI, and that decided which stat to be attacked first.
AI Spawn Pickups
When I added pickups, I decided that score and xp would be dropped when an enemy is killed. This was done by checking to see if the ai had been killed, and instanciating the pickups in the position of the enemy.
Saturday, 15 November 2014
Pickups
Pickups... These are the gifts found throughout the levels of the game. Some will be given when you defeat an enemy (Score/XP), and others will be scattered around (Health/Armour).
For the pickups I have created 1 universal script that handles all types of pickups the player will find. The way the pickups are decided is with a public bool variable, that is decided when the pickup is created.
The pickup works by detecting collisions with the player, and then giving the player the bonus that pickup is for.
Again the art for the pickups is temporary, as artist are yet to supply art work for them.
Future additions to the pickups, will be instanciating the score & xp pickups when an enemy is defeated
For the pickups I have created 1 universal script that handles all types of pickups the player will find. The way the pickups are decided is with a public bool variable, that is decided when the pickup is created.
The pickup works by detecting collisions with the player, and then giving the player the bonus that pickup is for.
Again the art for the pickups is temporary, as artist are yet to supply art work for them.
![]() |
Black = XP, Blue = Score, Red = Health, Green = Armour |
Future additions to the pickups, will be instanciating the score & xp pickups when an enemy is defeated
Subscribe to:
Posts (Atom)