Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slow motion in Sprite Kit iOS

Does anyone have any good ideas of how to accomplish a slow motion effect in Sprite Kit for iOS? This would make all nodes including particle nodes move at 1/2 the speed and also make the particles move that 1/2 the speed.

I can think of how to do this manually, but I wanted to get some more ideas before I start implementing.

like image 360
brilliantairic Avatar asked Nov 07 '13 14:11

brilliantairic


1 Answers

I believe you can do:

self.physicsWorld.speed = 0.5;

The docs reference:

speed

The rate at which the simulation executes.

@property(nonatomic) CGFloat speed Discussion The default value is 1.0, which means the simulation runs at normal speed. A value other than the default changes the rate at which time passes in the physics simulation. For example, a speed value of 2.0 indicates that time in the physics simulation passes twice as fast as the scene’s simulation time. A value of 0.0 pauses the physics simulation.

Availability Available in iOS 7.0 and later. Declared In SKPhysicsWorld.h

like image 137
joshd Avatar answered Oct 19 '22 04:10

joshd