Joystick Cocos2D extension for iOS

Joystick Cocos2D extension for iOS

Released 3 years ago , Last update 3 years ago

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

4.6
  • 5 4
  • 4 3
  • 3 0
  • 2 0
  • 1 0
7 Reviews Read Reviews

Pricing

FREE

MIT license

The MIT license is an open-source license.

License » MIT license Download

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.


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