I want to write a game, this game is a runner style, character climb up and down in hill.
My question,if I use box2d, I referred the giderios sample projfect "collision filtering",the ball always is up and down in ground ,how to implement to ball auto climb top height of hill, continue to move forward, not move back?
This is my favorite game:
https://play.google.com/store/apps/details?id=com.fingersoft.hillclimbvideo:
Comments
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
But what do you mean by auto climb?
http://www.giderosmobile.com/forum/discussion/2331/can039t-stop-character-sliding-down-slope#Item_1
Edit:
scratch that, thats completely opposite (still can view for some ideas)
In your case, I think what you want to achieve is going app the slope with same speed?
That's an interesting one. You can try two approaches:
Apply constant force and remove friction
Or as you've mentioned detecting when you are on slope and applying more/less force.
So what exactly gives you the problems? Detection of slope, calculation of force? Or just looking if there is any easier solution?
are u trying to make some what like tiny wings?
Likes: fxone
Actually, I'm newbie of box2d, so my question is very elementary, or very stupid,now I want to slove problems are:
1.how to detect slope,up,or down?
2. how to calculate body impulse? now I use body:applyLinearImpulse() method, has any better solution?
3. how to calculate and set character angle,when climb hill , body rotation 45 degree,down hill,body rotation -45 degree
4. how to remove bounce(jump more than once) of body when body land from air?
This is my test code:
on the touch it is increasing gravity and on release it is setting gravity to normal you also need to continuos chk whether the force on body is not slow then any desired amount if yes apply some linearvelocity or force in x direction only and let box2d to convert it accordingly.
for the rotation i think this code can help
and to remove the bounce i think setting restitution parameter to 0 for both hill and sprite will work
Likes: ar2rsawseen
http://www.raywenderlich.com/3913/how-to-create-a-game-like-tiny-wings-part-2
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
She is under orders not to leave the house today
Likes: techdojo
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
That would be so funny if wasn't too true far too often, especially with wives that seem to think their stuff is waaay more important.
Couldn't they deliver it to the office?
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
-> Align Sprite Axis to Vector
sorry to be on-topic
)
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive