I tried to set the Enemy.path_speed=0
and then set an alarm[0]=5, when it gets to alarm[0]
it simply set Enemy.path_speed=100
(the default value) again. But it does not work. enemies are frozen forever. How else can I freeze the enemies temporarily when I hit the space?
问问题
1678 次
2 回答
2
path_speed = 0
path_speed = 100
这不是一个好主意。例如,物体可以有不同的速度。我使用速度因子,例如正常速度为 1 speed = normal_speed * k
,k
完全停止为 0。
敌人创建事件:
spd = irandom_range(5, 10) // different speed, just as example
path_start(path0, spd, 1, true)
path_position = random(1)
k = 1
敌人步事件:
path_speed = spd * k
控制器空间按键事件:
with (o_enemy)
k = 0
alarm[0] = 3 * room_speed
控制器 Alarm0 事件:
with (o_enemy)
k = 1
并完成了gm-project
于 2014-05-26T04:58:49.483 回答
0
你只是设置了闹钟。你永远不会减少它。所以你的陈述永远不会是真的,因此物体不会移动。
于 2017-07-07T02:51:07.320 回答