Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
x = choose(-random(100), room_width + random(100)); //Outside the left and right side of the room up to 100 pixels
y = choose(-random(100), room_height + random(100));
direction = point_direction(x,y,room_width/2,room_height/2);
speed = 2;
So basically what happens the choose() chooses either of the two values.
point_direction() starts from where enemy is, then points towards the center of the room
x = choose(-random(100), room_width + random(100)); //Outside the left and right side of the room up to 100 pixels
y = choose(-random(100), room_height + random(100));
direction = point_direction(x,y,room_width/2,room_height/2);
speed = 2;
So basically what happens the choose() chooses either of the two values.
point_direction() starts from where enemy is, then points towards the center of the room
x = choose(-random(100), room_width + random(100)); //Outside the left and right side of the room up to 100 pixels
y = choose(-random(100), room_height + random(100));
direction = point_direction(x,y,room_width/2,room_height/2);
speed = 2;
So basically what happens the choose() chooses either of the two values.
point_direction() starts from where enemy is, then points towards the center of the room
Sure, here is something that I tested and should work.
Code:
if irandom(1) == 0 {
y = choose(-random(100), room_height + random(100)); //Come from either top or bottom
x = random(room_width);
} else {
x = choose(-random(100), room_width + random(100)); //Come from either left or right
y = random(room_height);
}
Sure, here is something that I tested and should work.
Code:
if irandom(1) == 0 {
y = choose(-random(100), room_height + random(100)); //Come from either top or bottom
x = random(room_width);
} else {
x = choose(-random(100), room_width + random(100)); //Come from either left or right
y = random(room_height);
}