Would love some Swift Server side Perfect tutorials.
I really like the idea of dynamic sizing… it has been difficult for me to find, for example, how to just put a snow emitter background on a view that sizes dynamically… i’m sure it’s simple, but I’d like to see the pattern for it.
Yeah, strategies can be difficult from a programmer perspective, unless you have a full freedom on the design part, better ask the designer’s vision.
For a dynamically resizing SKEmitterNode, many strategies here, but the best is to subclass it and update it somewhere where the view changes (frame, size, etc).
I made a small example (not well optimised, just extracted some patterns from a game I made): Github Link
oh cool. I’ll have a look!
so basically, over those last few days, I’d learned a way to do it for snow falling, which basically looked like this:
let emitter = SKEmitterNode(fileNamed: "snow")! emitter.position = CGPointMake(view.center.x, view.bounds.height + 20) emitter.particlePositionRange = CGVector(dx: view.bounds.width, dy: 10) addChild(emitter) emitter.advanceSimulationTime(15) //when first shown, it's as if it were going 15 seconds.
so basically, I have to set the lifetime of the particles so that they keep falling until they reach the end of the rectangle they should be in… that’s kind of problematic to adjust for any kind of emitters that don’t necessarily have moving particles…
it definitely would be cool to be able to just have a function or subclass figure out what is necessary considering things like the speed or whatever…
then as i kept experimenting, I got to see a star field emitter which looks like this one:
backgroundColor = UIColor.blackColor() starfield = SKEmitterNode(fileNamed: "Starfield") starfield.position = CGPointMake(view.bounds.width + 10, view.center.y) starfield.particlePositionRange = CGVector(dx: 0, dy: view.bounds.height) starfield.advanceSimulationTime(15) addChild(starfield) starfield.zPosition = -1
basically in the emitter, the stars fall from right to left. it comes from project 23 at http://hackingwithswift.com
I was wondering when I first saw this emitter, how i could “change its speed” as the ship moved around, but it seems that just makes a mess, because the particles all come from one side and i’m not sure if there’s a way to “change the time flow” of an emitter so that it goes forward, backwards, stops, etc… but that would be cool, would it not?
not quite related, but just curious… is there a way to have multiple physics worlds in a scene for different objects? so for example, the player can be gravitationally attracted to a finger gesture, while all the other objects are obeying normal gravity? (or do i just use a field node and categories? hm)
I’d love to be able to play the videos at 1.2x, 1.5x, etc.
Nice to see you got a solution to your problem.
Have a look at what I’ve made for you, if you use it, it’s possible to have the subclass take care of itself, especially managing real-time rotations and size scale.
For advanceSimulationTime, basically you want it to be equal to your lifetime duration, that’s why I used the same variable for it (I hate magical numbers, so it’s better to have them set somewhere easy to manage).
If you use the enum, it’s possible to load many different particles, and have different parameters for each.
I haven’t tried to have multiple physical words before, just setting different physical properties to different nodes … So I guess using a field node can work, but also a state machine with many bitmasks or using GKBehavior … Honestly, endless possibilities and I’m unsure which is the best practice, maybe we get some complex game tutorial .
For the particles speed and so, it’s pretty much possible to do that. The easiest way is to have a reference of your frame (aka the distance particles should cross), then do any logical work by using the particles size, speed or time to get the correct parameters.
The code I shared is already in the perfect place for that (didChangeSize:), but you can use other parameters (in a Gundam game, I used player’s touches to increase particles’ birthrate, speed, angle and color blending options, to give impression of an engine thrust, as well as adding a smoke effect … Upon releasing the button, setting everything back to normal state without using advanceSimulationTime().
Hope this helps.
Side note: Maybe continuing the discussion on a separate thread would be better, to not hijack this thread’s main purpose.
More Metal physics tutorials!
I’d especially like to see more advanced physical effects such as fluid dynamics, bobbing and floating objects in liquids, oceans, water bobbing about, flowing through things… spraying… soft objects colliding and deforming, objects exploding realistically and also being torn apart. that kind of advanced stuff.
@rwenderlich Intermediate iOS Animations
I’d love to see a tutotial that distills what is talked about in this webinar and helps a beginning publisher to reduce or prevent click/tap fraud.
More Scene Kit, I just finished 3D IOS games by tutorials, I second the board game suggestion in Scene Kit, or something with tile maps.
I like the suggestion on Instruments. Also, a PaintCode series would be good.
I would love to see a tutorial on building messenger bots for Facebook or another platform. I’m not sure if it strays too far from the focus of the site but I think it is very interesting and relevant to mobile developers.
Firebase video tutorials.
I think one of the most useful and already endorsed by raywenderlich previously is RESTKIT . I really find annoying that such a basic yet powerful library has no updated documentation AT ALL … It would be nice to see how much it changed in Swift 2, the “right way” to install the library (due to uncounted eternal bug fights between cocoapods, restkit and xcode team) and the best practices to set up manger/services classes. Maybe im just old school and there is already something better/updated out there and I haven’t noticed yet. Anyways, thanks for reading this suggestion!
Swift Firebase video tutorial series can be really helpful to understand fastly in explanation way how to create database for a real world app and connected with special UI like pagination / pull to refresh topics. If It can be in raywenderlich.com that’s good preference. Thanks for all. I’m waiting and working with today’s tutorials.
I agree with jcubed. A PaintCode series would be awesome.
How about iPad specific gotchas? So much is focused on the iPhone in the world wide web. However, there are iPad centric concerns. For example… As opposed to the iPhone, perhaps the iPad with multitasking can be an issue for some apps.
As you know, “Multitasking in iOS 9 allows two side-by-side apps and the Picture-in-Picture window…” which is from
I would be interested in a tutorial that covers intermediate/advanced playgrounds, and how they might be tied to test driven development (if that is appropriate).
When playgrounds were introduced, there was a lot of coverage about how to use them (re:tutorials). Since their introduction, features have been added but I haven’t found any tutorials that have been updated to include those features.
In addition, I’m wondering if (as part of that series) there could be suggestions of how to use playgrounds vis-a-vis test driven development. Meaning - if you can import your objects/class into a playground and then use the playground to test or develop it, can’t you reuse your playground code in your testing code?
Please offer English subtitles
Thanks for the suggestions all! We definitely read all of these when considering what video tutorials we make next.
@hafizcoder We released an Intermediate iOS Animations series, hope you enjoy! https://www.raywenderlich.com/video-tutorials#intanimations
@jeremyd @jcubed We covered PaintCode in our recent Core Graphics series - w00t! https://www.raywenderlich.com/?post_type=post&p=133675
@ys_xs Good news - we do offer English subtitles! Just click the ‘cc’ button in the lower right of the video to see them.