I am quite a newbie to Cocos2D so please bear with me. It seems that I'm missing some basic understanding of actions. I searched this and other forums for days now but just couldn't find the missing link. Here's what I'm trying to do.
I have a main character (==AtlasSprite) who does a leap whenever he hits a platform (==Tile in a Tilemap). He should "ignore" the platforms while jumping UP, but react to platforms when falling DOWN again. After the jump is finished and there is no platform under his feet, he should continue to fall until he reaches the next platform. And of course you can change his X-direction all the time.
So: I tried to create a retained JumpBy Action that looked like this:
id jumpAction = [[JumpBy actionWithDuration:1.5 position:ccp(0 ,0) height:200 jumps:1] retain];
This Action is run on the maincharacter whenever his feet touch the top of a platform:
[mainCharacter runAction:jumpAction];
My questions:
1. How can I change my maincharacter's X-position while he is doing this jump? It seems to me that whenever this Action is running, I cannot control the main sprite's X coordinate because the action sort of overwrites that.
2. How can I find out when the maincharacter reached the top of his jump? I need to do the platform-collsions ONLY when he falls down. It seems to me that AtlasSprites have no velocity so they don't real "know" in which direction they are moving at all.
3. How do I implement the "falling" of the maincharacter after his jump is finished? I guess the easiest way would be to just decrease his Y-position statically every tick if he is not jumping. But that would require to know, exactly how fast he was moving down at the end of the JumpBy-Action (which again, I cannot figure out).
I know this sounds all very newbie, please be kind ;)