In this tutorial you are going to create a SpriteKit Space Game that uses particle emitters for an animated star field and explosions. You are also going to use the iPhones accelerometer to move your player on the screen.
Check out Part 2: https://youtu.be/hirL1eDbum8
You are going to add a menu, the player is going to get lives and you are going to learn how to work with multiple SpriteKit scenes.
### SWIFT TUTORIAL CONFERENCE BUNDLE – OUT NOW ###
https://www.swift-tutorial-conference.net/#Bundle
Web: http://www.brianadvent.com
*** TUTORIAL FILES ***
https://github.com/brianadvent/SpaceGameReloaded
***COMMENTS***
If you have questions about the video or Cocoa programming, please comment below.
Amazon Auto Links: No products found.
Why did you shuffle the entire array of strings instead of picking a random number from 0 to 2 and indexing into the array? Shuffling strings randomly will increase the number of computational instructions required, putting an unnecessarily high burden on the battery life of the phone.
Plz help iy says hello world when i run it….
Hi. Thanks for the tutorial; very interesting and everything works fine for me. I was just thinking that in would be nice if the player (starship) could bounce off the edge of the screen and change direction instead of dissapearing and appearing on the other side. I tried but i can’t figure out how to make the player node interact (maybe with an impulse or a force) when it hits the edge of the screen. Tahank you.
got it finished and running on my device, this is a great tutorial
I have a problem with the starfield. when I run the app it shut down and I get a error called:
starfield.position = CGPoint(x: 0, y: 1472) thread 1: EXC_BAD_INSTRUCTION(code=EXC_l386_INVOP, subcode=0x0)
somebody a solution? Thanks!
Ive got a massive “Hello World” in the middle of the screen. How do I get rid of that??
my text isn’t showing up & my aliens are all stuck on the right side of the screen.
Can u do a video we’re you show us how to add multiple sprites in sprite kit
brian can you please do all the features matt did. I love your work much better and I think theres still lots more you could add to this game Please p.s i subbed
Spark png is not created when the action is created help.
Hey, great video. I just have the problem that my game does not end, even if I hit a planet or alien. Anyone has an idea on how to fix this? Thanks!
Hi brian love the video, Can you make an update to this on how to add lives so when an asteroid hits the ship you lose 1 of 3 andhow to add a high score, this game is really cool many thanks benjamin.
Hey man,
My name is Shahrose Mohsin and a CS major who only completed one intro course so far. I am really into app building especially with swift I discovered.
How did you learn this language? I
If you can give me any tips on to speed my learning process, it would be great.
I want to work as a app developer for a company and make apps on the side!
Really would love to see more that can be done with the Watch
particle file won’t work.mine is saying SpriteKit document version is newer than supported. please help!
Hey Brian i keep getting this error on the calling of the torrpedoDidCollideWithAlien function ,
fatal error: unexpectedly found nil while unwrapping an Optional value
Hello, and thanks for a wonderful tutorial!
Quick question – why do your image assets come in @2x and @3x in your project on github but not @1x? Is there a certain reason why?
How did you make your intro? did someone make it for you? I need to know!!
what the heck is a 0x1 << 1, also I am not too clear about the purpose of the category and what it does
Hi guy
You can make tutorial about chat messages of web telegram.org. Use API of telegram.org
Thanks you very much
Hey Brian, I am having the same issue as @slither… My shuttle is stuck on the right side of the screen. Anyone knows how to fix that? Thanks!
Hi brian i get an error ” argument of ‘#selector’ cannot refer to local function ‘addalien()’ any idea how to fix this ?
Thanks for this TUTORIAL , Now i understand how spriteKit work …nice work mate
If anyone has issues with the emmitter nodes not initializing. First of all make sure that you have NOT selected integrate Gameplay kit when starting the project and second. If you cant see the starfield in the background, either it is under the hello world title OR the gamescene.sks file is not hooked up properly. Just a heads up, spend like 3 hours figuring this out lol
I dont have an Iphone is there a way to test if the spaceships moves when you tilt the device
Excuse me, can you help me please!
I have a problem in swift, how can I download a file.mp3 on google drive in my ios app, I tried about 1 month but I’ve not found solution. I hope you will help me.
Thank you so much!
I keep getting “can’t assign value type CGPoint to SKEmitterNode!” right after “starfield =”
My didBegin(_ contact) method isn’t being called at all
how do i set the anchor point??? sorry for the trouble. I am not even old enough for dev program.
Brian, thanks for the tutorial. Maybe sometime you’d do a bit on radialgravityfield?
I opened the app to test it on my device but it just showed a grayish black screen. That was after I cut the “Hello World!” text out of the Game Scene. Please tell me what I’m doing wrong.
Hey. I just wanted to check, this is the first video in your swift playlist. It doesn’t seem like it should be the first video.
my aliens are moving so slowly, what is wrong with them?
Hi, Brian. Can you say what simulator are you using?
This was pretty cool. I have been trying to get into iOS development for the past few months and your channel really has helped me. Thanks a lot!
I have this problem where my torpedo bullets sometimes just fly through the aliens, and nothing happens, and sometimes explode and the score increases with 5 points. Any ideas on what the problem could be?
Hey Brian, could you please do a guide on how to implement Apples Maps applications favourites view. The one which is draggable and has three states (stick to bottom, middle or top).
I load success starfield on phone screen, but i can’t see shuttle when i load it. Can you help ?? Plzzz. Many Thanks
Why is the shuttle on the right side of my screen?
how can i put the iPhone D?
Where the Apple Watch Version link?
None of the positions worked in Xcode 9 and iOS 11.
+BrianAdvent Hey Brian Amazing tutorial! I did in in one siting! I kind of had to play with the position of the label the ship and the aliens but man, the fact that it was so easy to do, I am sure it is because the code is a well made and simple code! Thanks a lot man!
P.D. I wanted to add a while loop to run only for a minute, allowing the user to play within the loop (and also display the time left) if any one has any idea, help would be much appreciated.
hey can someone help. when I’m adding in the alien function:
” func addAlien () {
possibleAliens = GKRandomSource.sharedRandom().arrayByShufflingObjects(in: possibleAliens) as! [String]
let alien = SKSpriteNode(imageNamed: possibleAliens)”
the two functions say the following error:
“cannot convert value of type (String,String,String) to expected argument type [Any] / [String]”
Please help.