From the course: Advanced iOS App Development: Core Animation
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Customizing emitter cells - iOS Tutorial
From the course: Advanced iOS App Development: Core Animation
Customizing emitter cells
- [Instructor] To actually give these fireworks some movement, we're gonna add acceleration to the X and Y direction of the cell. I wanna give this a pretty big boost up in the Y direction, so I'm gonna say fireworkCell.yAcceleration equals 100. But I also want it to sort of veer off to the side and eventually create an arc. So I'm also going to set the X acceleration to 15, so it's very slight. With acceleration added, we need to specify a velocity, which will get the fireworks firing just a bit faster when they're created. So I'm gonna say fireworkCell.velocity. And as the base, I'm gonna give it a value of 50. Let's save the app and run. And we should see our fireworks going up and arcing to the right a bit, and then falling and disappearing once their lifetime ends. Alright, so that's a good start. Next, we're gonna set the emission longitude of the cell, so that it has a defined orientation or direction when it's created. So let's say fireworkCell.emissionLongitude. And this is…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.