summaryrefslogtreecommitdiffstats
path: root/godot3-prototype/assets/characters
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2023-04-24 07:50:00 -0400
committerMalfurious <m@lfurio.us>2023-04-24 07:50:00 -0400
commit97dd79339284b033774ac74a04dd4a255475261a (patch)
tree951d3c29e676c14c9f165b32143e9aaae8ec4f6a /godot3-prototype/assets/characters
parent53091fce91ce03aae208bd0c61ee28830b34387d (diff)
downloadproject-s-97dd79339284b033774ac74a04dd4a255475261a.tar.gz
project-s-97dd79339284b033774ac74a04dd4a255475261a.zip
Move Godot 3 project to a new subdirectoryHEADmaster
Signed-off-by: Malfurious <m@lfurio.us>
Diffstat (limited to 'godot3-prototype/assets/characters')
-rw-r--r--godot3-prototype/assets/characters/base_character/BaseCharacter.gd22
-rw-r--r--godot3-prototype/assets/characters/base_character/BaseCharacter.tscn30
-rw-r--r--godot3-prototype/assets/characters/base_character/enemy_material.tres4
-rw-r--r--godot3-prototype/assets/characters/base_character/friendly_material.tres4
4 files changed, 60 insertions, 0 deletions
diff --git a/godot3-prototype/assets/characters/base_character/BaseCharacter.gd b/godot3-prototype/assets/characters/base_character/BaseCharacter.gd
new file mode 100644
index 0000000..f9df8e9
--- /dev/null
+++ b/godot3-prototype/assets/characters/base_character/BaseCharacter.gd
@@ -0,0 +1,22 @@
+extends KinematicBody
+
+export var material : Material = null
+export var is_firing = false
+export var look_angle = 0
+export var weapon_pitch = 0
+export var weapon_pitch_bias = deg2rad(20)
+
+func _ready():
+ look_angle = rotation.y
+ if material != null:
+ $Body.set("material/0", material)
+ $GooGun.projectile_material = material
+
+func _process(_delta):
+ var effective_weapon_pitch = weapon_pitch - weapon_pitch_bias if is_firing else weapon_pitch
+ effective_weapon_pitch = clamp(effective_weapon_pitch, deg2rad(-90), deg2rad(90))
+ $GooGun.is_firing = is_firing
+ $GooGun.look_angle = look_angle
+ $GooGun.weapon_pitch = effective_weapon_pitch
+ $GooGun.rotation.x = effective_weapon_pitch
+ rotation.y = look_angle
diff --git a/godot3-prototype/assets/characters/base_character/BaseCharacter.tscn b/godot3-prototype/assets/characters/base_character/BaseCharacter.tscn
new file mode 100644
index 0000000..fedc9b5
--- /dev/null
+++ b/godot3-prototype/assets/characters/base_character/BaseCharacter.tscn
@@ -0,0 +1,30 @@
+[gd_scene load_steps=6 format=2]
+
+[ext_resource path="res://assets/weapons/goo_gun/GooGun.tscn" type="PackedScene" id=1]
+[ext_resource path="res://assets/characters/base_character/friendly_material.tres" type="Material" id=2]
+[ext_resource path="res://assets/characters/base_character/BaseCharacter.gd" type="Script" id=3]
+
+[sub_resource type="CapsuleMesh" id=1]
+material = ExtResource( 2 )
+radius = 0.3
+mid_height = 0.9
+
+[sub_resource type="CapsuleShape" id=2]
+radius = 0.3
+height = 0.9
+
+[node name="BaseCharacter" type="KinematicBody"]
+script = ExtResource( 3 )
+
+[node name="Body" type="MeshInstance" parent="."]
+transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 )
+use_in_baked_light = true
+mesh = SubResource( 1 )
+material/0 = null
+
+[node name="GooGun" parent="." instance=ExtResource( 1 )]
+transform = Transform( -0.3, 0, -2.62268e-08, 0, 0.3, 0, 2.62268e-08, 0, -0.3, 0.425, 0.125, -0.1 )
+
+[node name="CollisionShape" type="CollisionShape" parent="."]
+transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0 )
+shape = SubResource( 2 )
diff --git a/godot3-prototype/assets/characters/base_character/enemy_material.tres b/godot3-prototype/assets/characters/base_character/enemy_material.tres
new file mode 100644
index 0000000..2e2d6ed
--- /dev/null
+++ b/godot3-prototype/assets/characters/base_character/enemy_material.tres
@@ -0,0 +1,4 @@
+[gd_resource type="SpatialMaterial" format=2]
+
+[resource]
+albedo_color = Color( 0.960784, 0.294118, 0.294118, 1 )
diff --git a/godot3-prototype/assets/characters/base_character/friendly_material.tres b/godot3-prototype/assets/characters/base_character/friendly_material.tres
new file mode 100644
index 0000000..3f2d91f
--- /dev/null
+++ b/godot3-prototype/assets/characters/base_character/friendly_material.tres
@@ -0,0 +1,4 @@
+[gd_resource type="SpatialMaterial" format=2]
+
+[resource]
+albedo_color = Color( 0.203922, 0.713726, 0.952941, 1 )