-
Notifications
You must be signed in to change notification settings - Fork 7
Player Combat
Combat was added make the game more enjoyable, allow the player to collect food and resources and provide the player a way to defend himself and his plants against hostile animals. This provides balance for the game, as the player would most likely not be able to complete the game without getting rid of hostile entities that they encounter. It was decided that to effectively counter the hostile entities, a melee and ranged attack weapon would be used.
The sword is a melee type weapon that allows the player to attack NPC entities within its range. This includes passive and hostile animals. To successfully attack an NPC, the player must press the use key while having the mouse aiming toward the NPC. If the NPC is within a 45 degree arc of the mouse position and within a 3 block range, the NPC will successfully be hit and the NPC will lose health. The player may use the sword as much as they like with no draw backs.
The gun is a range type weapon that allows the player to attack NPC entities from a distance. To successfully attack an NPC, the player must press the use key while having the mouse aim toward the NPC. A projectile will then spawn and move in the direction of the mouse. If an NPC makes contact with the projectile, they will successfully be hit and lose health. The NPC will also experience some knock back from the bullet in the event that they do not die. Due to the gun having ranged attacks, it has a cool down period for shooting so that the player cannot spam projectiles. Players will be able to shoot at most 6 projectiles, before having to wait at least 2 seconds before shooting again. This was done to balance out the gun weapon.
Imbued with the speed of the AstroCluck, eating a golden egg increases the player's speed. To obtain a golden egg, you need to tame and feed an AstroCluck.
Drinking the milk of the GalaticGrazer will strengthen the player and allow them to do more damage. To obtain milk, tame and feed a GalacticGrazer.
Below shows a UML diagram of how the gun combat works in association with the game area and player entity.