Add dungman

This commit is contained in:
Daniel Snider 2022-08-13 20:41:37 -07:00
parent 2c47b309ae
commit 4c3f01a835
6 changed files with 1073 additions and 9 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://assets/protodungman/DungMan.glb" type="PackedScene" id=1]
[node name="DungMan" instance=ExtResource( 1 )]

Binary file not shown.

View File

@ -1,10 +1,7 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=5 format=2]
[ext_resource path="res://scripts/Player.gd" type="Script" id=1] [ext_resource path="res://scripts/Player.gd" type="Script" id=1]
[ext_resource path="res://assets/protodungman/DungMan.glb" type="PackedScene" id=2]
[sub_resource type="CapsuleMesh" id=1]
radius = 0.2
mid_height = 0.85
[sub_resource type="CapsuleShape" id=2] [sub_resource type="CapsuleShape" id=2]
radius = 0.210213 radius = 0.210213
@ -15,10 +12,7 @@ height = 0.85525
[node name="Player" type="KinematicBody"] [node name="Player" type="KinematicBody"]
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="MeshInstance" type="MeshInstance" parent="."] [node name="DungMan" parent="." instance=ExtResource( 2 )]
transform = Transform( 0.994286, 0, 0, 0, -4.34616e-08, -0.994286, 0, 0.994286, -4.34616e-08, 0, 0.666587, 0 )
mesh = SubResource( 1 )
skeleton = NodePath("../..")
[node name="CollisionShape" type="CollisionShape" parent="."] [node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.641703, 0 ) transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.641703, 0 )

View File

@ -11,7 +11,7 @@ func _ready():
func _physics_process(delta): func _physics_process(delta):
var input = Vector3(Input.get_axis("left", "right"), 0.0, Input.get_axis("up", "down")) var input = Vector3(Input.get_axis("left", "right"), 0.0, Input.get_axis("up", "down"))
var motion = Plane.PLANE_XZ.project(get_viewport().get_camera().global_transform.basis.xform(input)).normalized() * SPEED var motion = Plane.PLANE_XZ.project(get_viewport().get_camera().global_transform.basis.xform(input)).normalized() * SPEED
$DungMan.look_at(global_transform.origin - motion, Vector3.UP)
move_and_slide(motion) move_and_slide(motion)
func can_afford(item_name, item_amount): func can_afford(item_name, item_amount):