Skip to content

khowellmobile/2DGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

2DGame

This game is a simple 2D shooter where an astronaut man has to defend himself against red and green slimes. He can collect powerups along the way that change the color of his projectiles, increase/decrease his speed, and give him extra lives.

Click here for a 1 minute demo video.

Technical

As the entire game file is very large, I chose to only include the game scripts and the prefabs in this repository. All scripts are written in C#.

  • Player - All player movement, shooting, and animation is controlled by the Player Script
  • Enemies - All enemy movement and animation is controlled by the Enemy Script
  • Destruction - Ensuring an object is not deleted before an associated animation is finished is done by the Destruction Script
  • Laser - Projectile behavior is controlled by the Laser Script
  • Powerups - Powerups behavior is controlled by the Power Up Script
  • Spawning - Powerup and Enemy spawning is controlled by the Spawn Manager Script
  • UI - UI updates are controlled through the UI Script
  • Game - Game starting, pausing, and spawn starting/stopping is controlled by the Game Manager Script

Instructions

  • Movement
    • Walking - moving left and right are controlled through A and D or the Arrow keys
    • Short Teleport - Q and E can be used to teleport a short distance
  • Firing - shoot a laser bolt with space or an arrow with the J key
  • Pause - pause and unpause are controlled through the P key
  • Play - The space bar will start the game from the beggining or after death

Powerups

Power ups will spawn throughout gameplay that have different effects

PowerUp Effect
Life Powerup Image Heals the player by one health
Speed Boost Powerup Image Doubles players speed for 7 seconds
Speed Down Image Halves players speed for 7 seconds
Green bolt power up Image Changes look and color of players laser bolts for 5 seconds
Rifle bolt power up Image Changes look and color of players bolts for 5 seconds

Projectiles

There are various projectiles in the game.

Projectile Description
BaseBolt Image Base laser bolt
GreenBolt Image A green laser bolt activated through a power up
PurpleBolt Image A purple laser bolt activated through a power up
Arrow Image An arrow projectile shot by using the J key

Player health

The current player health is located in the lower right hand part of the screen and changes based upon the current number of lives.

Image Lives Remaining
Healthy Player Image The player has all lives remaining
PlayerHitOnce Image 2 lives remaining
PlayerHitTwice Image 1 life remaining
Player Death Image No lives remaining

Enemies

There are two kinds of enemy slimes in the game.

Enemy Description
Red enemy Image A larger red slime that moves at a slower pace
Green enemy Image A smaller green slime that moves at 1.5 times the speed of the red slime

Assets Used

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages