21 lines
428 B
GDScript
21 lines
428 B
GDScript
extends RigidBody
|
|
class_name BodyBase
|
|
|
|
|
|
export(int) var player_id
|
|
var ingame : bool = false
|
|
var ground : Spatial
|
|
var current_angle : float
|
|
|
|
|
|
func on_ingame():
|
|
ground = get_parent().get_node("Arena").get_node("ground")
|
|
ingame = true
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta):
|
|
if ingame:
|
|
current_angle = translation.angle_to(ground.translation)
|
|
print(current_angle)
|