mirror of https://github.com/profan/ld-39-jam.git
hmm
This commit is contained in:
parent
30b2420cbb
commit
a1da691f99
|
@ -9,9 +9,9 @@ func _ready():
|
||||||
set_fixed_process(true)
|
set_fixed_process(true)
|
||||||
|
|
||||||
func fire(delta, vel, dir, speed):
|
func fire(delta, vel, dir, speed):
|
||||||
velocity = (dir * (speed * delta)) + (dir * vel.length())
|
velocity = (vel.length() * dir + (dir * speed * delta))
|
||||||
sprite.rotate(dir.angle())
|
sprite.rotate(dir.angle())
|
||||||
|
|
||||||
func _fixed_process(delta):
|
func _fixed_process(delta):
|
||||||
move(velocity)
|
move(velocity)
|
||||||
lifetime -= delta
|
lifetime -= delta
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
extends Node2D
|
||||||
|
|
||||||
|
export(Array) var thrusters
|
||||||
|
|
||||||
|
func set_param(i, v):
|
||||||
|
for t in thrusters:
|
||||||
|
t.set_param(i, v)
|
||||||
|
|
||||||
|
func set_emitting(b):
|
||||||
|
for t in thrusters:
|
||||||
|
t.set_emitting(b)
|
|
@ -12,7 +12,7 @@ var mov_speed = 64 # pixels per second
|
||||||
var ship_vel = Vector2(0, 0)
|
var ship_vel = Vector2(0, 0)
|
||||||
var ship_max_vel = 100 # pixels per second
|
var ship_max_vel = 100 # pixels per second
|
||||||
var ship_accel = 25 # pixels per second.. per second?
|
var ship_accel = 25 # pixels per second.. per second?
|
||||||
var ship_turn_speed = deg2rad(360) # degrees per second.. i guess?
|
var ship_turn_speed = deg2rad(180) # degrees per second.. i guess?
|
||||||
var ship_dir = Vector2(1, 0)
|
var ship_dir = Vector2(1, 0)
|
||||||
var ship_mass = 61
|
var ship_mass = 61
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
extends Node2D
|
||||||
|
|
||||||
|
onready var right_one = get_node("RightThruster 1")
|
||||||
|
onready var right_two = get_node("RightThruster 1")
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
# Called every time the node is added to the scene.
|
||||||
|
# Initialization here
|
||||||
|
pass
|
|
@ -0,0 +1,15 @@
|
||||||
|
extends Node2D
|
||||||
|
|
||||||
|
onready var t_one = get_node("thruster_one")
|
||||||
|
onready var t_two = get_node("thruster_two")
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func set_param(p, v):
|
||||||
|
t_one.set_param(p, v)
|
||||||
|
t_two.set_param(p, v)
|
||||||
|
|
||||||
|
func set_emitting(b):
|
||||||
|
t_one.set_emitting(b)
|
||||||
|
t_two.set_emitting(b)
|
Loading…
Reference in New Issue