cocos2d for iPhone

A fast, easy to use, free, and community supported 2D game engine

Register or log in - lost password?
  • Blog
  • Store
  • Games
  • Documentation
  • Download
  • About

cocos2d for iPhone » Programming » cocos2d support (graphics engine)

[joystick] SneakyJoystick 0.1!

(37 posts) (11 voices)
  • Started 2 years ago by sneakyness
  • Latest reply from MCroswell

Tags:

  • .99
  • .99 final
  • autocenter
  • buttons
  • circle hit check
  • controls
  • Dead Zone
  • dpad
  • emulatePhysicalJoystick
  • Example
  • fast rect check
  • Feel
  • Frankenstein
  • Joystick
  • joystickRadius
  • joysticks
  • movement
  • Sama7
  • Sensitivity
  • sneaky
  • sneakyjoystick
  • Sneakyness
  • touchRadius
« Previous12
  1. sneakyness
    Member

    Good news everybody! I've just finished pulling in the last of CJ's changes to my work. This means we are successfully de-forked!!! :D

    @CJ, I'm glad you went back to "normal", but I don't like the thumb sticking out halfway like that, so I re-implemented the code from 0.1 that keeps the circle on the inside

    EDIT: that didn't do what I wanted. Bah! I'm not worried about it right now. I'm just throwing together an example for sneakyinput and calling it a day, with my half-outside joystick of fail.

    I'll be starting a SneakyInput on gitHub very soon. Expect a new forum posting. I'll be sure to post a link here, just so future googlers will know where to go.

    Posted 2 years ago #
  2. sneakyness
    Member

    Here it is! http://github.com/sneakyness/SneakyInput

    @CJ do you have any idea how to take what you've done and make it the most recent of SneakyJoystick? My Git-Fu is weak, and I don't have time to meddle around with that crap.

    It'd be neat if we could close this thread and make sure everybody goes to SneakyInput from now on.

    Posted 2 years ago #
  3. CJ
    Moderator

    @sneakyness, I really think the point made earlier that the joy radius should be the only radius used in touch detection/thumb constraint is valid. So if the thumb graphic goes outside the joystick graphic, no biggie because that is just the skin. Just tell the joystick radius to be smaller and keep the graphics the same :)

    Posted 2 years ago #
  4. sneakyness
    Member

    that's what I had tried setting, but it didn't want to play nice. That's what I had done before. I'll have a look at it again tomorrow when it's not monday. :)

    Posted 2 years ago #
  5. RomeoRx2
    Member

    Just want to say this JoyStick is great, and i am using it in the 2d side scroller i am making i just have one pretty stupid question, How do i keep the object that the joy stick controls on the screen.

    sorry for the silly question i am pretty new to Cocos2D

    Posted 2 years ago #
  6. sneakyness
    Member

    Well, there are a few different ways to do what you're asking, which are used for different reasons.

    Are you asking how to keep the camera centered on the object? Or are you asking how to keep the sprite within a certain bounds?

    For the second, the easiest way is to use min and max to impose limits on the current position of the sprite.

    Posted 2 years ago #
  7. MCroswell
    Member

    @sneakyness,

    Just wanted to say thanks for the code! I have it integrated into my game and using it as a four-directional dPad. I only modified some aspects for restricting the thumb to a smaller radius (for looks) while expanding the joystick radius (for larger input area).

    Again, much thanks!

    -Mike

    Posted 1 year ago #

RSS feed for this topic

« Previous12

Reply

You must log in to post.

cocos2d for iPhone is proudly powered by bbPress.