A little arcade game that uses SwiftUI as a game engine.

Related tags

Games SwiftUI-Game
Overview

SwiftUI Game

A little arcade game that uses SwiftUI as a game engine :)

iPadOS Swift 5.3 SwiftUI 2.0 Swift Playgrounds 3 License: MIT

Video

Just copy the code into the Blank playgroundbook in Swift Playgrounds app on iPad or Mac and run it!

Do not forget to turn off Enable Results in the settings of the playgroundbook, otherwise the game will not run.

For some reason the code will not run in an Xcode Playgroud. I've created an issue.

Notes

This isn't the most beautiful Swift code. I made it just for fun and to learn a couple of things about SwiftUI. I think a videogame is a good crash test for any UI framework :) All the game logic (as well as almost all the animations) is done manually by changing @State vars in onReceive callbacks from the Timer. Sometimes you may see glitches that are most likely caused by imperfect threading.

You might also like...
IOS Spin Game - A simple spin game using SwiftUI
IOS Spin Game - A simple spin game using SwiftUI

IOS_Spin_Game A simple spin game using Swift UI.

The one and only open source 4X MMO mid-core strategy game for iOS. Similar to Game of War and Mobile Strike

4X MMO Strategy Game for iOS I have spent 4 years of my life and a significant amount of money into completing this game and I hope you enjoy it. For

Switshot is a game media manager helps you transfer your game media from Nintendo Switch to your phone, and manage your media just few taps.
Switshot is a game media manager helps you transfer your game media from Nintendo Switch to your phone, and manage your media just few taps.

Switshot is a game media manager helps you transfer your game media from Nintendo Switch to your phone, and manage your media just few taps.

Gravity Switch - A dynamic game that integrates swiping and tapping to create a fun interactive game

GravitySwitch Gravity Switch is a dynamic game that integrates swiping and tappi

FlagGuess-Game - A game to collect points by guessing flags
FlagGuess-Game - A game to collect points by guessing flags

Flag Guess Game A game to collect points by guessing flags! Wrong Choice

Tic Tac Toe game developed in SwiftUI
Tic Tac Toe game developed in SwiftUI

TicTacToe Tic Tac Toe game developed in SwiftUI Requirements macOS 11.1 Big Sur Xcode 12.3 iOS 14 Getting Started Clone the Repository Royalty free au

A 2048 game writing with SwiftUI.
A 2048 game writing with SwiftUI.

2048 Game (SwiftUI app) This is a simple game to demonstrate the new SwiftUI framework. Note that the game algorithm may have issues, and this is stil

A Simple iOS Game App - Designed in SwiftUI 🚀

A Simple iOS Game App - Designed in SwiftUI 🚀 The game's aim is to make a cap to fill the color among them. On tapping any shapes, it will rotate 90

The Classic game TicTacToe made using SwiftUI and MVVM architecture

The Classic game TicTacToe made using SwiftUI and MVVM architecture

Owner
Roman Gaditskiy
Roman Gaditskiy
Imagine Engine - a fast, high performance Swift 2D game engine for Apple's platforms

Welcome to Imagine Engine, an ongoing project that aims to create a fast, high performance Swift 2D game engine for Apple's platforms that is also a j

John Sundell 1.8k Jan 3, 2023
Palico Engine: Metal-Based Game Engine in Swift 🐑

Palico Engine: Metal-Based Game Engine in Swift ?? Implement a game engine on macOS using Metal API. Still in development. Currently I am working on a

Junhao Wang 24 Dec 1, 2022
BabySortingToyGame - Build a little game for babies to sort shapes in the correct location. This is made in SwiftUI using drag gestures.

This is a demo to build a little mini-game "for babies". It's inspired in this kind of games:

Pedro Rojas 17 Oct 23, 2022
🦁 🃏 📱 An animal matching puzzle card game– built with turn-based game engine boardgame.io and React-Native + React-Native-Web

Matchimals.fun an animal matching puzzle card game ?? ?? ?? Download for iOS from the App Store ?? Download for Android from the Google Play Store ??

iGravity Studios 137 Nov 24, 2022
CardGameEngine - Prototyping a game engine for the Bang card game

CardGameEngine Prototyping a game engine for the Bang card game. Features Engine is open source Powerful scripting language using JSON Card design is

stephtelolahy 5 Nov 22, 2022
Little Go. An iOS application that lets you play the game of Go on the iPhone or iPad.

Introduction Little Go is a free and open source iOS application that lets you play the game of Go on the iPhone or iPad. You can play against another

Patrick Näf 121 Nov 26, 2022
2D ECS game engine in 100% Swift + SwiftUI for iOS, macOS, tvOS

OctopusKit A 2D game engine based on ECS and written in 100% Swift for iOS, macOS and tvOS. If you've tried making a game in Swift while sticking to t

null 335 Dec 12, 2022
A game engine built with SDL and Swift.

Lark A game engine made with Swift and SDL. This is a pre-alpha work-in-progress. Don't try to use this unless you really know what you're doing. I ba

June Bash 41 Mar 11, 2022
Glide is a SpriteKit and GameplayKit based engine for building 2d games easily

Glide is a SpriteKit and GameplayKit based engine for building 2d games easily, with a focus on side scrollers. Glide is developed with Swift and works on iOS, macOS and tvOS.

null 433 Jan 6, 2023
A snake engine written in SpriteKit for all Apple devices.

A snake engine written in SpriteKit for all Apple devices. ⭐ Features Fully tested engine functionality. Framework based, super easy to integrate in d

Chris Jimenez 59 Dec 13, 2022