I made an actor event by doing Key Down, assigning a key, and then the script
xvelocity = x + 10;
I did this to make it go up, down,left and right but the ship flies off the screen. How do I keep it on the screen?
if(xscreen>view.width){
xscreen=view.width;
}
if(xscreen>view.width-(width/2)){
xscreen=view.width-(width/2);}
else if(xscreen<(width/2)){
xscreen=(width/2);}
ESL wrote:I made an actor event by doing Key Down, assigning a key, and then the script
xvelocity = x + 10;
I did this to make it go up, down,left and right but the ship flies off the screen. How do I keep it on the screen?
x=x+10;
x+=10;
Users browsing this forum: No registered users and 1 guest