Hola amigos, hice un juego basico , el cual usa las teclas arriba, abajo, izq y derecha, lo quiero probar en mi tablet, pero claro debo pasar esos controles a controles para el tablet (android) y no se como hacerlo, existe algun manual que me pueda orientar en ese sentido. o algun ejemplo que pueda seguir.
muchas gracias a todos.
Bueno tú pregunta falta especificar un poco por ejemplo puede hacer una cruceta y los botones con sprite y cuando se toquen en la pantalla se haga su repuesta correspondiente y si te refieres a un gamepad debe de funcionar con las funciones de gamepad joystick que tiene game maker .
al final use este codigo y me puedo mover desplazando el dedo, se los dejo como aporte.. Muchas gracias
//(EN CREAR del player)
//More variables (device mouse)
sx = 0;//The point in the X axis that the player click on the screen
sy = 0;//The point in the y axis that the player click on the screen
sLong = 0;//The longitud of the mouse swipe
sDirection = 0;//The direction of the mouse swipe
swiped = false;//This variable tells us if the player has swipe or not.
//EN PASO a PASO del player
// @description The step event, where you can find all about the character movement
if global.playing = true//If the game controls are turned ON
{
if device_mouse_check_button_pressed(0,mb_left)//Click pressed on the screen
{
sx = device_mouse_x(0)//stores the X value of the mouse coordinates into the 'sx' Variable
sy = device_mouse_y(0)//stores the Y value of the mouse coordinates into the 'sy' Variable
}
if device_mouse_check_button(0,mb_left)//Click on the screen
{
sLong = point_distance(sx,sy,device_mouse_x(0),device_mouse_y(0))//Stores the value of the distance
//between the first time you clicked
//on the screen, and the actual position
//of the mouse (or finger)
if sLong > 10 //If the player Swiped more than 10 pixels
{
if swiped = false //If the player havent swipe
{
sDirection = round((point_direction(sx,sy,device_mouse_x(0),device_mouse_y(0)))/90)*90
//Stores the value of the direction
//between the first time you clicked
//on the screen, and the actual position
//of the mouse (or finger)
//It only returns 0, 90, 180 or 270 degrees.
if sDirection > 270 or sDirection < 90 //if the swipe direction is right
{
//Right
if place_free(x+1,y) && place_snapped(32,32)
{
sprite_index = spr_player_right;
direction = 0;
speed = v;
swiped = true;
}
}
if sDirection = 180 //if the swipe direction is left
{
//left
if place_free(x-1,y) && place_snapped(32,32)
{
sprite_index = spr_player_left;
direction = 180;
speed = v;
swiped = true;
}
}
if sDirection = 90 //if the swipe direction is up
{
//Up (Jump)
if place_free(x,y-1) && place_snapped(32,32)
{
sprite_index = spr_player_up;
direction = 90;
speed = v;
swiped = true;
}
}
if sDirection = 270 //if the swipe direction is down
{
//Down (Slide)
if place_free(x,y+1) && place_snapped(32,32)
{
sprite_index = spr_player_down;
direction = 270;
speed = v;
swiped = true;
}
}
}
}
}
if device_mouse_check_button_released(0,mb_left)//Click released on the screen
{
swiped = false; //the swipe becomes false
}
}
else
{
speed = 0 //If the game controls are turned OFF
}