Y
Y
Yura Istomin2015-01-24 14:12:04
Objective-C
Yura Istomin, 2015-01-24 14:12:04

How to create character movement in spritekit?

I want to create a platformer game on spritekit (objective-c). When you hold your finger on the "forward" button, the character should move forward. How to implement it? What methods to use? Do I need to use SKActions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2015-01-24
@VahaJaha

void Update(float dt)
{
if (KeyPressed('Forward'))
unit.x+=1*dt;
}
Here's an example in pseudocode. You can also use vector math. If you have such questions - go study the tutorials and the manual for the engine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question