Cyborg Monkey - a 2D Grappling Hook Platform Game by Charles McCann
In this game play example video, we jump right to after the bomb is delivered to the lava pit, and we are about to escape. Only a section of the map is played through before transitioning to the end of the map.
I’ve been building prototype games in Unity for a few years. However, this is the first time using Unity’s 2D tools: Cinemachine, 2D Animation, 2D IK, Tiles, and Sprite Shape. The tools were surprisingly easy to use, and I only ran into a few challenges. Details below in the “Using Unity’s 2D Features” section.
You are the Cyborg Monkey, retrofitted with a bionic grappling hook. You have been created and trained to explode dangerous caves. With the use of your acrobatic grappling skills, you must deliver the bomb and escape.
Dr Iban Krazzie has created you, Cyborg Monkey, in a lab and designed you for his purpose - to destroy the evil breeding caves that have been appearing across the planet. Dr Krazzie is a genius but is absent minded and doesn’t consider your safety. You must use your skills to navigate the dangerous caves to live another day.
Use your grappling hook to navigate the 2D cave before time runs out and the cave is destroyed with you in it.
Grappling hook can attach to the cave walls.
Swing on the grappling hook, let go, or jump.
Movement on the ground is slow, but you can jump and slide.
Dangerous things in the cave hurt you by stunning you and removing time.
When the time expires, the cave is destroyed and player loses.
Escape the cave in the required time to win.
Mouse to aim grappling hook.
Left mouse to fire grappling hook. Right mouse to let go.
A or D (or Left and Right arrow) to move left and right or to swing. Space to jump.
2D Cinemachine camera with relatively tight settings to keep centered on player.
Timer - countdown
Damage impact (loss in time) - lost time shows above player head and fades out
Cyborg Monkey - outfitted with high tech grappling hooks
Caves are based on vector graphics (SVG). Cave parts are overlayed with each other to create a seamless, navigable cave. Use 2D animation / 2D IK to give life to the characters. Particle Systems leveraged to add interests (fireflies, fire, smoke, rocks breaking from grappling hook, water bubbles).
Backgrounds: Shifting color tones of the map based on items in the area (i.e. lava more red background color, blue crystal gives blue background). Parallax effect (z axis) will be used for areas where maps do not overlap other sections of the map.
Music / Sound
Music style is environmental / erie tones with option for a more action beat.
grappling hook launch / hit / miss
hit the ground / hurt
Water - splash
Poison - splash
Killer Plant - growl, chomp
Bat - screech, death crunch
Lava - fire roar
Helicopter - chopper blade
End Game Timer - warning beeps as time running out
Lose - explosion
Win - sound effects / cheering
Using Unity’s 2D Features
In this project, I did test each 2D feature to see how it might help in this game. For this project, I used: Vector Graphics, 2D Cinemachine, 2D Animation, and 2D IK.
Vector Graphics (SVG)
Leveraged SVG to create cave parts -- very easy to scale and still look good no matter the size used in game. This is perfect for building the cave game maps. Image can be large with details, but retain a small file size. Plus, the vector based caves were easy to draw in tools like Inkscape and Boxy SVG.
Creating SVG in Inkscape - draw vector, paint and save
Edit Sprite Shape in Unity - Customize the physics shape to prepare it for the collider and add collider.
Results - view results in action interacting with other objects
Example Map - This map is leveraging the SVG cave parts. More effort could have been completed to optimize the SVG polligon 2D colliders.
The default 2D Cinemachine virtual camera only required a few small tweaks. The goal for the camera was to have it locked onto the player movement tightly, but allow for small player movements without moving the camera. Camera work has never been easier thanks to Cinemachine!
2D Animation and 2D IK
I implemented the Killer Plant with 2D animation and IK (bones, weights, sprite skin, etc).
Sprite Bones and Weights
Edited the sprite, adding bones and weights; configured the Sprite Skin script on the image object. Attached a CCD Solver 2D (with Target and IK Effector). IK Effector set to the base of the plant mouth, animated, and used code to change plant state and move IK Effector mouth towards player when attacking.
Killer Plant Game Play
Animation clips are kept simple and focused on the exact moving part action required, independent of the player.
Inverse Kinematics (2D IK) was used to move the Killer Plant towards the player to attack. 2D Animation and 2D IK made the animation process much simpler removing the need for custom sprites and yet interact more fluidly with the user.
While the player is outside of the yellow circle (in scene view), the Killer Plant state is IDLE. Inside the yellow circle, the plant state is ALERT. Inside the red, the plant state is ATTACK causing ‘time loss’ and broken grapple to the player upon impact.