R
Ragedleinad
Guest
Hi team, well I have this object that is a enemy, for now I just want it to move left and right , each time its one pixel away from a wall it will invert it's velocity to have a negative value and viceversa
On the Create event I have:
On the Step event I have :
Should I have the same place_meeting but for left collition? if (place_meeting(x-1,y,obj_Floor)){
I made a gif -> https://gph.is/2H9itDZ
On the Create event I have:
Code:
objXVelocity = 5;
Code:
/*When hitting right wall I go other direction*/
if (place_meeting(x+1,y,obj_Floor)){
objXVelocity = objXVelocity * (-1);
}
x= x + objXVelocity;
Should I have the same place_meeting but for left collition? if (place_meeting(x-1,y,obj_Floor)){
I made a gif -> https://gph.is/2H9itDZ