I 'm doing a adventure game.
For moving, i did so:
When i jumped and touched a wall, kept press right/ left arrow button, my character stand on wall as the result of colission solved by Box2d.
Keep press arrow button, my character continue standing on wall.
Release arrow button -> velocity.x = 0, my character fall down.
I also can't set velocity.x = 0 when touching wall. I will can't control my character go back when going on ground and touch a wall.
Anybody helps me? My character 's sharps as a capsule.
For moving, i did so:
Code:
-(void) tick: (ccTime) dt{
mainCharBody->SetLinearVelocity(b2Vec2(MovementX, mainCharBody->GetLinearVelocity().y));
....
}
mainCharBody->SetLinearVelocity(b2Vec2(MovementX, mainCharBody->GetLinearVelocity().y));
....
}
When i jumped and touched a wall, kept press right/ left arrow button, my character stand on wall as the result of colission solved by Box2d.
Keep press arrow button, my character continue standing on wall.
Release arrow button -> velocity.x = 0, my character fall down.
I also can't set velocity.x = 0 when touching wall. I will can't control my character go back when going on ground and touch a wall.
Anybody helps me? My character 's sharps as a capsule.