PRIZE FIGHTER
Prize Pool Productions
An in-game screenshot of Stage 1: Coin Pusher.
-
In the 3D action platformer Prize Fighter, you play as Hexdog, a newly sentient toy robot dog. Upon awakening, you spot the distressed Minako from afar, and vow to save her from the malevolent maw of The Claw. Move through multiple arcade machines to train up, collect stickers for the gallery, and buy skins so that you'll be ready to take on The Claw and free Minako!
-
GAME GENRE: 3D Action Platformer
ENGINE: Unity 2022.3.1f1
PLATFORM: PC (Itch.io)
TEAM SIZE: 8 Members
DURATION: 10 Weeks
ROLE(S): Combat Designer and Movement Programmer
-
Implementation of the grounded and aerial movement and attack functions the player utilizes
Establishment of a checkpoint system to respawn a player once they collide with lethal physics materials
Implementation of the attack and behavior patterns of all enemies and the three-phase final boss battle
Development of state machine logic to dictate how HexDog controls and animates based on player input
-
Prize Fighter is on Itch.io as of April 29th, 2024!
PLAY IT HERE: https://chellerad.itch.io/prize-fighter
CODE SNIPPETS
This is a script that allows the use of HexDog’s Grounded Punch attack, which is attached to the HexDog prefab. The script gets reference to a private instance of the PlayerBehavior script called pB, a private serialized GameObject called groundAttackHitbox, a private serialized GameObject called playerModel, a private serialized AudioClip called hexdogPunch, and a private bool called attacking.
In void Start(), pB is set to the PlayerBehavior script on the HexDog prefab, and the hitbox attached to the groundAttackHitbox GameObject is set false. This makes it so that the necessary references to the animator are found and the punch’s hitbox is turned off until the Attack function is called.
In void Attack, reference to the CallbackContext from UnityEngine’s new Input System is an accepted parameter. This means that when the proper attack button is pressed on keyboard or controller, the Attack function is called. Within the function, pB is checked to find if the player is considered grounded. If this is true, the attack hitbox is not active, and the attack function has been called, the attack hitbox is set to active, the player is attacking, and the player’s animator has its boolean to play the punch animation set to true. It then calls the coroutine AttackReset, which turns off groundAttackHitbox, sets attacking to false and sets the animator’s punch boolean to false after 0.5 seconds. As this coroutine is called, the Attack function randomly selects an attacking sound to play from HexDog’s possible punch sounds.
This is a script that allows the use of HexDog’s Dive Punch attack, which is attached to the HexDog prefab. Similar to its grounded counterpart, this class gets an instance of the PlayerBehavior script called pB, a private Rigidbody called rB, and reference to a custom class called GravityScalePhysX, privately referenced as gSPX by DivePunch. This script was made to individually adjust the values of 3D rigidbodies, as Unity’s PhysX rigidbodies do not come with customizable gravity components. From there, float variables called gravConstant and dropDownMult are able to adjust the effects of gravity on HexDog before, during and after a Dive Punch is performed. Other key references include the GameObject divePunchHitbox where the attack’s hitbox is stored, a bool called divePunchCall that detects when the Dive Punch function is called.
In void Start(), the necessary references all get their respective components from the HexDog prefab. gSPX’s public float gravityScale, which adjusts the effects of gravity on a rigidbody, is set to the gravConstant value. From our testing, a gravConstant of 5f made HexDog feel weighty and satisfying to control. The divePunchHitbox’s activeness is set to false at the start, only activating when the attack portion of the Dive Punch begins.
The DivePunch class checks for collision with any surface underneath it. If the y position of the collision’s normal is greater than or equal to 0.5f, the Dive Punch in progress is ended.
In void DivePunchCalled, reference to the CallbackContext from UnityEngine’s new Input System is an accepted parameter. As discussed in the GroundedPunch class, this checks for the punch input’s calling. If a Dive Punch is not already active, pB returns false on the IsGrounded() bool and the attack input was performed, isDivePunchActive is set to true. As this occurs, HexDog pauses in midair to wind up his Dive Punch. After the pause is finished, the coroutine DivePunchDrop() begins, and the player loses the ability to double jump. This ensures the player cannot jump while descending with accelerated gravity and interfere with the intended falling behaviors.
In void MidairPause(), the function DivePunchMovementChange(), which divides the defaultMovementSpeed float of pB by the dropGravMult float declared earlier. This constrains the movement of the player, giving them more minute control over where their punch will land. As this occurs, the player’s gravity scale is set to 0f, stalling the player in midair, and divePunchCall is set to true. This tells the animator of pB that the player has entered the windup state for a Dive Punch, and the corresponding sound plays to signify this change in state.
In IEnumerator DivePunchDrop(), the function readjusts values of the player after a number of seconds equal to the divePunchAirPause float passes. Earlier in the DivePunch class, the default value is declared as 0.5f, so the changes of the coroutine will apply after half a second elapses. The gravityScale float of gSPX is set to the found product of gravConstant and dropGravMult. These default values are set to 5f and 3f, respectively, meaning the player’s gravity is amplified by a factor of 15f. The divePunchCall bool is then set to false, and the animator boolean isDiveHolding updates to reflect the change in state. At the same time, the isDiving animator boolean updates with a value of true, putting HexDog into his Dive Punch animation as a sound effect plays to affirm this change further.
In void DivePunchEnd(), the player’s movementSpeed is set back to its default value, giving full control back to the player. The gravityScale float of gSPX is set to the gravConstant, meaning the force of gravity is influenced by the default factor of 5f. From there, the bool isDivePunchActive sets to false, which is then passed into the animator’s isDiveHolding and isDiving boolean checks. These two values being set to false update the animations of HexDog to stop playing the dive-related animations. As the player lands, the divePunchHitbox GameObject containing the collider for the Dive Punch attack is set to false. With all the checks being reset, HexDog is able to perform a new Dive Punch attack once he’s in midair again.
SEE IT IN ACTION!
This is a video demonstration of Prize Pool Productions’ Prize Fighter. I am credited as the team’s Combat Designer and Movement Programmer!
Showcased in this clip is a basic outline of each level featured in our game. To complete each level, HexDog must utilize a plethora of maneuvers and attacks to combat the enemies impeding the way to Minako.
As a mint-condition figurine, HexDog is very capable at platforming. He has access to a Double Jump, used to jump from place to place with effective control. In addition, he can slide along most surfaces by holding onto them. This technique gives him a perfect foothold to perform a Wall Jump, letting him spring into a jump and bestowing him another Double Jump. Moreover, HexDog can shoot a Grapple Wire to latch onto any hit surface outlined in cyan.
While grounded, HexDog has access to the Grounded Punch. This reliable technique is HexDog’s go-to attack. It deals damage with little wind-up and can be done from a standstill or while running. If a Grounded Punch is attempted in midair, HexDog performs the Dive Punch instead. This temporarily pauses the effects of gravity on HexDog and reduces the amount of control he has while airborne. After the pause is finished, HexDog plummets to the ground with a massive fist, boosted by an amplified downward gravity effect to crush anything underneath him.
Beyond laying waste to enemies, the Grounded Punch and Dive Punch are handy in assisting HexDog with platforming. Any surface outlined in orange can be hit, such as Buttons that cause immediate changes to the level layout. These changes include making platforms accessible, making obstacles disappear, or conjuring up a hologram. Car Bumpers can also be hit with a Dive Punch, letting HexDog bounce higher than his jumps allow!
HexDog’s foes include Toy Frogs that hop between set targets and Wheel Cones that peruse a set pathway. By colliding into him, they can push him off course if he’s not careful. These two enemies are lackeys to the The Claw, the final boss holding Minako hostage. With its piercing talons, it can snatch HexDog and force him to reset from the last Checkpoint Flag he’s crossed.
Prize Fighter has been released to Itch.io as of April 29th, 2024.
To be brought to its webpage, click here!