L
Lgmsfan
Guest
trying to achieve diagonal movement left right with mouse left.
Hi all i am trying to do diagonal movement with mouse left button
like in the android game called fly up but am not succeeding so i
ask for the wisdom of the GMC for help.
Thanks guys heres what i tried
//in create event
global.diagnal=2;//
//in step event
if (global.diagnal==2)&&mouse_check_button(mb_left){
script0()}
if (global.diagnal==1)&&mouse_check_button(mb_left){
script1()
global.diagnal=2;
}
/////////////////////////////////////////////////////////////////////////////////////////////
//in scrpts
//script0
y-=4;//go up if pressing global mouse left
x+=2;
global.diagnal=1;
//in scrpt1
y-=4;//go up if pressing global mouse left
x-=2;
global.diagnal=2
//in global mouse left button event
if (global.diagnal==2){
global.diagnal=1;}
else
if (global.diagnal==1){
global.diagnal=2;
}
//////////////////////////////////////////////////////
no doubt i have over complicated how to do this but i am at a loss
how to get diagonal movement like the game fly up
https://play.google.com/store/apps/details?id=com.codevl.flyup
so any help would be great thanks.
Hi all i am trying to do diagonal movement with mouse left button
like in the android game called fly up but am not succeeding so i
ask for the wisdom of the GMC for help.
Thanks guys heres what i tried
//in create event
global.diagnal=2;//
//in step event
if (global.diagnal==2)&&mouse_check_button(mb_left){
script0()}
if (global.diagnal==1)&&mouse_check_button(mb_left){
script1()
global.diagnal=2;
}
/////////////////////////////////////////////////////////////////////////////////////////////
//in scrpts
//script0
y-=4;//go up if pressing global mouse left
x+=2;
global.diagnal=1;
//in scrpt1
y-=4;//go up if pressing global mouse left
x-=2;
global.diagnal=2
//in global mouse left button event
if (global.diagnal==2){
global.diagnal=1;}
else
if (global.diagnal==1){
global.diagnal=2;
}
//////////////////////////////////////////////////////
no doubt i have over complicated how to do this but i am at a loss
how to get diagonal movement like the game fly up
https://play.google.com/store/apps/details?id=com.codevl.flyup
so any help would be great thanks.