Compare commits
No commits in common. "a7c0c45486ed3d129270a0c120a29a245e8be0d7" and "547e0f449ee28e19d20db933a2fe8c90e992ac51" have entirely different histories.
a7c0c45486
...
547e0f449e
|
@ -4,7 +4,7 @@
|
|||
[ext_resource path="res://src/models/enemies/bat/bat.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 4, 3 )
|
||||
extents = Vector2( 3.5, 3 )
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=2]
|
||||
extents = Vector2( 6, 4 )
|
||||
|
@ -19,7 +19,7 @@ script = ExtResource( 2 )
|
|||
use_parent_material = true
|
||||
frames = ExtResource( 1 )
|
||||
animation = "idle"
|
||||
frame = 1
|
||||
frame = 3
|
||||
playing = true
|
||||
centered = false
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
[ext_resource path="res://src/models/enemies/ghost/ghost.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 7, 9 )
|
||||
extents = Vector2( 5.5, 5.5 )
|
||||
|
||||
[node name="Ghost" type="KinematicBody2D" groups=["enemy"]]
|
||||
z_index = 2
|
||||
|
|
|
@ -13,30 +13,6 @@ var speed = 100
|
|||
var draw_node
|
||||
var bullet
|
||||
|
||||
func draw_dashed_line(from, to, color, width, dash_length = 3, cap_end = false, antialiased = false):
|
||||
var length = (to - from).length()
|
||||
var normal = (to - from).normalized()
|
||||
var dash_step = normal * dash_length
|
||||
|
||||
if length < dash_length:
|
||||
draw_line(from, to, color, width, antialiased)
|
||||
return
|
||||
|
||||
else:
|
||||
var draw_flag = true
|
||||
var segment_start = from
|
||||
var steps = length/dash_length
|
||||
for start_length in range(0, steps + 1):
|
||||
var segment_end = segment_start + dash_step
|
||||
if draw_flag:
|
||||
draw_line(segment_start, segment_end, color, width, antialiased)
|
||||
|
||||
segment_start = segment_end
|
||||
draw_flag = !draw_flag
|
||||
|
||||
if cap_end:
|
||||
draw_line(segment_start, to, color, width, antialiased)
|
||||
|
||||
func _process(_delta):
|
||||
if Input.is_action_just_pressed("shoot"):
|
||||
_shoot()
|
||||
|
@ -74,7 +50,7 @@ func _shoot():
|
|||
func _draw():
|
||||
if target != null:
|
||||
var dist2enemy = position.distance_to(target.global_position)
|
||||
draw_dashed_line(Vector2(12, 8), target.global_position - self.global_position + Vector2(8, 7), Color("ffde00"), 1)
|
||||
draw_line(Vector2(12, 8), target.global_position - self.global_position + Vector2(8, 7), Color("ffde00"))
|
||||
|
||||
func _physics_process(delta):
|
||||
get_input()
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
extends Node
|
Loading…
Reference in New Issue