A few days ago my App was finally approved for the AppStore. It's been a great journey - learning new things and playing with tech that I haven't used before.
One of the things thats that happen with software development is that there is always room for improvement. The list of things to add becomes never ending - the trick is to chose to process your thoughts sequentially and prioritize tasks before starting them.
Some things that I completed since going live with version 1.0 are the following.
1) Added Coins to be collected when monsters are killed
2) Added Level Selector - that can handle an infinite amount of levels (e.g. paging).
3) Monsters can Shoot Back
I have started to look at what GameCenter is and what is provides. I believe that it would be good to be able to add a scoreboard to my app that allows people to compete. I'll ponder on this for the next few days, and probably create a new git branch to test the functionality.
It's been a few weeks since I've updated the blog. Yesterday i submitted my app to iTunesConnect for their perusal. It was relatively painless, apart from having to create the screenshots for all devices. It's an exciting time, because i have never actually got to the point where i have created a mobile app that i would like to publish on the
I merged my release branch into default, so that I can carry on adding more functionality. I've made a small list of things that I would like to add for the next release. I'm intending to do 6 week sprints - giving myself enough time to add new interesting things.
- Fix Level Selector to allow paging
- Pickup Coins for getting extra batteries
- Coins fly from player position to corner
- Show Score On Levels Screen
- Pick up battery sound
- Fire Sound
- Settings Button
- Switch Sounds Off
- Switch Adds Off
- weighted distribution (Monsters)
- Add Batteries
- After 10, can pickup head
- Monsters Fire
- Tick Next To Level
- Lock Next to Level (if all levels before haven’t been completed)
- Unlock Level With Coins
- Using Game center for Leadboards?
- Left Arrow Button (Level Selector)
- Right Arrow Button (Level Selector)
- Create Ramp
- Create New Jaws Like Monster
- Settings ButtonTick On Level when Level is completed
- Lock on Level when Level is not Completed
Code Tidy Up
Reflection for Levels -> http://swift.oz-apps.com/2015/04/creating-a-class-from-a-string-in-swift/
I've found that one of the main things that stops me from being productive, is when I do not set a clear plan for an evening / week. I open up XCode or Photoshop - or even youtube and it seems as though I blink and the whole evening has gone. I try to create a list of things up front so that I can prioritise what i would like to work on. While such a simple task of prioritising things - I'm almost certain a lot of other people struggle with complex problems because they do not break them tasks down into small manageable tasks.
Lately as i have had time, i have added coins to PhoneDash whereby the coins are added to each platform. Naturally, I have added sounds...or a pinging sound for when the coins are collected. Its changed the Dynamic of the game quite a lot.
Once in a while you have an idea of what would work well for something. I work with software in the day, and constantly have the fear that the code you write is not very flexible for your unit testing / Integration testing. It got me thinking of what would make the game flexible whereby it would be relatively easy to add new levels. My first thought was to store levels in a file somewhere, thus adding the flexibility of adding things quite easily. Sadly...the code that i have wrote it pretty much tightly coupled to the gamescene that I have created. I've seperated my skspritenodes into classes so they can be instantiated quite easily but the bulk of the game logic has gone into the update function.
My aim for this week is to make it flexible so that the scene will load up files from a directory and the allow the player to select each level. This will mean that I need to create some xml schema that the game abides by.
Having sat down on the sofa today, and did a little search - I found something called a plist (property list). I believe this to be the file that I can store my level data in. A quick brain dump of what should be in my levels resulted in the following that should translate to some level...how this works, I am not entirely sure. I know it's quite rough...but hopefully I am on the right path :)
The aim of this exercise is to make the game configurable so that all the logic is not coded into the scenes and every time a change needs to be done, the scene does not need to be added for a new level. Levels must be quite easy to add. :)
A quick google resulted in the following
I managed to get some game testers for my game, 11 testers in fact. Fortunately for me, I have quite a few people at hand that are able to test the game so I know the idea works well before promoting my app to production. While PhoneDash is very very far from being ready to be released, the aim of releasing a version to my friends was mainly to get some feedback on if the game is playable / boring.
My nephews have provided some invaluable feedback, primarily that the game needs to be a little more difficult, i.e. limit the bullets and maybe have some diversity for the monsters and platforms. My son, who is 7 at this time liked the game a lot...but he said there was something that was lacking...he wanted to have some kind of levels or some factor that increased in difficulty over time (obstacles in other words).
This weekend, I won't be adding much to the game...maybe only limiting the number of bullets to a set amount which would force the player try to try to jump over the monsters. This is of course quite difficult given that the players velocity is fixed on the x axis and the monsters speed is rather random. :D
My plan was to try and create some form of obstacle, however I managed to buy some spiced rum today so in all likelyness...i'll be too merry to be bothered to try and make something this weekend. HAHA
It's been a few days since I updated the blog, and have quite a few changes. To sum it up I have:
- Created An Icon
- Fixed Some Physics
- Only Allowed Dappa to move forward only when (!man.Jumping)
- Pause Button Positioning in the top-centre of the screen
- Introduced Fire Particle System when Jumping
- Changed Background
- Experimented With making Dappa Headless when his head collides with the ground
Alot has changed. In the picture, the explosion happened just as i pressed jump - however i wasn't quick enough to screenshot it. :)
Finally - I managed to sign up for the apple development subscription - which cost me 79GBP.
I started today off with a pretty shitty morning, I ended up having to call a recovery firm to come and pick me and my car up to drop me to work because my car conked out on the way to work. This evening I am going to pick up a car rental.
Later on this evening I am planning on working on the following.
Pause Button Positioning
Resume Button Sprite
- Resume Game When close
- Number Of plays
- Max Score
The statistics are something that will not be visible per se, but I would like to store the statistics of playing the game because I think I could use this at some point in the future.
While I would like to say that I am not taking this too seriously, I'm making a concerted effort to create something reasonably playable & enjoyable. I'm not a professional game developer, just a casual developer trying to learn new things while working away from home. I am putting quite a lot of effort into creating something thats specific to what I would play & ultimately able to put on the App Store. :)
I will ponder a little more of the requirements to put this on the App Store when it's complete.
With the weekend finally over and me working back down south. I've finally got a small chance to update the blog on what's changed. I can happily say that the kids enjoyed playing on the game, they found if a little difficult at first but happy that it worked...I mean it wasn't Minecraft, but was a game that can be played rapidly to pass boredom.
Last week, I wrote that I wasn't using applyimpulse - even though i was expecting the physics to 'just work'. After a little tinkering the sprites now move with a movement force applied to them. The tricky part is getting the physics to be realistic, so when applying a force to Dappa; he manages to move - but not quite how i wanted him to move. It appears that I wanted all the benefits of what a physics world brought me, but not have the problem of sprites rotating when a force is being applied to their physics body. Dappa has a bit of a complex shape, which when force is applied to him - rotates in ways you sometimes don't want.
Rather than trying to get down to the physics, I have made slight changes whereby Dappa will move at a constant speed according to his Mass, and i've change the accelerometer to be used to balance him when rotating while jumping. I've did a few checks to determine if Dappa's angular velocity is above or below an arbitrary value so the player can apply an AngularImpulse to balance him.
Things that I have done over the past few days
Allowed Dappa to Shoot Something, allowing the monsters to not kill him instantly (this does need more work).
Today has been a little slow, and haven't really done much. I was mainly figuring out how to do trivial things in Adobe illustrator. I ended up re-creating Dappa. The main thing that was done was making the wheels transparent.
Looks like i have a fair bit to learn about physics and movement. This evening i was working on
- Making Dappa's Wheel Chair Run out of Juice.
- Randomly Adding Battery packs to Charge Dappa's Wheel Chair
- Killing Dappa should his Wheel Chair battery life = 0
- Bouncing Dappa on the floor.
And noticed that how i was currently moving Dappa was incorrect, I wasn't applying any force vectors, just moving the sprite on an axis. This worked well for trivial things, however in a physics world...meh not so well. By using the ApplyImpulse i was able to affect dappa's velocity however bouncing on the floor appears to change the angle of the sprite causing Dappa to spin. I am not saying this is completely incorrect; however being able to control this would be useful.
I've updated the resources.
Sadly, I will resume more work next week now and eagerly await some feedback from the kids.
Today I worked on making the game never ending, essentially making the game loop create new platforms. It was pretty rudimental, whereby I kept the x position of the last platform that was created and compared the value to where the camera position is
camera position.x > last platform position.x - seporator value.)
create new platform and add to scene.
In the update func I call a function to create platforms based on some criteria of where the camera position is.
This causes the game to loop until you the player dies.
I have added the following things to the game so far:
Player is Killed by collision of Monsters
Game Score is shown when the player dies on game over score
Removing nodes from scene that are no longer in view
Randomly add monsters to platforms
All in all, the game is coming on and starting to feel like a real game now. I have experimented with SKActions on my sprites but will be adding some animations. Since this is only a test game, I am not trying to make the graphics absolutely crisp, however making them tidy is a must. I'll be show casing the changes in the game to my children over the weekend for their feedback.
Things to work on
Running out of battery
Collecting battery power
Factory pattern to determine what actions to add to objects/monsters/platforms
e.g. Spinning Platform, monster types
It's been a little while since doing any work on my game, since personal time is very limited as of late. I've been meaning to try and add some animations lately, or at least figure out how to do simple sprite animations. Today I started with creating a simple character using adobe illustrator. Since i'm doing everything pretty much off the cuff; i'll probably just leave this character in the game but may just tidy it up a little and maybe add a few more frames.
So far I've had a little play with putting the character in the game, however it doesn't do too much at the moment...it just winks. I think i'll be adding one of these monsters to each platform randomly and getting it to move backwards and forwards at different speeds to try and get the monster to make the game a little harder. With that said, there is still alot to tidy up as the orientation of the ViewControllers does not seem to work as i intend them to. Each time a player dies, i try to reload the viewcontroller but it appears that causes the orientation to flip from landscape to portrait. I think i may be doing something incorrectly. I'll work on this a little later as i'm going to concentrate on adding the monster to the game tonight.
I plan to have a busy week working on this in the evenings. This week I plan to:
- Stop Man From Jumping Twice
- Monsters Moving back and forward randomly
- Battery Life Up (increasing power)
- Battery Life Down (losing Power)
- Change Background - This is a problem with me repeating the 3 backgrounds to make it look like the play is moving across the screen.
- Remove Sprites when off screen - When the sprites are not visible, the sprites can be removed.
- Set Score On Game Over View Controller
Just a quick update. After a few hours of playing around, I've managed to get a game that kind of works. I'll show my kids the game a little later on today and see what their feedback is. The guy in the chair races across the screen and eventually falls off the edge.
Things that I have done so far
Score System (needs aligning a little)
Things that I am going to try in the future.
Add animation Sprites
Add some Characters to patrol the platform
Sort the battery life out for the scooter. At the moment it's fixed and does not run out.
Create a HUD - Not sure how this will work just yet as I'm still learning new things.
It will be interesting to see this develop into a working game which is kind of why the blog exists. A way of tracking back along a timeline and seeing it develop is an interesting concept.
Today I realised that it would be pretty neat to store some of the user settings in the phone app to maybe store the users score and where they got to should they close my game unexpectedly. After a little searching and checking the apple api documentation I found that there is a little database that is stored for each user called UserDefaults. You can store simple useful things here with very little code.
Some things may include User settings such as
- High Score
Generally things that would be a pain in the ass to enter each time my game runs.
let ud = UserDefaults.standard;
ud.set("my name is K", forKey: "name")
let ud = UserDefaults.standard;
if let obj = ud.object(forKey: "name")
I have attached as a much of the content that i have found while developing an IPhone game. Please feel free to leave comments and I will add further links the more that I progress developing a game.
Apple Api Documentation
https://developer.apple.com/reference/spritekit - I have referenced the SpriteKit api here, however all that is needed is on the Apple site. Sometimes it can be a little easier searching stackoverflow for answers before searching the api documentation.
Adobe Illustrator - useful for creating the sprites and scenes
Prepo - Useful for generating all your app icons in all the various size requirements that apple require. This can be found in the App Store.
https://www.raywenderlich.com/ - This will undoubtably be the most useful blog you will ever visit looking for Swift Resources.
These are the books that i found useful developing my own IPhone Game.
Mastering Swift 3 - Jon Hoffman
Swift Programming for absolute beginners - Arjan Egges
https://www.raywenderlich.com/89222/sprite-kit-animations-texture-atlases-swift - Great Tutorial on Animations in SpriteKit
Physics Joints - for Complex physics objects. e.g. (crashing car causes wheel to fall off)
GameCenter / Leaderboards
- At some point you may want to create a leaderboard in your app. This helped me a lot, and was super easy.
Last Updated (04-04-2017)
Welcome to my Blog. I am K and this is my development blog. Over the years I have saw mobile development progress to the point where I finally decided it would be pretty cool to develop my own mobile game.
I have almost no mobile development experience to date and certainly no IPhone Development experience. In the day I develop in .net and by night i am learning new things.
I will try and document as much as possible, raw idea's to rough sketches that i have done. Over the next couple of months I'll document the resources of things that I have used to learn.