File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,27 @@ func start():
16
16
$ Start .start ()
17
17
18
18
19
+ # 是否攻击过player
20
+ var is_bound = false
21
+
22
+
19
23
# Called every frame. 'delta' is the elapsed time since the previous frame.
20
24
func _process (delta ):
21
- position += delta * speed * direction * (1.0 if $ Start .time_left == 0 else (1.0 / 6.0 ))
25
+ # 没用过正常移动
26
+ if ! is_bound :
27
+ position += delta * speed * direction * (1.0 if $ Start .time_left == 0 else (1.0 / 6.0 ))
28
+ else :
29
+ position -= delta * speed * direction
22
30
23
31
24
32
func _on_out_screen_screen_exited ():
25
33
queue_free ()
26
34
27
35
28
36
func _on_area_entered (area ):
37
+ # 防止重复伤害
29
38
if area .name == "Player" :
30
39
area .get_node (".." ).hit (10 )
40
+ $ CollisionShape2D .set_deferred ("disabled" , true )
41
+ # elif area.name == 盾
42
+ # is_bound = true
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ func exit():
62
62
func nextOper ():
63
63
oper_num += 1
64
64
if oper_num >= opers .size ():
65
+ attack_finished .emit ()
65
66
return
66
67
opers [oper_num ].call ()
67
68
You can’t perform that action at this time.
0 commit comments