View difference between Paste ID: d6DDMSP4 and XUjY6Ban
SHOW: | | - or go back to the newest paste.
1
STEP:
2
3
var dir = point_direction(x, y, mouse_x, mouse_y)
4
5
switch ((((dir + 22.5) mod 360) + 360) mod 360) div 45 {
6
    case 0:
7
        sprite_index = right;
8
        break;
9
    case 1:
10
        sprite_index = tr;
11
        break;
12
    case 2:
13
        sprite_index = up;
14
        break;
15
    case 3:
16
        sprite_index = tl;
17
        break;
18
    case 4:
19
        sprite_index = left;
20
        break;
21
    case 5:
22
        sprite_index = bl;
23
        break;
24
    case 6:
25
        sprite_index = down;
26
        break;
27
    case 7:
28
        sprite_index = br;
29
        break;
30
}