diff options
| -rw-r--r-- | Bullet.gd | 7 | ||||
| -rw-r--r-- | KinematicBody2D.gd | 2 |
2 files changed, 4 insertions, 5 deletions
@@ -9,12 +9,11 @@ var screen_size func _ready(): screen_size = get_viewport_rect().size + target = get_global_mouse_position() + velocity = global_position.direction_to(target) * speed + position += velocity * 0.05 func _physics_process(delta): - target = get_global_mouse_position() - if(Input.is_action_pressed("click") && shot == false): - velocity = global_position.direction_to(target) * speed - shot = true velocity = move_and_slide(velocity) for i in get_slide_count(): var collision = get_slide_collision(i) diff --git a/KinematicBody2D.gd b/KinematicBody2D.gd index 96484f3..3bbb3a9 100644 --- a/KinematicBody2D.gd +++ b/KinematicBody2D.gd @@ -2,7 +2,7 @@ extends Area2D signal hit var screen_size -export (int) var speed = 200 +export (int) var speed = 500 var spawn_object = load("res://Bullet.tscn") var velocity = Vector2() onready var globals = get_node("/root/Global") |
