Help with joystick events

Hello all-

I am creating a game that involves a character moving around the screen, being controlled by a joystick (the one that is built in).

I need it to be that when I release the joystick the character’s linear velocity (on the x-axis) is set to zero.

Please help as I need to find some sort of “joystick on-release” type thing.

Thanks!

[import]uid: 35210 topic_id: 6983 reply_id: 306983[/import]

You will need to implement a timed position sequencer. And the sequence is filtered/analyzed on every frame to know what the last position(key) is and what the current position is.

What I do is to have a bunch of numbers to represent a position:

000
010 Neutral position
000

100
000 Up and Left Pressed
000

Obviously, pressure is important which is based on timed repetition of a particular position. The longer the repetition, it means the longer the player is holding that position.

Does this make any sense?

Anyways, there might be other ways but…this is my way.
[import]uid: 6066 topic_id: 6983 reply_id: 24764[/import]

You will need to implement a timed position sequencer.

And how might I do this? Honestly i’ve never even heard something like that.

By the way I am looking for something that could analyze where a move-able character is at any given time (like if he falls to a certain spot = death) as well (like you said, checking this every “frame” of the game). [import]uid: 35210 topic_id: 6983 reply_id: 24766[/import]

haha, well mine is from experience when i was building something for the upcoming kof world, developed in china.

its how proper joystick mimicks are done in fighting games like street fighter, kof etc. [import]uid: 6066 topic_id: 6983 reply_id: 24769[/import]

If you dont mind would you please share some code of how to use this “timed position sequencer” [import]uid: 35210 topic_id: 6983 reply_id: 24773[/import]

There is a whole joystick lib in the code resources. [import]uid: 5712 topic_id: 6983 reply_id: 24844[/import]