B
B
BonnySmall2018-03-31 00:02:21
Objective-C
BonnySmall, 2018-03-31 00:02:21

Why does SKAction consume resources?

Why any activation of SKAction consumes a lot of CPU
Let's say that with a single action - such as moving the menu - it's not scary.
And let's say we make a background that moves behind the accelerator.
I catch the movement along the X, Y axis and then in the update block of the scene I write for each sprite

self.sprite0.run(SKAction.move(by: CGVector(dx: 100+destX, dy: 100+destY),  duration: 1))

If I set the conditions to update every 1/30 of a second, then the load does not particularly decrease. At 1/10 you can see jerks.
In the simulator, the CPU load is 100%
On iphone 8plus, the cpu load is 43%
I turn off run SKAction from update - the load goes away.
Similarly, if you run SKAction.repeatForever

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question