Thursday, September 5, 2019

ios - How to move the object(tanker ) on slope image in chipmunk Spacemanager



I have used one polygon shape image (terrain)in my game its just like mountain and now i want to move the tanker on mountain path from one direction to other and then its turn on touching of the screne and move back and move like this continuously, i am not getting the method to move the tanker on slope(image) path in chipmunk spacemanager.


b.when collision detection happen like that if any bomb will fall on slope(image of mountain) then i want little damage on slope(image of mountain) like this video i want to please see this video for more details.


http://www.youtube.com/watch?v=vleq3Wa_jZs


i have used this code but my object(tanker) is following terrain path with rotation i want to just move like tanker moving and follow terrain path.


-(void)AddWheel
{
cpShape *localPlayerShape;
cpCCSprite *localPlayerSprite;

localPlayerShape = [mySpaceManager addCircleAt:[self GetStartingWheelPosition] mass:2 radius:7];

localPlayerSprite = [cpCCSprite spriteWithFile:@"enemy1.png"];

localPlayerSprite.shape=localPlayerShape;

localPlayerSprite.shape->group=kItemIsPartOfTheTankGroup;
localPlayerSprite.shape->collision_type=kItemIsPartOfTheTankGroup;

localPlayerSprite.shape->u=4.5;

localPlayerSprite.tag=100;


[mySpriteLayer addChild:localPlayerSprite z:15];
}

Thank waiting for you all reply .




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...