base level for enemies testing
This commit is contained in:
28
maps/camera.gd
Normal file
28
maps/camera.gd
Normal file
@@ -0,0 +1,28 @@
|
||||
extends "res://addons/Free fly camera/Src/free_fly_startup.gd"
|
||||
|
||||
|
||||
const SPEED = 5.0
|
||||
const JUMP_VELOCITY = 4.5
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
# Add the gravity.
|
||||
if not is_on_floor():
|
||||
velocity += get_gravity() * delta
|
||||
|
||||
# Handle jump.
|
||||
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
|
||||
velocity.y = JUMP_VELOCITY
|
||||
|
||||
# Get the input direction and handle the movement/deceleration.
|
||||
# As good practice, you should replace UI actions with custom gameplay actions.
|
||||
var input_dir := Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
|
||||
var direction := (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
|
||||
if direction:
|
||||
velocity.x = direction.x * SPEED
|
||||
velocity.z = direction.z * SPEED
|
||||
else:
|
||||
velocity.x = move_toward(velocity.x, 0, SPEED)
|
||||
velocity.z = move_toward(velocity.z, 0, SPEED)
|
||||
|
||||
move_and_slide()
|
||||
1
maps/camera.gd.uid
Normal file
1
maps/camera.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://e6ihddcgve8c
|
||||
95
maps/enemies.tscn
Normal file
95
maps/enemies.tscn
Normal file
@@ -0,0 +1,95 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://cohmqsk3s70yp"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cte4jalives85" path="res://addons/sk_fly_camera/src/fly_camera.gd" id="1_aj441"]
|
||||
|
||||
[sub_resource type="PhysicalSkyMaterial" id="PhysicalSkyMaterial_aj441"]
|
||||
|
||||
[sub_resource type="Sky" id="Sky_o2inx"]
|
||||
sky_material = SubResource("PhysicalSkyMaterial_aj441")
|
||||
|
||||
[sub_resource type="Environment" id="Environment_i46j0"]
|
||||
background_mode = 2
|
||||
sky = SubResource("Sky_o2inx")
|
||||
ambient_light_source = 2
|
||||
ambient_light_color = Color(0.77807873, 0.8451813, 0.8615737, 1)
|
||||
ambient_light_energy = 0.5
|
||||
ssao_enabled = true
|
||||
ssao_radius = 2.0
|
||||
fog_light_color = Color(1, 1, 1, 1)
|
||||
|
||||
[node name="Enemies" type="Node3D"]
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_i46j0")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(0.6725735, -0.5947325, 0.44038418, -0.74003035, -0.5405202, 0.40024132, 0, -0.5950894, -0.8036596, 0, 0, 0)
|
||||
|
||||
[node name="DirectionalLight3D2" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(0.098757595, -0.94823945, -0.30180964, 0.25508866, -0.26903492, 0.92873573, -0.96186113, -0.16870806, 0.21531586, 0, 0, 0)
|
||||
light_energy = 0.2
|
||||
|
||||
[node name="CharacterBody3D" type="CharacterBody3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13.231003, 12.216311, 0)
|
||||
script = ExtResource("1_aj441")
|
||||
|
||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="."]
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
size = Vector3(100, 1, 100)
|
||||
|
||||
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.389802, -9.536743e-07, -17.424805)
|
||||
size = Vector3(2, 10, 2)
|
||||
|
||||
[node name="CSGBox3D3" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10.554723, 0, -14.582476)
|
||||
size = Vector3(2, 10, 2)
|
||||
|
||||
[node name="CSGBox3D4" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10.554723, 0, 8.672777)
|
||||
size = Vector3(2, 10, 2)
|
||||
|
||||
[node name="CSGBox3D5" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.4320955, 0, 8.672777)
|
||||
size = Vector3(2, 10, 2)
|
||||
|
||||
[node name="CSGBox3D6" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.400285, 0, -3.0115404)
|
||||
size = Vector3(2, 10, 2)
|
||||
|
||||
[node name="CSGBox3D7" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.3954687, -9.536743e-07, -8.965862)
|
||||
size = Vector3(10, 2, 10)
|
||||
|
||||
[node name="CSGBox3D8" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.063101, -9.536743e-07, -6.855488)
|
||||
size = Vector3(10, 3, 10)
|
||||
|
||||
[node name="CSGBox3D9" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.932084, 0, -3.5338726)
|
||||
size = Vector3(10, 4, 10)
|
||||
|
||||
[node name="CSGBox3D10" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7.932084, 0, 1.561698)
|
||||
size = Vector3(10, 5, 10)
|
||||
|
||||
[node name="CSGBox3D11" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.3916206, -1.9073486e-06, 9.662505)
|
||||
size = Vector3(10, 6, 10)
|
||||
|
||||
[node name="CSGBox3D12" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.696065, -9.536743e-07, 12.753594)
|
||||
size = Vector3(10, 7, 10)
|
||||
|
||||
[node name="CSGBox3D13" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10.025868, -9.536743e-07, 8.954356)
|
||||
size = Vector3(10, 8, 10)
|
||||
|
||||
[node name="CSGBox3D14" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 13.727036, -9.536743e-07, 0.6610918)
|
||||
size = Vector3(10, 9, 10)
|
||||
|
||||
[node name="CSGBox3D15" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 17.384857, -9.536743e-07, -3.8720686)
|
||||
size = Vector3(10, 10, 10)
|
||||
Reference in New Issue
Block a user