[Swift 2] Lesson 10?


#1

Hi, @PaulSolt. Not sure if you are already working on it, but I can only see lessons 10.1, 10.2, 10.3 and 10.4 (on particle effects). Maybe there was an upload issue or they are not finished due to Swift 1.2, just wanted to know. Thanks.


#2

I didn’t hit the publish button, sorry. I filmed 4 more videos for Day 10, they should be up now.

Working to upload more content today and add the challenge.

Did you have any issues with Xcode 6.3 Beta?

Apple just released Xcode 6.3 Beta 2, so you should download that. I’m also in the middle of releasing a new course that will detail additional changes as they happen


#3

The new website has an option to publish individual lectures, unlike the old which just put them online as soon I as added them.

Let me know what you think. I’m also experimenting with a set of short 5 minute videos that will become part of the Sprite Kit Tips series.

If you have any ideas for short topics, reply below.

Thanks @Fernando !


#4

Great! I can see them already. I was wondering how you did the rocket thruster effect… Now I’ll be able to do the same. :slight_smile: I’ll follow these lectures later on.

I don’t have any issues with Xcode 6.3 beta. Quite the opposite… I think Apple did a very good job on fixing those annoying crashing issues. It still crashes from time to time, but it’s much much better. Also your videos on fixing specific language issues help a lot. I’m going to download 6.3 beta 2 tonight. The playground is getting SOLID!

On suggestions for short topics:

  • Best practices on designing games with SpriteKit

  • MVC gets a little weird here (e.g.: UIViewController vs SKScene). I wonder what are your thoughts on how one should design a SpriteKit game (e.g.: considering the SpaceGame, should we separate the ship, asteroids and so on into different classes? We should avoid Massive-View-Controllers, should we avoid massive game scenes as well? Things like that. This could be short, I’m not suggesting an entire course on Software Development / Design Patterns, just best practices on SpriteKit. (There is something here, but practical examples are always better).

  • SpriteKit Scene Editor

  • This guy here created a very simple scene that demonstrates the potential of the SKS Editor. You are already using it to create those awesome particle effects. As far as I understood, we can create an entire game using the editor (ok, almost). It would be nice to mix the approach, i.e. using the editor to create the scenario, place the game elements like the ship, etc, instead of doing everything in code.

I’ll post more ideas as they happen.

It has been a fantastic ride. Thanks! :video_game:


#5

Great feedback. Yes I’m loving the new features in Xcode 6.3 beta 2. It’s hard because we’re on cutting edge, but I think it’s for the best.

Best practices

  1. The new videos will get into how to structure the UIViewController and the SKScene. Hopefully will get some of those online tomorrow (today if all goes well).
  2. To start, I wanted to teach the naive approach, as the best practices and all the extra rules can really complicate things (without a good answer to the question: Why am I doing this?)
  3. After you start to realize that there’s a ton of code, then it makes sense to start shifting code around to better organize it.
  4. When we get into the enemies I will be restructuring the code and providing more design insight, for the next few days it’s more about getting results quickly.

SpriteKit Scene Editor

I want to love this editor, and I do with the particle effects. It’s very effective, and I would like to demo some more advanced effects (some I’m not sure are possible in Sprite Kit, but I’ll have to dig deeper – in Cocos2D we had more control over particles using the Particles editor)

My experience with the .sks file as a level format or anything else has been frustrating at best. It is confusing when you add objects during or outside of a simulation.

  1. Changes made to an .sks file during simulation are reverted when stopped (I should file a bug report) without warning.
  2. There is no layers view like in PhotoShop or even the Interface Builder for apps. So I can’t find objects and modify them easily (I should file a bug report here as well).

Long story short, there’s neat effects you can play with, that’s a great link, but I don’t think it’s stable enough to trust. A long time ago (2008) I built a level editor for our Impulse physics game on Windows/Xbox.

I’d probably build my own editor instead of using Apple’s built in .sks support, but it might export to the same format, since I need more features to control the objects visually.


#6

Good stuff. Yep, comparing Xcode’s editor with other ones like you mentioned (I keep comparing it with Unity) is unfair, hehe. But I see what you mean. I also find it very difficult to find objects. Hopefully Apple will improve it to a point where we can create entire games inside Xcode. That would be awesome.

Your level editor looks great. :space_invader:


#7

Btw in regards to the particle emitter effects, I did a little trick that some might find useful. I wanted all my addons to be part of the SHIP NODE, but some to be underneath or partially visible. In order to do that I actually have 2 SpriteNodes from the ship image. The lower with Z = 1 , has Alpha of 0. So I am just using it as a shape and collision detector. Then I have anything I want on top of that and at the end I add the top, visible layer for the ship :wink: So it’s like a sandwich.


#8

Watch the new videos 10.5-10.8, I cover how to use SKNode to do this with better control. I’ll be going more in depth in the Day 15 or Day 16 videos with custom subclasses of SKNode.

@ravenshore Specifically watch 10.7: http://learn.iphonedev.tv/courses/make-iphone-games-with-sprite-kit-for-ios8/lectures/118864


#9

Just glanced over it, I’ll check it out when I get home, but I know what you mean. Ideally I wanted to use SKNode for the base, but was too lazy to change my code, so I just used a SKSpriteNode for base instead, otherwise it’s the same idea I think. Everything is a child of that one base-node. Btw For my truster I am changing the particles when moving, so I it looks more realistic, like it’s accelerating when moving :smiley: Just placed those in touches began /end etc…


#10

Great idea on the dynamic changes to the thruster!

There’s a lot of customization you can do, you just need to play with it. I find that one idea will lead to many more ideas.

After you get more comfortable, I would probably recommend thinking about the effects you want to use, and then how you might go about creating them.


#11

@Fernando sorry for the delay – looks like new videos will come tomorrow. Not enough hours in the day. Good news is that I’ve been super productive, but on some behind the scenes things (more announcements coming).

Question: Any issues with the SKEffectNode and the SKNode layering?

I’m working on the lessons for the Pause Menu still. I feel like I’ve been doing a little of everything since I switched my website to the new version.

Day 11 will cover:

  1. containment APIs with UIViewController
  2. Button styles
  3. Auto Layout for games
  4. Animations for screen transitions

I’ll be revamping how I exposed the UI in the GameScene, I’m not sure why I did what I did, but that’s not normally how I do it. The GameScene shouldn’t have to know anything about the UI. Instead the GameScene exposes the methods that will pause/resume (which we already implemented).


#12

It’s ok. Take your time. Quality over quantity. :wink:

I just finished lesson 10 and I also need some rest. Good stuff. This is what I ended up with:

So much fun! :joy:

I had no big issues so far.

Lesson 11 looks great. Auto layout + games was actually a suggestion I had. Cool!

Later! :video_game:


#13

Hi, Paul

I was actually able implement fully the UI, using XIBs.
It gets a little bit different when you want to have buttons, scores, icons …etc. in the UI…
But I got it to work just fine for now as a custom UIView that I can call on top of my scene. :slight_smile:


#14

Working to get my videos up today. I think you’re going to like it. Better than the approach I initially took with the pause button.

I really believe that the UI should be separate from the game itself. So I’m only going to be using methods on the game to pause/resume the game – instead of embedding the UI buttons into the GameScene.

Also you can do fun transitions with UIViewController containment (more to come soon!)

Here’s the mockup (blurring might not be possible – looking for a workaround right now).

@ravenshore I’ll be demo’ing it with Storyboard files, instead of .xib – so we can keep everything in one spot. It was a lot file management in Bomb Dodge when we did different .xib files for each screen (back then before Size Classes we needed separate iPhone/iPad files).


#15

Here is my current UI btw, it is kind of ugly but it’s functional :smiley:


#16

I love it!

Great work on that