Joystick Cocos2D extension for iOS

Joystick Cocos2D extension for iOS

ZJoystick is a Cocos2D joystick extension for iOS. This component can be used to either iPhone or iPad that is easy to integrate on any of your applications.

ZJoystick is an iOS component designed to provide developers a ready made joystick they can use in their game apps. It mimics the actual joystick control that are used in games -mostly arcade games-.

ZJoystick is built using Cocos2D and is compatible to both iPhone and iPad.

How does ZJoystick work?

ZJoystick simply needs Sprites to represent Joystick container (Normal and Selected), the joystick control (joystick thumb) and the controlled object (sprite to move). ZJoystick also has options to set delegates, speed ratio and joystick radius.

  1. Normal Sprite - embodies the joystick rest state (normal mode) which means that the joystick is not yet used.
  2. Selected Sprite - embodies the josytick active state (selected mode) which means that the joystick is now being used.
  3. Controller sprite (thumb) - Embodies the joystick controller (thumb) which moves inside the Joystick container that defines the direction of the controlled object (the sprite to move using joystick).
  4. Controlled Object - Object to move everytime the joystick gets controlled.
  5. Speed Ratio - Determines the speed of the controlled object when controlled by joystick to any direction. This speed varies when the joystick conroller (thumb) varies its distance from the center of the joystick container.
  6. Joystick Radius - This is the radius of revolution of the Joystick Thumb (joystick controller) around the center of Joystick Container (is often the radius of the Joystick Container sprite).
  7. Joystick Tag - This is used within this protocol method -(void)joystickControlDidUpdate:(id)joystick toXSpeedRatio:(CGFloat)xSpeedRatio toYSpeedRatio:(CGFloat)ySpeedRatio to identify which joystick is controlling.
  8. ZJoystick has three delegate methods that gets called everytime joystick get controlled.
  • -(void)joystickControlBegan - gets called the moment joystick gets activated.
  • -(void)joystickControlMoved - gets called everytime the joystick is controlling.
  • -(void)joystickControlEnded - gets called the moment joystick gets deactivated (finished using).

See the complete tutorial on how to use the ZJoystick component here: http://zaldzbugz.posterous.com/first-article

You need to log-in or create an account
  • Create an account
  • Log-in

Please use your real name.

Activation link will be sent to this address.

Minimum 8 characters

Enter your password again

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

X

Save your watchlist

Fill your details below to receive project updates from your watch list - including new versions, price changes and discounts.

I agree to the terms of use and privacy policy.

License » MIT license Download
  • Nice one easy to integrate :-)
    K karthik
    1 year ago, 0 comments
    Was this helpful?
    Flag
  • Very Nice easy to use and saved a lot of time for me.
    D DaveKoz
    1 year ago, 0 comments
    Was this helpful?
    Flag
  • :)
    JM James McClymonds
    1 year ago, 0 comments
    Was this helpful?
    Flag
Post a comment

Or enter your name and Email
  • P Prasad 7 months ago
    How do i use it with ARC? Is it possible?