Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- STEP:
- var dir = point_direction(x, y, mouse_x, mouse_y)
- switch ((((dir + 22.5) mod 360) + 360) mod 360) div 45 {
- case 0:
- sprite_index = right;
- break;
- case 1:
- sprite_index = tr;
- break;
- case 2:
- sprite_index = up;
- break;
- case 3:
- sprite_index = tl;
- break;
- case 4:
- sprite_index = left;
- break;
- case 5:
- sprite_index = bl;
- break;
- case 6:
- sprite_index = down;
- break;
- case 7:
- sprite_index = br;
- break;
- }
Add Comment
Please, Sign In to add comment