diff options
| author | Anson Bridges <bridges.anson@gmail.com> | 2022-09-04 14:57:56 -0700 |
|---|---|---|
| committer | Anson Bridges <bridges.anson@gmail.com> | 2022-09-04 14:57:56 -0700 |
| commit | a0967ebe815cd229b69fb9578f2288b95b2ddb28 (patch) | |
| tree | ce1b06b1d8226c64e3550d674df96a2308f18130 /scenes | |
| parent | 5dbe6302e437c5c1d4431b853c410aa1d52f9b3d (diff) | |
networked machine project. added broken airplane from previous project
Diffstat (limited to 'scenes')
| -rw-r--r-- | scenes/ballistics/Cannonball.tscn | 9 | ||||
| -rw-r--r-- | scenes/ballistics/Rocket.gd | 7 | ||||
| -rw-r--r-- | scenes/machines/Cannon.tscn | 2 | ||||
| -rw-r--r-- | scenes/vehicles/Airplane.tscn | 155 | ||||
| -rw-r--r-- | scenes/vehicles/Gunboat.tscn (renamed from scenes/boats/Gunboat.tscn) | 3 | ||||
| -rw-r--r-- | scenes/weapons/rockets.gd | 4 | ||||
| -rw-r--r-- | scenes/worldprops/battery.tscn (renamed from scenes/environment/battery.tscn) | 0 | ||||
| -rw-r--r-- | scenes/worldprops/dockscene.tscn (renamed from scenes/environment/dockscene.tscn) | 0 | ||||
| -rw-r--r-- | scenes/worldprops/housescene.tscn (renamed from scenes/environment/housescene.tscn) | 0 | ||||
| -rw-r--r-- | scenes/worldprops/islandscene.tscn (renamed from scenes/environment/islandscene.tscn) | 0 |
10 files changed, 166 insertions, 14 deletions
diff --git a/scenes/ballistics/Cannonball.tscn b/scenes/ballistics/Cannonball.tscn index 294548d..83c3942 100644 --- a/scenes/ballistics/Cannonball.tscn +++ b/scenes/ballistics/Cannonball.tscn @@ -3,11 +3,11 @@ [ext_resource path="res://scripts/ballistics/Cannonball.gd" type="Script" id=1] [sub_resource type="SphereShape" id=1] -radius = 0.15 +radius = 0.25 [sub_resource type="SphereMesh" id=2] -radius = 0.15 -height = 0.3 +radius = 0.2 +height = 0.4 radial_segments = 8 rings = 8 @@ -27,12 +27,11 @@ normal_scale = 1.0 normal_texture = SubResource( 5 ) [node name="Cannonball" type="RigidBody"] -collision_layer = 5 -collision_mask = 15 mass = 10.0 continuous_cd = true contacts_reported = 2 contact_monitor = true +can_sleep = false script = ExtResource( 1 ) [node name="CollisionShape" type="CollisionShape" parent="."] diff --git a/scenes/ballistics/Rocket.gd b/scenes/ballistics/Rocket.gd index 171a49e..46ca058 100644 --- a/scenes/ballistics/Rocket.gd +++ b/scenes/ballistics/Rocket.gd @@ -14,18 +14,15 @@ func _ready(): func get_init_info(): return {"linear_velocity" : linear_velocity, "angular_velocity" : angular_velocity, "life" : life, "shooter" : shooter, "shooter_id" : shooter_id} -remote func update_phys_transform(t, lv, av): - transform = t - linear_velocity = lv - angular_velocity = av - func _physics_process(delta): + print(global_transform.basis.x) if life < lifetime: add_central_force(global_transform.basis.x*strength) life += delta else: rpc("explode") $RocketTrail.emitting = false + remotesync func explode(): if cannot_explode: diff --git a/scenes/machines/Cannon.tscn b/scenes/machines/Cannon.tscn index 8126887..15f1467 100644 --- a/scenes/machines/Cannon.tscn +++ b/scenes/machines/Cannon.tscn @@ -49,7 +49,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.368354, 0.499951, 0 ) [node name="PitchJoint" type="Spatial" parent="YawJoint"] -[node name="MeshInstance" type="MeshInstance" parent="YawJoint/PitchJoint"] +[node name="Barrel" type="MeshInstance" parent="YawJoint/PitchJoint"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.355227, 0, 0 ) mesh = SubResource( 4 ) skeleton = NodePath("../..") diff --git a/scenes/vehicles/Airplane.tscn b/scenes/vehicles/Airplane.tscn new file mode 100644 index 0000000..2b46297 --- /dev/null +++ b/scenes/vehicles/Airplane.tscn @@ -0,0 +1,155 @@ +[gd_scene load_steps=14 format=2] + +[ext_resource path="res://scripts/vehicles/Airplane.gd" type="Script" id=1] +[ext_resource path="res://scripts/cameras/plane_armcam.gd" type="Script" id=2] + +[sub_resource type="PhysicsMaterial" id=1] +rough = true + +[sub_resource type="Curve" id=10] +_data = [ Vector2( 0, 0.119632 ), 0.0, 0.0, 0, 0, Vector2( 0.172819, 1 ), 0.0, 0.0, 0, 0, Vector2( 0.823825, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), 0.0, 0.0, 0, 0 ] + +[sub_resource type="CurveTexture" id=11] +width = 1024 +curve = SubResource( 10 ) + +[sub_resource type="ConvexPolygonShape" id=2] +points = PoolVector3Array( -1, 1.25, 5, 1, 1.25, -5, 1, 1.25, 5, -1, 1.25, -5, -1, -1.25, 5, 1, -1.25, -5, 1, -1.25, 5, -1, -1.25, -5, 1, 1.25, 5, -1, 1.25, -5, 1, 1.25, -5, -1, 1.25, 5, 1, -1.25, 5, -1, -1.25, -5, 1, -1.25, -5, -1, -1.25, 5, 1, 1.25, 5, -1, -1.25, 5, -1, 1.25, 5, 1, -1.25, 5, 1, 1.25, -5, -1, -1.25, -5, -1, 1.25, -5, 1, -1.25, -5 ) + +[sub_resource type="CubeMesh" id=3] +size = Vector3( 2, 2.5, 10 ) + +[sub_resource type="ConvexPolygonShape" id=4] +points = PoolVector3Array( -3.75, 0.75, 1, 3.75, 0.75, -1, 3.75, 0.75, 1, -3.75, 0.75, -1, -3.75, -0.75, 1, 3.75, -0.75, -1, 3.75, -0.75, 1, -3.75, -0.75, -1, 3.75, 0.75, 1, -3.75, 0.75, -1, 3.75, 0.75, -1, -3.75, 0.75, 1, 3.75, -0.75, 1, -3.75, -0.75, -1, 3.75, -0.75, -1, -3.75, -0.75, 1, 3.75, 0.75, 1, -3.75, -0.75, 1, -3.75, 0.75, 1, 3.75, -0.75, 1, 3.75, 0.75, -1, -3.75, -0.75, -1, -3.75, 0.75, -1, 3.75, -0.75, -1 ) + +[sub_resource type="CubeMesh" id=5] +size = Vector3( 7.5, 1.5, 2 ) + +[sub_resource type="BoxShape" id=6] +extents = Vector3( 0.1, 0.7, 0.7 ) + +[sub_resource type="CylinderMesh" id=7] +top_radius = 0.53 +bottom_radius = 0.53 +height = 0.2 + +[sub_resource type="CylinderMesh" id=8] +top_radius = 0.353 +bottom_radius = 0.353 +height = 0.2 +radial_segments = 15 + +[sub_resource type="BoxShape" id=9] +extents = Vector3( 0.724395, 1.80197, 2.26702 ) + +[node name="Airplane" type="VehicleBody" groups=["units"]] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00643909, 0, 0 ) +mass = 275.0 +physics_material_override = SubResource( 1 ) +can_sleep = false +angular_damp = 0.0 +script = ExtResource( 1 ) +roll_curve = SubResource( 11 ) + +[node name="wings" type="CollisionShape" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 2.28666, 0.689653, 0 ) +shape = SubResource( 2 ) + +[node name="MeshInstance" type="MeshInstance" parent="wings"] +mesh = SubResource( 3 ) + +[node name="fuselage" type="CollisionShape" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.562053, 0.213096, 0 ) +shape = SubResource( 4 ) + +[node name="MeshInstance" type="MeshInstance" parent="fuselage"] +mesh = SubResource( 5 ) + +[node name="leftwheel" type="VehicleWheel" parent="."] +transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 3.50873, -1.85594, -2.02883 ) +wheel_radius = 0.53 +wheel_rest_length = 0.1 +wheel_friction_slip = 2.0 +suspension_travel = 0.1 +suspension_stiffness = 200.0 +suspension_max_force = 400000.0 +damping_compression = 0.95 +damping_relaxation = 1.0 + +[node name="Area" type="Area" parent="leftwheel"] +transform = Transform( 1, -1.57356e-28, 0, 0, 1, 0, 0, -6.87825e-36, 1, 0, 0, 0 ) + +[node name="CollisionShape" type="CollisionShape" parent="leftwheel/Area"] +shape = SubResource( 6 ) + +[node name="MeshInstance" type="MeshInstance" parent="leftwheel"] +transform = Transform( -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0, 1, 0, 0, 0 ) +mesh = SubResource( 7 ) + +[node name="rightwheel" type="VehicleWheel" parent="."] +transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 1.57356e-28, -4.37114e-08, 3.50873, -1.85594, 1.83604 ) +wheel_radius = 0.53 +wheel_rest_length = 0.1 +wheel_friction_slip = 2.0 +suspension_travel = 0.1 +suspension_stiffness = 200.0 +suspension_max_force = 400000.0 +damping_compression = 0.95 +damping_relaxation = 1.0 + +[node name="Area" type="Area" parent="rightwheel"] + +[node name="CollisionShape" type="CollisionShape" parent="rightwheel/Area"] +shape = SubResource( 6 ) + +[node name="MeshInstance" type="MeshInstance" parent="rightwheel"] +transform = Transform( -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0, 1, 0, 0, 0 ) +mesh = SubResource( 7 ) + +[node name="rearwheel" type="VehicleWheel" parent="."] +transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -2.66361, -1.27391, 0 ) +wheel_radius = 0.353 +wheel_rest_length = 0.07 +wheel_friction_slip = 5.0 +suspension_travel = 0.05 +suspension_stiffness = 200.0 +suspension_max_force = 400000.0 +damping_compression = 0.95 +damping_relaxation = 1.0 + +[node name="MeshInstance" type="MeshInstance" parent="rearwheel"] +transform = Transform( -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0, 1, 0, 0, 0 ) +mesh = SubResource( 8 ) + +[node name="armcam" type="SpringArm" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.22602, 0.452069, 0 ) +spring_length = 15.0 +margin = 0.03 +script = ExtResource( 2 ) + +[node name="ClippedCamera" type="ClippedCamera" parent="armcam"] +current = true +fov = 79.2 +near = 0.12 +far = 8192.0 + +[node name="rightaileron" type="Spatial" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.02201, 0.827813, 5.17292 ) + +[node name="wingcenter" type="Spatial" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.02202, 0.828033, 0 ) + +[node name="leftaileron" type="Spatial" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 3.02201, 0.827813, -5.21093 ) + +[node name="tail" type="Spatial" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4.3164, 0.456713, 0 ) + +[node name="TugArea" type="Area" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4.58015, -0.728266, 0 ) +collision_layer = 131072 +collision_mask = 0 + +[node name="CollisionShape" type="CollisionShape" parent="TugArea"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.47757, 0 ) +shape = SubResource( 9 ) diff --git a/scenes/boats/Gunboat.tscn b/scenes/vehicles/Gunboat.tscn index 6678ac8..2e81bcd 100644 --- a/scenes/boats/Gunboat.tscn +++ b/scenes/vehicles/Gunboat.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=29 format=2] -[ext_resource path="res://scripts/boats/Gunboat.gd" type="Script" id=1] +[ext_resource path="res://scripts/vehicles/Gunboat.gd" type="Script" id=1] [ext_resource path="res://scenes/machines/Cannon.tscn" type="PackedScene" id=2] [ext_resource path="res://textures/planks.jpg" type="Texture" id=3] [ext_resource path="res://meshes/laetine_mask.obj" type="ArrayMesh" id=4] @@ -108,6 +108,7 @@ points = PoolVector3Array( 1, 0.174966, 1.25, 1, -0.175, 1.25, 1, 0.174966, -1.2 [node name="Gunboat" type="RigidBody"] mass = 13500.0 physics_material_override = SubResource( 28 ) +can_sleep = false linear_damp = 1.0 angular_damp = 1.0 script = ExtResource( 1 ) diff --git a/scenes/weapons/rockets.gd b/scenes/weapons/rockets.gd index fedeebd..56282e1 100644 --- a/scenes/weapons/rockets.gd +++ b/scenes/weapons/rockets.gd @@ -22,7 +22,7 @@ func attack1(): if cooldown_time <= 0.0 and ammo >= 1: ammo -= 1 cooldown_time = reload_time - rpc("add_rocket_to_scene", -1*player.cam.global_transform.basis.z, get_tree().get_network_unique_id()) + rpc("add_rocket_to_scene", player.cam.global_transform.basis, get_tree().get_network_unique_id()) remotesync func add_rocket_to_scene(dir, id): var rocket = preload("res://scenes/ballistics/Rocket.tscn").instance() @@ -30,7 +30,7 @@ remotesync func add_rocket_to_scene(dir, id): rocket.shooter = player.name + " (" + world.players_info[player.get_network_master()][0] + ")" rocket.shooter_id = id rocket.global_transform.origin = player.cam.global_transform.origin - rocket.global_transform.basis.x = dir + rocket.global_transform.basis = Basis(-1*dir.z, dir.y, dir.x) rocket.add_collision_exception_with(player) func attack2(): diff --git a/scenes/environment/battery.tscn b/scenes/worldprops/battery.tscn index f21b4d9..f21b4d9 100644 --- a/scenes/environment/battery.tscn +++ b/scenes/worldprops/battery.tscn diff --git a/scenes/environment/dockscene.tscn b/scenes/worldprops/dockscene.tscn index 6bf7f31..6bf7f31 100644 --- a/scenes/environment/dockscene.tscn +++ b/scenes/worldprops/dockscene.tscn diff --git a/scenes/environment/housescene.tscn b/scenes/worldprops/housescene.tscn index 5a60d0d..5a60d0d 100644 --- a/scenes/environment/housescene.tscn +++ b/scenes/worldprops/housescene.tscn diff --git a/scenes/environment/islandscene.tscn b/scenes/worldprops/islandscene.tscn index 6226569..6226569 100644 --- a/scenes/environment/islandscene.tscn +++ b/scenes/worldprops/islandscene.tscn |
