سؤال

I would like to have an SKSpriteNode start to fall when the screen is not being tapped(like in flappy bird). I have SKActions that move the object up which are called in the touchesBegan method and I would like the object to fall until the next tap or it hits the ground.

هل كانت مفيدة؟

المحلول

trying setting your gravity in the game to self.physicsWorld.gravity = CGVectorMake(0,-9.8); and setting your SKSpriteNode to dynamic.

test.physicsbody.dynamic = YES;

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top