From 37dbe271fed70e928a1e983ab506fb832742b79b Mon Sep 17 00:00:00 2001 From: Zenny Date: Sat, 2 Sep 2023 08:33:05 -0700 Subject: [PATCH] Tweak perspective, add bubble sprite --- Scenes/ShotgunBullet.tscn | 11 +++-- Scenes/TestBullet.tscn | 5 ++- Scenes/TestCharacter.tscn | 8 ++-- Scenes/TestLevel.tscn | 60 ++++++++++++++++++++++--- Scripts/TestCharacter.cs | 8 ++-- Textures/Projectiles/bubble.png | Bin 0 -> 476 bytes Textures/Projectiles/bubble.png.import | 35 +++++++++++++++ 7 files changed, 106 insertions(+), 21 deletions(-) create mode 100644 Textures/Projectiles/bubble.png create mode 100644 Textures/Projectiles/bubble.png.import diff --git a/Scenes/ShotgunBullet.tscn b/Scenes/ShotgunBullet.tscn index 7cb1b9d..bb34214 100644 --- a/Scenes/ShotgunBullet.tscn +++ b/Scenes/ShotgunBullet.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=6 format=3 uid="uid://bq40xbqibrk1y"] [ext_resource type="Script" path="res://Scripts/ShotgunBullet.cs" id="1_binxs"] -[ext_resource type="Texture2D" uid="uid://dpln8jwtpqru0" path="res://Textures/Projectiles/fireball.png" id="2_cl026"] +[ext_resource type="Texture2D" uid="uid://borp7xvlfdcmq" path="res://Textures/Projectiles/bubble.png" id="2_dv80m"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_5vpcx"] albedo_color = Color(0.584314, 0.0352941, 0.141176, 1) @@ -35,8 +35,9 @@ skeleton = NodePath("../..") shape = SubResource("SphereShape3D_o6kys") [node name="Sprite3D" type="Sprite3D" parent="RigidBody3D"] +pixel_size = 0.05 axis = 1 -texture = ExtResource("2_cl026") +texture = ExtResource("2_dv80m") [node name="RigidBody3D2" type="RigidBody3D" parent="."] transform = Transform3D(0.999848, 0, 0.0174524, 0, 1, 0, -0.0174524, 0, 0.999848, 1.32, 0, 0) @@ -55,8 +56,9 @@ skeleton = NodePath("../..") shape = SubResource("SphereShape3D_o6kys") [node name="Sprite3D" type="Sprite3D" parent="RigidBody3D2"] +pixel_size = 0.05 axis = 1 -texture = ExtResource("2_cl026") +texture = ExtResource("2_dv80m") [node name="RigidBody3D3" type="RigidBody3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.56619) @@ -76,5 +78,6 @@ skeleton = NodePath("../..") shape = SubResource("SphereShape3D_o6kys") [node name="Sprite3D" type="Sprite3D" parent="RigidBody3D3"] +pixel_size = 0.05 axis = 1 -texture = ExtResource("2_cl026") +texture = ExtResource("2_dv80m") diff --git a/Scenes/TestBullet.tscn b/Scenes/TestBullet.tscn index 281d9f8..59cd055 100644 --- a/Scenes/TestBullet.tscn +++ b/Scenes/TestBullet.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=6 format=3 uid="uid://si4byubqnng4"] [ext_resource type="Script" path="res://Scripts/TestBullet.cs" id="1_cavby"] -[ext_resource type="Texture2D" uid="uid://dpln8jwtpqru0" path="res://Textures/Projectiles/fireball.png" id="2_xa8hs"] +[ext_resource type="Texture2D" uid="uid://borp7xvlfdcmq" path="res://Textures/Projectiles/bubble.png" id="2_n5c16"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_phgri"] albedo_color = Color(0.584314, 0.0352941, 0.141176, 1) @@ -33,5 +33,6 @@ skeleton = NodePath("../..") shape = SubResource("SphereShape3D_rokeu") [node name="Sprite3D" type="Sprite3D" parent="RigidBody3D"] +pixel_size = 0.05 axis = 1 -texture = ExtResource("2_xa8hs") +texture = ExtResource("2_n5c16") diff --git a/Scenes/TestCharacter.tscn b/Scenes/TestCharacter.tscn index ab9ed84..84d45bb 100644 --- a/Scenes/TestCharacter.tscn +++ b/Scenes/TestCharacter.tscn @@ -6,18 +6,18 @@ [ext_resource type="PackedScene" uid="uid://yosw0j58nvrf" path="res://Models/Characters/fwitch.gltf" id="4_n3637"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_fqik1"] -radius = 0.152487 -height = 0.456443 +radius = 0.913688 +height = 1.82738 [node name="Character" type="CharacterBody3D"] -transform = Transform3D(1, 0, 0, 0, 0.884801, 0.46597, 0, -0.46597, 0.884801, 0, 0, 0) script = ExtResource("1_hddqi") _speed = 15.0 _fireProjectile = ExtResource("3_ojvu2") _altFireProjectile = ExtResource("3_5h4r7") [node name="CollisionShape3D" type="CollisionShape3D" parent="."] -transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, 0, 0.19703, 0) +transform = Transform3D(0.999665, -0.0258978, -7.10543e-15, 0.0258978, 0.999665, 0, 0, 0, 1, 0, 2.10024, -0.247215) +visible = false shape = SubResource("CapsuleShape3D_fqik1") [node name="Pivot" type="Node3D" parent="."] diff --git a/Scenes/TestLevel.tscn b/Scenes/TestLevel.tscn index 1e4b090..02733d4 100644 --- a/Scenes/TestLevel.tscn +++ b/Scenes/TestLevel.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=5 format=3 uid="uid://dy3d4e6qegyjg"] +[gd_scene load_steps=9 format=3 uid="uid://dy3d4e6qegyjg"] [ext_resource type="PackedScene" uid="uid://b38hcomu4tpm5" path="res://Scenes/TestCharacter.tscn" id="1_fwf6c"] [ext_resource type="PackedScene" uid="uid://bckd04543occ5" path="res://Levels/levelTEST.gltf" id="2_afl3s"] @@ -9,17 +9,31 @@ size = Vector3(77.2254, 10, 63.5656) [sub_resource type="BoxShape3D" id="BoxShape3D_hr26o"] size = Vector3(37.611, 23.269, 13.2547) +[sub_resource type="BoxShape3D" id="BoxShape3D_sjyl3"] +size = Vector3(100, 100, 18.6922) + +[sub_resource type="CylinderShape3D" id="CylinderShape3D_lhgew"] +radius = 1.42751 + +[sub_resource type="CylinderShape3D" id="CylinderShape3D_fa41j"] +height = 4.6719 +radius = 2.32337 + +[sub_resource type="CylinderShape3D" id="CylinderShape3D_krlem"] +height = 5.0 +radius = 2.06347 + [node name="Level" type="Node3D"] [node name="Camera3D" type="Camera3D" parent="."] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -0.0769171, 40.2411, -32.0601) +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -0.0769171, 36.4856, -32.0601) [node name="DebugCamera" type="Camera3D" parent="."] transform = Transform3D(1, 0, 0, 0, 0.821149, 0.570714, 0, -0.570714, 0.821149, -0.36148, 17.9168, 0.864431) visible = false [node name="Fish Witch" parent="." instance=ExtResource("1_fwf6c")] -transform = Transform3D(1, 0, 0, 0, 0.34202, 0.939692, 0, -0.939692, 0.34202, 5.26031, 4.56447, -7.95901) +transform = Transform3D(1, 0, 0, 0, 0.5, 0.866025, 0, -0.866025, 0.5, 5.26, 5.13104, -7.959) _speed = 10.0 [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] @@ -31,12 +45,44 @@ transform = Transform3D(-0.931845, -0.0850834, 0.35274, -0.0909281, 0.995857, -1 transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -36.9892) shape = SubResource("BoxShape3D_iokol") -[node name="levelTEST" parent="StaticBody3D" instance=ExtResource("2_afl3s")] - [node name="CollisionShape3D3" type="CollisionShape3D" parent="StaticBody3D"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 22.6611, 4.08253, -30.6854) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 22.5146, 4.08253, -31.0556) shape = SubResource("BoxShape3D_hr26o") [node name="CollisionShape3D2" type="CollisionShape3D" parent="StaticBody3D"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -22.9547, 1.81661, -31.6168) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -23.1248, 1.81661, -31.1077) shape = SubResource("BoxShape3D_hr26o") + +[node name="levelTEST" parent="StaticBody3D" instance=ExtResource("2_afl3s")] + +[node name="CollisionShape3D4" type="CollisionShape3D" parent="StaticBody3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 4.42545) +shape = SubResource("BoxShape3D_sjyl3") + +[node name="CollisionShape3D5" type="CollisionShape3D" parent="StaticBody3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.650528, -0.488932, -78.351) +shape = SubResource("BoxShape3D_sjyl3") + +[node name="CollisionShape3D6" type="CollisionShape3D" parent="StaticBody3D"] +transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 46.5847, -0.977863, -52.3885) +shape = SubResource("BoxShape3D_sjyl3") + +[node name="CollisionShape3D7" type="CollisionShape3D" parent="StaticBody3D"] +transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -48.9058, -1.95573, -5.80381) +shape = SubResource("BoxShape3D_sjyl3") + +[node name="CollisionShape3D8" type="CollisionShape3D" parent="StaticBody3D"] +transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -48.9058, -1.95573, -40.25) +shape = SubResource("BoxShape3D_sjyl3") + +[node name="CollisionShape3D9" type="CollisionShape3D" parent="StaticBody3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.93645, 5.82082, -21.6909) +shape = SubResource("CylinderShape3D_lhgew") + +[node name="CollisionShape3D10" type="CollisionShape3D" parent="StaticBody3D"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6.82773, 6.46042, -40.6232) +shape = SubResource("CylinderShape3D_fa41j") + +[node name="CollisionShape3D11" type="CollisionShape3D" parent="StaticBody3D"] +transform = Transform3D(0.999841, -0.0178538, 0, 0.0178538, 0.999841, 0, 0, 0, 1, -6.84036, 6.33278, -46.1737) +shape = SubResource("CylinderShape3D_krlem") diff --git a/Scripts/TestCharacter.cs b/Scripts/TestCharacter.cs index 7cf1622..d09e67c 100644 --- a/Scripts/TestCharacter.cs +++ b/Scripts/TestCharacter.cs @@ -37,12 +37,12 @@ public partial class TestCharacter : CharacterBody3D { velocity.X = direction.X * _speed; velocity.Z = direction.Z * _speed * 2; - GetNode("Pivot").LookAt(Position + direction, Vector3.Forward); + GetNode("Pivot").LookAt(Position + direction, Vector3.Forward + Vector3.Up); } else { velocity.X = Mathf.MoveToward(Velocity.X, 0, _speed); - velocity.Z = Mathf.MoveToward(Velocity.Z, 0, _speed); + velocity.Z = Mathf.MoveToward(Velocity.Z, 0, _speed * 2); } return velocity; } @@ -50,7 +50,7 @@ public partial class TestCharacter : CharacterBody3D private async void Fire() { var projectile = _fireProjectile.Instantiate(); - projectile.Position = Position + new Vector3(0f, 1f, -1f); + projectile.Position = Position + new Vector3(0f, 1f, -3f); GetParent().AddChild(projectile); CanShoot = false; await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout"); @@ -60,7 +60,7 @@ public partial class TestCharacter : CharacterBody3D private async void AltFire() { var projectile = _altFireProjectile.Instantiate(); - projectile.Position = Position + new Vector3(0f, 1f, -1f); + projectile.Position = Position + new Vector3(0f, 1f, -3f); GetParent().AddChild(projectile); CanShoot = false; await ToSignal(GetTree().CreateTimer(projectile.Cooldown), "timeout"); diff --git a/Textures/Projectiles/bubble.png b/Textures/Projectiles/bubble.png new file mode 100644 index 0000000000000000000000000000000000000000..71332673684ac3f8dc06908def697ced77b47c6e GIT binary patch literal 476 zcmV<20VDp2P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0dYx0K~z{r?U%t$ z!!QhnJ&-_q1-Omd0PV#4KLDo*w%c}tSC~Lz#eW-5S{m2!+U%51ilRnU^3`!umnxN! z%tG(uy?NNZ(pR`j^7KKE^fvnrm)ZD)g2>@W^s)(K3ZKtJ^Bccdo{&Q%#w%tDHO&5} zop2QVK(x5$1(`6Egxv?=$Up{>(O56LW`Q{{7v}6n(x|ppWJF@M?fP7-NTnl`h|GG~ zv`v7BR|Z&->RD=$5t-H2OuHL?p%yL;c!I3oA4%Ffp7D?S z_