User Tag List

Results 1 to 4 of 4

Thread: Joystick 2 Object and "Repeat while <button> is pressed" (Negated)

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export Module

    Join Date
    Dec 2012
    Location
    Copenhagen, Denmark
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Joystick 2 Object and "Repeat while <button> is pressed" (Negated)

    So I figured out how to use the Joystick 2 object, almost without any problems. The thing is, I have a custom built platform engine using fastloops and a gravity variable.

    Here's the code I have which defines the speed of the jump and fall:
    +Gravity of "Player" < 10
    -Set Gravity to Gravity of "Player"+0.4

    And here's the code which defines the minimum jump height (as you can hold down jump to jump higher):
    +Repeat while "Z" is pressed (NEGATED)
    +Gravity of "Player" < 0
    -Set Gravity to Gravity of "Player"+1.65

    This works great when I use the keyboard, but if I use a controller input instead (using the Joystick 2 object), the player's minimum jump height is higher than when using the keyboard (ie. if he player taps the jump key, he won't jump as high).

    To clarify:
    +Joystick 1 button 1 is changed
    +Gravity of "Player" < 0
    -Set Gravity to Gravity of "Player"+1.65

    I've also tried the other Joystick options like this one:
    +Joystick 1 button 1 is pressed (NEGATED)

    That option does something different though, it barely lifts the player off the ground even when I hold down the jump button. Logically for me, this doesn't make sense as I thought a controller button would work the same way as a keyboard key.

    Is it because a controller's buttons work differently than a keyboard's, or have I done something wrong with the logic shown?

    Thank you in advance.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export Module

    Join Date
    Dec 2012
    Location
    Copenhagen, Denmark
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After some sleep and having looked at my code again, it seems like I hadn't actually tried all the joystick options... I thought I had.
    +Repeat while pressed joystick 1 button 1 (NEGATED) seems to work, now the player jumps as high when using a controller or the keys.

    Looks like I had just spent a couple of hours on something that I just needed a small break from.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export Module

    Join Date
    Dec 2012
    Location
    Copenhagen, Denmark
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Follow up question: It seems when using the Xbox controller, the Joystick 2 object only goes to 10 buttons (being the right analog click); does anyone know which buttons are the directional pad buttons and the trigger buttons? The help guide for Joystick 2 does not mention which button the numbers correspond to.

  4. #4
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you google Xbox Button Mapping you'll get resources explaining the different buttons.

Similar Threads

  1. How to achieve "While Button X" is pressed on OUYA?
    By Matriax in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 8th July 2013, 05:44 PM
  2. [Bug] "Repeat while left mouse-key is pressed"
    By Bipolar_Games in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 3rd February 2012, 11:36 PM
  3. equivalent of "repeat while key is pressed" condition in iOS?
    By 1234cb in forum iOS Export Module Version 2.0
    Replies: 5
    Last Post: 3rd November 2011, 05:34 AM
  4. Fixed - B1: "Repeat while mouse pressed" ignored
    By DavidN in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 14th September 2010, 01:35 PM
  5. Repeat while button pressed
    By Sarah in forum File Archive
    Replies: 7
    Last Post: 9th July 2007, 02:53 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •