Note that there are some explanatory texts on larger screens.

plurals
  1. POlandscape mode don't work properly in spritekit game
    primarykey
    data
    text
    <p>i started a platformer game in spriteKit and i have a little problem with landscape mode. When i make a jump with my hero, I use the </p> <pre><code>-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event </code></pre> <p>and while the hero it's in the air and collides with a wall or any object and miss his speed, then i use the </p> <pre><code>-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint positionInScene = [touch locationInNode:self]; SKSpriteNode *touchedNode = (SKSpriteNode *)[self nodeAtPoint:positionInScene]; CGPoint posicionHero = [self.world childNodeWithName:@"hero"].position; SKSpriteNode *touchHero = (SKSpriteNode *)[self nodeAtPoint:posicionhero]; //pragma mark -hero movement in the air if ((touchedNode != touchHero) &amp;&amp; (positionInScene.x &gt; [self.world childNodeWithName:@"hero"].position.x)) { [[self.world childNodeWithName:@"hero"].physicsBody applyImpulse:CGVectorMake(5, 0)]; } if ((touchedNode != touchHero) &amp;&amp; (positionInScene.x &lt; [self.world childNodeWithName:@"hero"].position.x)) { [[self.world childNodeWithName:@"hero"].physicsBody applyImpulse:CGVectorMake(-5, 0)]; } } </code></pre> <p>to keep that speed. I've been testing in portrait mode and everything were ok, but my game it's in landscape mode, so finally I have blocked the game to landscape mode, and now I'm testing it in landscape mode and I'm having troubles, because when I move my finger forward in a jump, nothing happens. Instead of this I have to move my finger upward, to get that movement. I'm sure i'm missing some basic configuration for my landscape mode. Any help will be apreciated</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload