Comunidad Game Maker

Ayuda => Preguntas y respuestas => Mensaje iniciado por: ivn_eze en Mayo 05, 2014, 01:18:34 AM

Título: Acelerometro
Publicado por: ivn_eze en Mayo 05, 2014, 01:18:34 AM
buenas.(estoy contento,hace mil años que no creo un tema  :D )
¿game maker puede detectar los movimientos del acelerometro de android?¿con que comandos?
Título: Re:Acelerometro
Publicado por: eams1986 en Mayo 05, 2014, 05:42:58 AM
Hola EZE mira a ver si te funka esto


en el evento create:
xvelo=0;
yvelo=0;

y en el evento step:
x += xvelo;
y += yvelo;

if device_get_tilt_x()<0
    if xvelo<4
        xvelo += 0.2;
if device_get_tilt_x()>0
    if xvelo>-4
        xvelo -= 0.2;   
if device_get_tilt_y()>0
    if yvelo<4
        yvelo += 0.2;
if device_get_tilt_y()<0
    if yvelo>-4
        yvelo -= 0.2;
Título: Re:Acelerometro
Publicado por: ivn_eze en Mayo 06, 2014, 01:13:50 AM
Cita de: eams1986 en Mayo 05, 2014, 05:42:58 AM
Hola EZE mira a ver si te funka esto


en el evento create:
xvelo=0;
yvelo=0;

y en el evento step:
x += xvelo;
y += yvelo;

if device_get_tilt_x()<0
    if xvelo<4
        xvelo += 0.2;
if device_get_tilt_x()>0
    if xvelo>-4
        xvelo -= 0.2;   
if device_get_tilt_y()>0
    if yvelo<4
        yvelo += 0.2;
if device_get_tilt_y()<0
    if yvelo>-4
        yvelo -= 0.2;
bueno, supongo que los comandos son:
device_get_tilt y yoyo_get_tilt, no?
Título: Re:Acelerometro
Publicado por: penumbra en Mayo 06, 2014, 02:04:45 AM
Aquí se listan los comandos
http://docs.yoyogames.com/source/dadiospice/002_reference/mouse,%20keyboard%20and%20other%20controls/device%20input/index.html (http://docs.yoyogames.com/source/dadiospice/002_reference/mouse,%20keyboard%20and%20other%20controls/device%20input/index.html)
Título: Re:Acelerometro
Publicado por: eams1986 en Mayo 06, 2014, 06:10:34 AM
Gracias Penumbra..