/EDIT: A guy helped me in DM
The code he gave me:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
pi2 = 2 * math.pi path = './gfx/weapons/' item_list = { {name = 'galil_m.bmp'}, {name = 'ak47_m.bmp'}, {name = 'sg552_m.bmp'}, {name = 'scout_m.bmp'}, {name = 'awp_m.bmp'}, {name = 'g3sg1_m.bmp'}, {name = 'sg550_m.bmp'}, } center_x, center_y = 300, 200 radius = 64 rot_speed = 1 angle_diff = pi2 / #item_list -- угол между предметами -- просчитываем углы для каждого предмета + создаём картинку for i, item_tab in next, item_list do item_tab.angle = i * angle_diff item_tab.image = image(path .. item_tab.name .. '<m>', 0, 0, 2) end local dt = os.clock() timer(1, 'cycle', _, 0) function cycle() dt = os.clock() - dt for i, item_tab in next, item_list do local x = center_x + math.cos(item_tab.angle) * radius local y = center_y + math.sin(item_tab.angle) * radius imagepos(item_tab.image, x, y, 0) item_tab.angle = (item_tab.angle + rot_speed*dt) % pi2 end dt = os.clock() end
edited 10×, last 18.06.23 01:21:57 pm