Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Joystick button 'pressed'/released(GM)


Ironrind

Recommended Posts

I've been having trouble with programming a joystick for some time. What I want to do is create a code that will recognize if the the joystick button has been pressed since the last frame or not. Reason is, the insta-shield is executing as soon as the the player jumps. If the player is still holding jump after jumping, I want the jump button to have to be presses again to execute the instashield.

Also, I have the same problem for joystick 'key released' rather than 'not being pressed'.

I'm using Damizean and McDizzy's Sonic 360 Engine

Any ideas/techniques?

Link to comment
Share on other sites

try this:

Begin Step:

global.gamepad_button=input function; too lazy to look it up

global.gamepad_button_pressed=0;

global.gamepad_button_released=0;

if global.gamepad_button

{

if global.gamepad_button_pressed{global.gamepad_button_pressed=0 button_not_active=1};

}

else

{

global.gamepad_button_pressed=0;

button_not_active=0;

}

if global.gamepad_button_pressed && !gamepad_button

{global.gamepad_button_released=true;}

EDIT:

if your using gm7+, download tahnok's "gamepad extended" extention. It has the functions you need.

  • Like 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...