Shield activation
|
Hello reader The artifact that i will be writing about this week is the shield activation. it’s one of the core thing we have in the game and it’s one script that activates one of four shields when the player gives the right input. the script work by being on a empty gameobject that has all the shield gameobjects as children and then accesses the sprite renderer and collider on the each of the children. The Script when the game is running checks for the correct keys being pressed by the player and if they are the correct shield spriterenderer will be activated along with the collider. it does that as well as deactivating any other sprite renderer or collider that is conected to the other sheild children. it also has a check for if the game is over and if it is then it will deactivate the sprite renderer of the active shield segment. the shield activation also has a cooldown that is just a bonus check so the player cant switch the shield when he wants so the shield becomes a more strategic element in the game instead of something the player just use without thinking. the cooldown is set as a public float so it can easily be edited for balansing. the shield activation was made this way because we felt it would support our aesthetic goal better than the shield in the original concept document where it is a shield that moves upp and down in front of the player character, while we have a static shield with four segments that can be activated one at a time with the right buttons. the reason i made it like this was because it was an easy and reliable solution to an important part to the game that makes it work like we need it to and makes it fairly easy to scale up or down if we need any changes to the shield gameobject. making it this way also makes it easy to activate and deactivate the colliders and sprite renderers witch gives a nice look to it in the game. Thanks for reading. Isac (15-02-18) |