Autor Tema: OUYA Joystick problem  (Leído 2298 veces)

JaViS

  • Global Moderator
  • *****
  • Mensajes: 1236
  • Karma: 26
    • Anarkade
OUYA Joystick problem
« en: Marzo 31, 2015, 05:50:51 pm »
I know we're all aware that we are not able to detect joystick "connection" during the gameplay, but I'm experiencing another bug, wich makes the game exit with an error.


So I'm posting this here hoping any other user gives it a try and tell me if he gets an error too, or if it's maybe my version of Bennu, or tell me if I'm doing something wrong.



Steps to reproduce the issue:


1. Connect 3 or 4 controllers in a different order that they were paired (i.e: 4,2,3,1)
2. Run the program
3. Click buttons and axes in different controllers to test the response.


expected output:


Buttons pressed and controllers id should be identified and shown on the screen.


actual result:


Joy id are shown wrong . Some times the app crashes.


Código: [Seleccionar]
import "mod_video"
import "mod_map"
import "mod_draw"
import "mod_say"
import "mod_file"
import "mod_text"
import "mod_wm"
import "mod_multi"
import "mod_mouse"
import "mod_joy"


GLOBAL




Process Main()
Private
// Set to your liking
dsx  = 600;
dsy = 800;
i,j,value;
string num_joys_text, joys_status[3];
Begin
    get_desktop_size(&dsx, &dsy);
scale_resolution = dsx * 10000 + dsy ;
scale_resolution_aspectratio = SRA_PRESERVE;

set_mode(640,360,16);
   

write_string(0, 320, 0, 2, &num_joys_text);
write_string(0, 320, 10, 2, &joys_status[0]);
write_string(0, 320, 20, 2, &joys_status[1]);
write_string(0, 320, 30, 2, &joys_status[2]);
write_string(0, 320, 40, 2, &joys_status[3]);


    while(focus_status)

num_joys_text = "Joys detected: "+joy_numjoysticks();

for (i=0;i< joy_numjoysticks();i++)
joys_status[i] = "Joy "+i+":";

    for (j=0;j < joy_numbuttons (i); j++)
        if(joy_getbutton(i,j))
                    joys_status[i] += " Button "+j+".";
                end
    end
   
    for (j=0;j < joy_numaxes (i); j++)
        if(joy_getaxis(i,j)<-20000);
                    joys_status[i] += " Axis "+j+" -.";
                end               
                if(joy_getaxis(i,j)>20000);
                    joys_status[i] += " Axis "+j+" +.";
                end
    end
   
    for (j=0;j < joy_numhats(i); j++)
        if(value=JOY_GETHAT(i,j))
                    joys_status[i] += " HAT "+j+": " + value;
                end
    end
end
frame;
end
End;
Working on Anarkade. A couch multiplayer 2D shooter.