Notifications
Article
Cyborg Monkey
Updated 10 months ago
282
4
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.

Overview

  • Title: Cyborg Monkey
  • Genre: 2D, platformer, side scrolling
  • Creator / Developer: Charles McCann
  • Unity 2D Tools used: 2D Animation, 2D IK, 2D Cinemachine, 2D Vector Graphics.
  • #Unity2DChallenge

Preface

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.

High Concept

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.

Synopsis

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.


Game Design

Game Objectives

Use your grappling hook to navigate the 2D cave before time runs out and the cave is destroyed with you in it.

Game Rules

  • 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.

Gameplay

Controls

  • 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.

Camera

2D Cinemachine camera with relatively tight settings to keep centered on player.

HUD

  • Timer - countdown
  • Damage impact (loss in time) - lost time shows above player head and fades out

Player

Character

Cyborg Monkey - outfitted with high tech grappling hooks

Metrics

Jump height, jump distance when swinging, move speed, swing speed, rope distance

States

Idle, Moving/Walk, Jumping, Swinging, Flipping (Swing Jump), Climbing

Power-Ups / Weapons

  • Grappling Hook
  • Gems - must be broken with grappling hook and parts picked up to be used with upgrades.
  • Example upgrades: longer grappling hook, faster shoot / recoil, jump higher, run faster, double jump
  • Mushrooms - pick up to help with boosts while in cave.
  • Example effects: Speed, Element resistance, Grow/Shrink, etc.

Enemies

Characters

This will be map dependent. There will be 2 types of enemies:
  • Neutral - stationary or moving, but don’t purposefully try to attack player
  • Examples: poison pools, lava, stalactites, falling rocks
  • Aggressive - usually try to attack the player
  • Examples: killer plants, bats, scorpions, golems, goblins

States

Neutral characters: Idle, Moving
Aggressive characters: Idle, Alert, Moving, Attack

Art

Simplistic style with dark tone feel.

Level Designs

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.
Sound effects:
  • Player
  • grappling hook launch / hit / miss
  • jump
  • hit the ground / hurt
  • Environment
  • Water - splash
  • Poison - splash
  • Killer Plant - growl, chomp
  • Bat - screech, death crunch
  • Lava - fire roar
  • Helicopter - chopper blade
  • Game
  • End Game Timer - warning beeps as time running out
  • Lose - explosion
  • Win - sound effects / cheering


Using Unity’s 2D Features

Overview

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.

2D Cinemachine

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.

Assets Leveraged

  • https://assetstore.unity.com/packages/2d/environments/free-asset-2d-handcrafted-art-117049 - plants
  • https://assetstore.unity.com/packages/2d/environments/2d-platformer-tiles-demolition-effect-51622 - trees
  • https://assetstore.unity.com/packages/audio/music/orchestral/ultimate-game-music-collection-37351 - music
  • Unity Packages - 2D animation, 2D IK, Cinemachine, TextMesh Pro, Vector Graphics
Charles McCann
Architect, Developer - Producer
9
Comments
Charles McCann
10 months ago
Architect, Developer
Thank you!
0
Charles McCann
10 months ago
Architect, Developer
Saurabh SaxenaAmazing work ⭐️
Thank you!
0
Saurabh Saxena
10 months ago
Founder of Delhi Technology Club
Amazing work ⭐️
1
CC
Chuck Chuckerson
10 months ago
very nice
1