sprite kit - Objective-C SpriteKit: What is the relation between values set in CGVector and actual International System of Units (SI)? -
The Apple Developer Guide, it says:
Sprite Kit International System of Units , Which is also called SI or Meter-kilogram-second system. Where necessary, you may need to consult other reference material to learn more about the physics equations used by
. I am developing a small game in which the user touches their screen.
Code
- (SKSpriteNode *) createBat: to the main menu, I want to keep flying over your bat up and down, I like to describe the harmonic oscillation ) Scale {SKSpriteNode * bat = [SKSpriteNode spriteNodeWithImageNamed: @ "bat_01"]; Bat.xScale = Scale; Bat.yScale = Scale; Bat.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize: bat.size]; Returning bat; } - (SKAction *) Action Squiwings {Returns [Sacking Runblock: ^ {[Self. Player.FixicsBody SetVeloCity: CGVectorMake (0.0 F, 450.0F)]; }]; } - (float) Taimtaurtain to Aenishiyl Pojisnafetrjmp {/ * code to spare characters original code to adopt = a, gravity / 2, B = Int Speed = 450.0 & amp; With Bhaskar C = 0 c = 0 Because I want to swing my bat to the wings when the last wing comes back to the swing position, the Bissaka function is tested and the correct value is coming back. * /} - (Skeaakshn *) Akshnsteshnri Flea {return [Skeapi repeat term: [Skesiadi sequence: @ [[Spi action Svivivings], [Skeakshn Prticshafordaureshn [Spi Taimtaurtaintaisnlpotiapanp]]]]]]; }
problem
The main idea is that Bhaskar function use, what to wait until the middle of each wing swing the bird to learn, but It is not working. I checked the calculation and the Bhaskar function is consistent. Bat behavior, on the other hand, is not there.
I choose Bhaskar for this application because I positionChange = initialSpeed * time + 0.5 * speedup * time * time, because physics Change tells us the formula when status = 0 and time> 0 , I need wing swing interval
For current values: gravity = -9.8; InitialVelocity = 450; My Bhaskar gives 91.8 returns, while the bat shows the desired behavior, when I set between wing swings between 0.6 (one wing swing for every 0.6 seconds).
Why does the system behave? If CGVactors represent SI, Apple says, should not the behavior of actual bat be as consistent with the calculations made on the basis of that speed and speed?
Comments
Post a Comment