Swift Playground version of MetalCity

Overview

MetalCity

MetalCity is night city scape full procedurally generated, for Swift Playgrounds. Its fully written in Swift (5.5) and uses Metal for the rendering engine.

It features:

  • Procedurally generated road and building plots
  • 4 different styles of buildings (simple, tower, blocky and modern)
  • Procedurally generated textures
  • Traffic
  • Static and Autocam modes
  • Fireworks

Its heavily based off Shamus Young's PixelCity - http://www.shamusyoung.com/twentysidedtale/?p=2940

The fireworks are based on Karl Pickett's Fireworks Graphics Demo (https://github.com/kjpgit/fireworks) - updated for Swift 4.2 and changes in Metal.

This was written as a way for me to get more familiar with Metal and as its my second Metal app, I'm sure that there are many things I'm doing wrong (feedback and comments welcomed!).

Controls

Tap on screen to toggle the control menu
From here you can:

  • Toggle the autocam on/off
  • Change to the next autocam mode (if autocam is running)
  • Regenerate the city
  • Regenerate the textures (usually also requires regenerating the city afterwards)

If Autocam is running, the camera switches between different camera angles.

If Autocam is off then you can manually move the camera using:

  • 1 finger:

    • drag up and down will rotate camera up and down
    • drag left and right will rotate camera left and right
  • 2 fingers:

    • Drag up and down will move camera forward and backward
    • Drag left and right will rotate camera left and right
  • 3 fingers:

    • Drag up and down will move camera up and down
    • Drag left and right will strafe camera left and right

License

The MIT License (MIT) Copyright (c) 2021 Andy Qua

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You might also like...
Quiz-V2 - An another version for quiz app with multiple choices
Quiz-V2 - An another version for quiz app with multiple choices

Quiz-V2 It's an another version for quiz app with multiple choices. VideoPlay.mp

A Version Control Kit that allows Aurora Editor to do everything git related.
A Version Control Kit that allows Aurora Editor to do everything git related.

Version Control Kit AuroraEditor Version Control Kit allows us to perform actions like commiting, pulling, pushing and fetching history of whole files

A Swift package for encoding and decoding Swift Symbol Graph files.
A Swift package for encoding and decoding Swift Symbol Graph files.

SymbolKit The specification and reference model for the Symbol Graph File Format. A Symbol Graph models a module, also known in various programming la

Delightful code generation for OpenAPI specs for Swift written in Swift
Delightful code generation for OpenAPI specs for Swift written in Swift

Create API Delightful code generation for OpenAPI specs for Swift written in Swi

WebDomHandling - A Swift Package for handling JavaScript code between WebKit and Swift implemented by WebKit

WebDomHandling A Swift Package for handling JavaScript code between WebKit and S

A very simplistic state machine system for Swift while mainly used with Raylib on Swift

A very simplistic state machine system for Swift while mainly used with Raylib on Swift

A Swift SPM framework for running and managing Lua code from Swift

LuaKit A Swift Package for running and managing Lua code from Swift. Documentation For documentation, add this package as Swift Package Dependency, an

This is a Swift Package bundling different Train APIs into one simple Swift interface.

This is a Swift Package bundling different Train APIs into one simple Swift interface.

Beak 🐦 Peck into your Swift files from the command line

Beak 🐦 Peck into your Swift files from the command line Beak can take a standard Swift file and then list and run any public global functions in it v

Owner
Andy Qua
Writer of Cube Runner I. II and TV, Topple Domino plus many more. Hacker in Residence at International Airlines Group.
Andy Qua
The Xcode playground labs from the Develop in Swift Fundamentals and Data Collections books.

Develop in Swift Labs A repository with the student materials from the Xcode 12 version of Develop with Swift Fundamentals This repo contains the Swif

Teaching Develop in Swift 9 Dec 15, 2022
Swift Interview Problems in Playground

SwiftInterviewProblems Two Parts -- Swift Playgrounds & Read Me Swift Interview Problems in Playground you may have to copy and paste the code into a

Zachary Smith 43 Jan 2, 2023
A Swift Playground to play around Combine

CombinePlayground A Swift Playground to play around Combine Why made this playground To help myself learn Combine, I re-implemented the same features

Jake Lin 5 Apr 17, 2022
A sample app demonstrates how to use Atlantis on Swift Playground (iOS/macOS)

Atlantis with Swift Playground A sample app demonstrates how to use Atlantis on

Proxyman 3 Dec 22, 2021
A command line tool for managing Swift Playground projects on your Mac.

swift-playground-tools A command line tool for managing Swift Playground projects on your Mac. Generate Xcode Project $ playground-tools generate-xcod

Liam Nichols 0 Dec 31, 2021
🧸 Xcode Playground management made easy

Toybox Toybox made easy to manage Xcode Playgrounds. You can create and open Xcode Playground from CLI. $ toybox create Snippet # Generate ~/.toybox/S

Kohki Miki 130 Nov 8, 2022
a playground app using `MultipeerConnectivity` to transfor data wirelessly between iOS / iPadOS

README An example app using MultipeerConnectivity to transfor data wirelessly between iOS / iPadOS. Both using Data and Stream to transfer data are su

null 3 Aug 6, 2022
Appwrite playground - a simple way to explore the Appwrite API & Appwrite Apple SDK

Appwrite's Apple Playground ?? Appwrite playground is a simple way to explore the Appwrite API & Appwrite Apple SDK. Use the source code of this repos

Appwrite 24 Nov 22, 2022
Kushal Shingote 1 Feb 2, 2022
A navigation frameword based on the Coordinator pattern and is a compact version from XCoordinator.

Coordinator A navigation frameword based on the Coordinator pattern and is a compact version from XCoordinator. Example To run the example project, cl

Duc Pham 3 Jul 9, 2022