Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///shyguyStep(speed)
- //General enemy step event code
- //Allows horizontal movement
- if dead == false && domove == true //If we are not dead, and if we can move
- x += fric;
- //Checks if we are not on the ground
- if (!place_meeting(x, y+vspeed+1, par_platform) && !place_meeting(x, y+vspeed+1, par_platform)
- && !place_meeting(x, bbox_bottom+vspeed+1, par_slope)) or vspeed < 0 //If neither a solid, a topsolid or a slope is below us or we are moving up
- ground = false; //We are not on the ground
- //For the checks if we ARE on the ground, see enemyCollision()
- //Gravity
- if ground == false //If we are not on the ground
- gravity = _gravity; //Let the gravity work
- else if dead == false //Else, if we are on the ground and we are not dead
- gravity = 0; //Stop the gravity
- //If we are on the edges of the room, turn around
- if x < 3 //Left edge
- {
- x = 3;
- fric = abs(fric); //We are moving right
- }
- else if x > room_width-3 //Right edge
- {
- x = room_width-3;
- fric = abs(fric) * -1; //We are moving left
- }
- //If we are too high, let us stop
- if y < -10 //Top edge
- {
- y = -10;
- }
Advertisement
Add Comment
Please, Sign In to add comment