diff options
Diffstat (limited to 'scripts/Plane.gd')
| -rw-r--r-- | scripts/Plane.gd | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/Plane.gd b/scripts/Plane.gd new file mode 100644 index 0000000..62ffc43 --- /dev/null +++ b/scripts/Plane.gd @@ -0,0 +1,44 @@ +extends Area + +var starting_altitude:int = 0 # initial altitude for the turn, determines number of actions +var altitude:int = 0 # 0, 1, or 2 +var pos_x:int +var pos_y:int + +onready var meshes = [$Fuselage, $Cone, $Wings, $Tail] + +# bearings: E, NE, NW, W, SW, SE +const bearings = [ [0,1] , [-1, 0], [-1, -1], [0, -1], [1, 0], [1, 1] ] +var bearing:int = 0 # index of above list of potential bearings + +var destination_num: int # for display purposes only +var destination_col: Color # for display purposes only +var destination_id: int # determines above ^ + +var rotation_tween: Tween = null + +var plane_material + +func _ready(): + plane_material = load("res://resources/blank_plane_material.material").duplicate() + for mesh in meshes: + mesh.set_surface_material(0, plane_material) + + var new_col = Color(randf(), randf(), randf() ) + print(new_col) + set_color(new_col) + + +func set_color(color: Color): + plane_material.set_albedo(color) + +func _on_Plane_mouse_entered(): + $ActionIndicator.visible = true + + +func _on_Plane_mouse_exited(): + $ActionIndicator.visible = false + + +func _on_Plane_input_event(camera, event, position, normal, shape_idx): + pass # Replace with function body. |
