Perfect movement a little more, prepare for weapon and attack system
This commit is contained in:
parent
a788dc20e6
commit
2fad294d6a
7 changed files with 25 additions and 1 deletions
|
|
@ -15,6 +15,10 @@ run/main_scene="uid://bxdnehietcpkj"
|
||||||
config/features=PackedStringArray("4.6", "Mobile")
|
config/features=PackedStringArray("4.6", "Mobile")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
[autoload]
|
||||||
|
|
||||||
|
Global="*uid://4hvgybxt05qj"
|
||||||
|
|
||||||
[editor_plugins]
|
[editor_plugins]
|
||||||
|
|
||||||
enabled=PackedStringArray("res://addons/godot_super-wakatime/plugin.cfg")
|
enabled=PackedStringArray("res://addons/godot_super-wakatime/plugin.cfg")
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
[gd_scene format=3 uid="uid://bxdnehietcpkj"]
|
[gd_scene format=3 uid="uid://bxdnehietcpkj"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://dhfun46prq3uk" path="res://scripts/game.gd" id="1_gee14"]
|
||||||
[ext_resource type="Script" uid="uid://crf3d7dpjvlsl" path="res://scripts/player_camera.gd" id="1_lnu2h"]
|
[ext_resource type="Script" uid="uid://crf3d7dpjvlsl" path="res://scripts/player_camera.gd" id="1_lnu2h"]
|
||||||
[ext_resource type="Script" uid="uid://66iq60cxqomg" path="res://scripts/player.gd" id="1_yqjtg"]
|
[ext_resource type="Script" uid="uid://66iq60cxqomg" path="res://scripts/player.gd" id="1_yqjtg"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dp3jbqmr5toth" path="res://textures/character-body.png" id="3_p57ef"]
|
[ext_resource type="Texture2D" uid="uid://dp3jbqmr5toth" path="res://textures/character-body.png" id="3_p57ef"]
|
||||||
|
|
@ -568,6 +569,7 @@ radius = 0.25
|
||||||
height = 1.0
|
height = 1.0
|
||||||
|
|
||||||
[node name="Game" type="Node3D" unique_id=1358608749]
|
[node name="Game" type="Node3D" unique_id=1358608749]
|
||||||
|
script = ExtResource("1_gee14")
|
||||||
|
|
||||||
[node name="CSGBox3D" type="CSGBox3D" parent="." unique_id=1781956012]
|
[node name="CSGBox3D" type="CSGBox3D" parent="." unique_id=1781956012]
|
||||||
use_collision = true
|
use_collision = true
|
||||||
|
|
|
||||||
11
scripts/game.gd
Normal file
11
scripts/game.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
extends Node3D
|
||||||
|
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
pass
|
||||||
1
scripts/game.gd.uid
Normal file
1
scripts/game.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://dhfun46prq3uk
|
||||||
5
scripts/global.gd
Normal file
5
scripts/global.gd
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
extends Node
|
||||||
|
|
||||||
|
const weapons = {
|
||||||
|
|
||||||
|
}
|
||||||
1
scripts/global.gd.uid
Normal file
1
scripts/global.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://4hvgybxt05qj
|
||||||
|
|
@ -38,7 +38,7 @@ func _physics_process(delta: float) -> void:
|
||||||
if input_dir.x < 0:
|
if input_dir.x < 0:
|
||||||
face_left = true
|
face_left = true
|
||||||
|
|
||||||
var direction := (transform.basis * Vector3(input_dir.y + input_dir.x, 0, input_dir.y - input_dir.x)).normalized()
|
var direction = (camera.transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
|
||||||
if direction:
|
if direction:
|
||||||
velocity.x = direction.x * SPEED
|
velocity.x = direction.x * SPEED
|
||||||
velocity.z = direction.z * SPEED
|
velocity.z = direction.z * SPEED
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue