

Private var salt2 : Decimal = Decimal(string: "265984797")! Private var salt1 : Decimal = Decimal(string: "126549617")! I randomly typed a bunch of long strings with numbers: I created a simple system to ensure every game is the same and infinite. Then it can upload score to Apple Game Services. The game contains also infinite pseudo-random mode which spawns enemies for the infinite amount of time, till the player dies. Rectangular virtual colliders are used for this. This includes but it's not limited toīy the way, hit collisions are checked manually without usage if SpriteKit colliders. Then GameScene performed "AI" operations on every frame. So I had to watch them second by second and mark down the exact time, then spawn appears and also its speed, shooting pattern and move pattern. Creating those arrays was pretty tedious process, because I wanted the game to resemble the original as close as possible, and I had only a couple of YouTube walkthrough videos. Such objects are manually added to a collection and GameScene picks the correct on based on time. Var minionSpawner: (spriteOrAtlas: String, health: Int, minionSpeed: CGFloat, zigZag: Bool, score: Int, min: TimeInterval, max: TimeInterval)? = nil //like randomShootTimeIntervalRange, but with minions Var randomMissleShootTimeIntervalRange: (min: TimeInterval, max: TimeInterval)? = nil //like randomShootTimeIntervalRange, but with homing missles there is also possibility to move back for a while before charging Var charge: (interval: TimeInterval, hideBefore: Bool)? = nil //some bosses can charge and this is the flag for that. Var yOffset: Int? = nil //offset used for bosses in order to more preciselly restrict their move pattern

Var score: Int? = nil //score for destroying this enemy Var singleShootTimes: ? = nil //exact times when to shoot once Var randomShootTimeIntervalRange: (min: TimeInterval, max: TimeInterval)? = nil //similar as shootInterval, but randomized and with boundaries Var shootInterval: TimeInterval? = nil //time interval in ms for shooting Var health: Int? = nil //number of damage it can take Var moves: ? = nil //array of points where to move sequentially

Var y: CGFloat? = nil //initial y position Let type: SpawnType //enemy, powerup or boss Let time: TimeInterval //time when to appear Let spriteOrAtlas: String //visual representation I created a system, which spawns enemies and powerups based on some kind of prescription, which looks like this: There is one huge central class for that single GameScene, which holds references to everything happening on screen.Īt the beginning it sets up scene, backgrounds, ui and player. There is actually only one game scene and content is being loaded programmatically. That was caused by a couple of (almost identical) posts into appropriate reddit communities, which performed pretty well
#Play space impact code#
lines of code (excluding config and generated files, basically just.work amount - 34 days, hours not tracked, but probably first production release - 1st June 2021.You can figure out pretty exactly what to expect if you work on a similar project. This is an article, how the project went. I managed to complete it and the game is currently on Appstore. I decided to create almost an exact copy of old Space Impact game from popular Nokia phones from 2000's from scratch. This article is written on 6th October 2021. Intimate details of my slightly controversial project
