Quote:
Originally Posted by rensu
Hey guys
I need some advice
I have a very basic game in development and I am at the stage where I need to create a UI Joystick to control the main character. My idea is to have a circle for where your thumb will be placed. Around the circle is a small ball which goes around the circumference of the circle. This is to set the angle at which the play will jump. Can some one give me some advice as where to start and what to look into to achieve this .
My second problem is im not too sure how to add gravity to my game .
At the moment i have a collision detection which checks to see if the player is on a platform and if hes not then he continues to fall at a constant rate. WHen the player touches the screen the player needs to jump but at the moment he just teleports 20 pixels up into the air. How can I make it so the players sprite jumps realistically.
im not looking for code more advice and what to research into but any code would be greatly appreciated.
|
I advice you to use Cocos2d, and for collision\gravity use Chipmunk (or Box2d) that are physics engine
cocos2d for iPhone
I started using it recently and it is awesome, a great framework for 2d game developing on iphone
it include also a template to start using Chipmunk and Box2d. More info on cocos2d's forum and Chipmunk\Box2d 's forum. You can see Documentation and Forum as sources, if you want to support the author and speed up the learning process consider to buy Sapus Tongue Source Code (written by cocos2d's founder), you can see more info in cocos2d's site.
For Joystick you can use it
[joystick] SneakyJoystick 0.1! cocos2d for iPhone
I think that i will replace my own Joystick class with it, it is complete and flexible
Basically for a jump you will apply a force perpendicular to X axis, but it is not usefull that i post code, because you need to start reading about cocos2d and then about chipmunk (Scene, CCLayer, schedule, CCsprite , cpBody, cpShape and other arguments.)
Good Luck!