lilbit of progress (only instancin a single line with bullet

This commit is contained in:
Moonshrike
2021-11-15 12:25:46 +02:00
parent cb1fd92c7c
commit 0706f73970
4 changed files with 12 additions and 5 deletions

View File

@@ -153,7 +153,7 @@ func process_rotation():
func _process(_delta: float) -> void:
print(Global.get('control'))
#print(Global.get('control'))
# if Global.get('control')._on_line_pressed():
# enable_trajectory('line')
# if Global.get('control')._on_sine_pressed():
@@ -329,11 +329,19 @@ sync func shoot(new_trajectory:String):
func enable_trajectory_line(new_trajectory_line:String):
# var x = bullet_trajectory[new_trajectory_line].instance()
# #print(x)
# get_parent().add_child(x)
# x.global_position = shoot_point.global_position
# x.global_rotation = shoot_point.global_rotation
#for x in get_children(): #if there is gun remove it
#x.queue_free()
var x = bullet_trajectory[new_trajectory_line].instance()
print(x)
get_parent().add_child(x)
x.global_position = shoot_point.global_position
x.global_rotation = shoot_point.global_rotation
func enable_trajectory(new_trajectory_line:String):
for gun in get_children(): #if there is gun remove it

View File

@@ -9,7 +9,7 @@ var sine_button
var parab_button
var hyper_button
var global
var control = false
var control
var clientPhase = {
"0": {

View File

@@ -34,7 +34,7 @@ func _ready():
func trajectory():
clear_points()
while dot_position.x < 1000:
if pos.x > 0:
add_point(dot_position)

View File

@@ -18,7 +18,6 @@ var a_parameter = 0
func trajectory():
clear_points()
while dot_position.x < 1000:
add_point(dot_position)
velocity.y = 10 * a_parameter