cocos2d iphone - height of ccJumpTo function is decreasing? -


I am working on the Cocoa 2D version 0.9.3. I'm creating a demo game called Doodlemzep. Now when I'm creating an object to jump on the touch event, it will reach the next level.

I have defined this type of thigh height steadily.

actionTo = [CCJumpTo actionWithDuration: 1 position: CCP (Sprite image .position.x, 40 + 28) height: 110 jump: 1]; [Sprite image run action: action to];

It will jump right on the platform at 1 level, but when it will land on the platform at level 2, it will not leap its full height, but will jump very little in comparison to the previous jump. At Level 3 it will jump less than level 2 and similarly.

I think it will gradually decrease in height in the jump.

You need to change it:

  CCP (Sprite image.place.x, 40 + 28)  

do this To:

  CCP (Sprite image.position.x, Sprite ImageJass.C. 40 + 28)  

Overall, I did not really understand How CCJP works, it is very confusing and with me a little more time to jump higher or lower. I finished velocity using my own jumping code, it is done in an update method and kGravity is a constant (0.2f):

  velocity.y - = kGravity; Self.position = CP point build (position_x + = velocity x, position_. + Velocity.y);  

When you want to jump, you simply set the velocity, such as 10 for high value. And if the player is very fast, then just make sure that there is velocity. Some tweakable values ​​like -20


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -