Today we make one of the first games ever made: Pong. It’s a great project especially for beginners or those just getting started with SpriteKit. Enjoy!
Project Files – https://github.com/Archetapp/Pong
Intro/Outro Song – https://soundcloud.com/adhesivewombat/adhesivewombat-8-bit-adventure
Have a tutorial idea? Write it down here! 😀 – http://bit.ly/ArchetappIdeas
~Social Stuff~
Nooma – https://www.nooma.tv/n/JaredDavidson
Patreon – http://www.patreon.com/archetapp
Website – http://www.archetapp.com
Twitter – http://www.twitter.com/archetapp
Snapchat – archetapp
Donate (Thank you!) – https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XCX6T4UPC96ES
Donate (Thank you!) – https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XCX6T4UPC96ES
Where is the code that changes the speed of the ball?
Finn the Human programs…
excellent tutorial… There are several changes needed if you are using Swift 4 and Xcode 9, the least intuitive one was the fact I needed to define the border as: border.categoryBitMask = 1
Right now at the end of part 1, my ball tends to get stuck in an endless loop when it gets trapped behind a paddle (either at the very top or very bottom) — I’ll continue with part 2 before I tackle that…
This is my first experience with SpriteKit, I was writing a conventional UIKit-based app when it occurred to me that a behavior I desired for a screen object was something that SpriteKit would give me for less effort than programing it from scratch… This tutorial is an excellent hands-on introduction. Thank you!
I copied everything exactly but ended up with an error in my game view controller, I didnt add anything to it so I was quite confused. Anybody else have this issue?
Go download my new free and addictive app, Paper Plane Flappy Flight on the App Store.
Link: https://appsto.re/us/Mz_Hlb.i
The game is similar to Flappy bird but with added gameplay features and a new look. This is my first ever app and if any of you would be willing to download and play it, I would greatly appreciate the support. Also if any of you can beat the current high score of 27, send me a screenshot of your new high score and I’ll give you a shoutout on my instagram page!
anyone else getting Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value when you try to run the code, it keeps popping up for the ball variable
Hey Jared! Thanks for these tutorials man you’ve helped me make my first game!! it just got released into the app store actually; here it is if you wanna check it out!! https://appsto.re/us/jKpBkb.i
Can’t figure this out.
fatal error: unexpectedly found nil while unwrapping an Optional value
(lldb)
For someone starting out brand new and really want to learn code. Where can I start with Swift? In the beginning of the video you deleted most of the code and kept a few lines, for me that’s confusing not knowing what you deleted and what you kept. And also the code you left . What does it do? Why is that important.
hi my ball doesnt bounce off the walls whats the problem?
Thank You, this was a pretty simple video to follow. A great way to start and practice.
Once I am done coding the second time, my ball glitches and goes strait down, and lags
Maybe its because of an xcode or swift update or something but after going over everything several times i can’t get the ball to bounce unless I check affected by gravity. also the ball seems to be slow yet I’ve set damping to 0 & 0 and restitution is set to 1 on the ball and the border in code just like yours.
Do you do calls? I need too call you.
Great tutoria!
Just one question, the ball moves but when it hit my bar or the enemy the ball sticks to the bars. What is the problem?
Using Xcode 9
ahah thanks. I got stuck with my ball not moving and then I realized that I had set ball = self.childNode(…) x3 3 times. I changed it to ball, enemy, main = and the ball started bouncing around thanks!
What does the “Expected declaration” error mean on line 26: “ball.physicsBody?.applyImpulse(CGVector(dx: 20, dy: 20))”
The bottom line of code fucked me at the end. Neither of us altered it.
Great tutorials, but stop saying “go ahead” so much haha. a little annoying in the long run imo
When i try to run it says thread 1: fatal error: unexpectedly found nil while unwrapping an optional value
Please help
As someone who is just trying Xcode for the first time with this video, think you are a little bit too quick and had to jump around to make sure I followed, not a criticism just feedback :). Was very informative and got it to work. Thank you 😀
Hi, for me, it’s not working… the ball is really slow, stick to my left border and fall down to my bottom border… and stay …
After like 3 tries and almost quitting once, I have done it!
Al
Yay!!
Don’t quit people! I did it in Xcode 9 and Swift 4. So yeah! This tutorial as I doubted is not outdated!
But I want to know what those masks are.. I didn’t understand whats the use of them
Thank you Jared!
Bye
2018©
any alternative for pixelmator
Thank you Jared for this interesting video!)
And to another people, if your ball didn’t move to fix it you need in file GameViewController.swift change that line “if let scene = GameScene(fileNamed: “GameScene”)” SKScene() to YourNameScene (example — GameScene()!)
And it’s work!
This is the best Xcode tutorial I’ve ever seen
want one special video after your 50K subs. will not take long
I can do the code but the game doesn’t show up beside the assistant editor, so I can’t edit the ball so it goes faster, please someone help
I really need help! The impulse does not work and the ball’s physics body is set as dynamic. I set a breakpoint in the didMove(to:) function and it wasn’t even called! In fact, nothing in my GameScene is ever called in runtime. Anyone’s any idea?
Hi jared You make really good video but they’re question in your comment that you need to answer. I have a problem to with that tutorial, When I start the game I only see my ball going around I don’t see anything else. I revise your video twice and theirs nothing wrong also my ball is slowing down can you help me please?
Dude I’ve been searching for hours and no tutorials have made sense and then I found this, this was AMAZING it will help me soooo much in my start to game development!
when I ran the app my ball didn’t move at all
is there any way to make the ball faster?
How do put an app icon?
Nice down and dirty tutorial. Quick clear and to the point. I’ll be watching the rest, thanks!
Into: Looks like Utah mountains to me… Nothing but mountains in Utah.
Reallyyy easy to follow
How do I do this on xcode 9
how do I get rid of the blue rings around my balls
Nice way to start spritekit, doesn’t overwhelm you with other things I would I want to do in the future
i did the exact same thing but yet my ball is not moving at all
by the way love your videos Jared
Awesome !
What photo editor did you use?
For everyone who is having trouble making their ball move: under the ball’s physics definition, check dynamic. If a physics body is not dynamic, then impulses and forces don’t work. Read more: https://developer.apple.com/documentation/spritekit/skphysicsbody