00:00
00:00
Newgrounds Background Image Theme

Dakale just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

[AS3] gamepad-based navigation?

348 Views | 3 Replies
New Topic Respond to this Topic

[AS3] gamepad-based navigation? 2014-09-21 16:00:52


heyo, NG

I've been recently trying to figure out how to go about a (street fighter based) character select screen. normally i make char select screens like super smash bros with the drag and drop, but that doesn't belong in a conventional fighting game such as Street Fighter or UNIB.

one way i guess i could go about it is by using a key listener and indexes, but the REAL problem comes when i think about multi-directional navigation; like, what if the player decides to navigate down? what if they go down left then down again? indexes definitely don't work in that situation.

i thought about using vectors and giving each selection properties of their own to figure out the surrounding buttons and move accordingly...but that requires like, at least 2 new classes to manage it all. or at least, afaik. i figured there must be another way.

do you guys have any tips on how i could go about this?

[AS3] gamepad-based navigation?

Response to [AS3] gamepad-based navigation? 2014-09-21 16:07:15


also, that image was actually a bad example, since the two rows are fairly aligned and indexes might work on that, but what about menu designs that aren't able to do that?

Response to [AS3] gamepad-based navigation? 2014-09-21 16:17:40


At 9/21/14 04:00 PM, PsychoZombii wrote: one way i guess i could go about it is by using a key listener and indexes, but the REAL problem comes when i think about multi-directional navigation; like, what if the player decides to navigate down? what if they go down left then down again? indexes definitely don't work in that situation.

Indices definitely work in that situation. Left is -1, right is +1, down is +row, up is -row. You have to account for wrapping around which is the only thing.

Response to [AS3] gamepad-based navigation? 2014-09-21 16:32:46


At 9/21/14 04:17 PM, MSGhero wrote: Indices definitely work in that situation. Left is -1, right is +1, down is +row, up is -row. You have to account for wrapping around which is the only thing.

wow i'm dumb. i didnt even think about indexing rows lmao.
maybe i'm just tired, i haven't had much sleep lately, thanks to college.
yeah, let's blame tiredness. i wont look as dumb that way :)

thanks man.