From d558a9add0e183219a7a9ff482807bdcd677e21a Mon Sep 17 00:00:00 2001 From: Anson Bridges Date: Mon, 11 Aug 2025 22:42:00 -0700 Subject: Initialize repo from local files --- scripts/Plane.gd | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 scripts/Plane.gd (limited to 'scripts/Plane.gd') 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. -- cgit v1.2.3