SpriteKit Game – Space Invaders

This is a simple game implemented using SpriteKit framework in Swift. The game is inspired by the classic arcade game “Space Invaders” and involves shooting down enemies while avoiding collisions.

Screen.Recording.2023-05-23.at.12.32.58.AM.mov

Overview

The game features a player-controlled spaceship that can move vertically on the screen. The objective is to shoot down enemies that appear from the right side of the screen and earn points. The game ends if the player’s spaceship collides with an enemy. The project is implemented using the SpriteKit framework, which provides an easy-to-use and powerful set of tools for creating 2D games. The game scene is rendered using SKScene, and physics simulation is used to handle collisions between objects. The project also utilizes SKPhysicsContactDelegate to detect and respond to contact events.

Tools and Technology

  • Swift programming language
  • Xcode IDE
  • SpriteKit framework

Key Features

  • Player-controlled spaceship that can move vertically.
  • Enemies spawning from the right side of the screen and moving towards the player.
  • Shooting mechanism to destroy enemies.
  • Score tracking and display.
  • Game over condition upon collision between the player’s spaceship and an enemy.
  • Increasing difficulty over time, with enemies spawning at a faster rate.

How to Play

  • Move the spaceship vertically by dragging your finger on the screen.
  • Avoid colliding with the enemies.
  • Shoot projectiles by tapping anywhere on the screen to destroy the enemies.
  • Earn points for each enemy destroyed.
  • The game ends if the player’s spaceship collides with an enemy.

Credit

This project was made as a part of Hacking with Swift course by Paul Hudson.

GitHub

View Github