This commit is contained in:
mightypanders 2021-05-25 20:04:05 +02:00
commit 8cdf5fdddf
31 changed files with 2488 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.mono

View File

@ -0,0 +1,3 @@
source_md5="c395b0cc351a71713417cf862282849f"
dest_md5="59ae9fb6a2d0cd8268fad0cc94e56e93"

View File

@ -0,0 +1,3 @@
source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
dest_md5="2ded9e7f9060e2b530aab678b135fc5b"

Binary file not shown.

View File

@ -0,0 +1,3 @@
source_md5="0504bbf2da0a02b01b7bad6df062d42b"
dest_md5="524fdf03491f8d051aa9d2fcdd1b41e4"

Binary file not shown.

View File

@ -0,0 +1,3 @@
source_md5="01b9f69fc126d77d40de7ac1b4233260"
dest_md5="3d8ed41ace96aa4025a1ed2a259e824f"

14
Main.gd Normal file
View File

@ -0,0 +1,14 @@
extends Node
export (PackedScene) var mob_scene
func _ready():
randomize()
func _on_MobTimer_timeout():
var mob = mob_scene.instance()
var mob_spawn_location = get_node("SpawnPath/SpawnLocation")
mob_spawn_location.unit_offset = randf()
var player_position = $Player.transform.origin
add_child(mob)
mob.initialize(mob_spawn_location.translation,player_position)

83
Main.tscn Normal file
View File

@ -0,0 +1,83 @@
[gd_scene load_steps=9 format=2]
[ext_resource path="res://Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://Mob.tscn" type="PackedScene" id=2]
[ext_resource path="res://Main.gd" type="Script" id=3]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 30, 1, 30 )
[sub_resource type="CubeMesh" id=2]
size = Vector3( 60, 2, 60 )
[sub_resource type="CylinderMesh" id=3]
[sub_resource type="SpatialMaterial" id=4]
albedo_color = Color( 1, 0, 0, 1 )
[sub_resource type="Curve3D" id=5]
_data = {
"points": PoolVector3Array( 0, 0, 0, 0, 0, 0, -14.295, 0, -12.6559, 0, 0, 0, 0, 0, 0, 13.9255, 0, -12.764, 0, 0, 0, 0, 0, 0, 13.9255, 0, 19.9978, 0, 0, 0, 0, 0, 0, -14.295, 0, 19.9978, 0, 0, 0, 0, 0, 0, -14.295, 0, -12.6559 ),
"tilts": PoolRealArray( 0, 0, 0, 0, 0 )
}
[node name="Main" type="Node"]
script = ExtResource( 3 )
mob_scene = ExtResource( 2 )
[node name="Ground" type="StaticBody" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 )
[node name="CollisionShape" type="CollisionShape" parent="Ground"]
shape = SubResource( 1 )
[node name="MeshInstance" type="MeshInstance" parent="Ground"]
mesh = SubResource( 2 )
material/0 = null
[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( 0.773991, -0.432829, -0.462165, -0.0675213, -0.782148, 0.619423, -0.629586, -0.448222, -0.634601, 0, 28.1906, 0 )
shadow_enabled = true
[node name="Player" parent="." instance=ExtResource( 1 )]
[node name="CameraPivot" type="Position3D" parent="."]
[node name="Camera" type="Camera" parent="CameraPivot"]
transform = Transform( 1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 15, 19 )
projection = 1
size = 19.0
[node name="Spatial" type="Spatial" parent="."]
[node name="MeshInstance" type="MeshInstance" parent="Spatial"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 13.783, 0, -12.6345 )
mesh = SubResource( 3 )
material/0 = SubResource( 4 )
[node name="MeshInstance2" type="MeshInstance" parent="Spatial"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 13.783, 0, 20.0223 )
mesh = SubResource( 3 )
material/0 = SubResource( 4 )
[node name="MeshInstance3" type="MeshInstance" parent="Spatial"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -14.3136, 0, -12.6345 )
mesh = SubResource( 3 )
material/0 = SubResource( 4 )
[node name="MeshInstance4" type="MeshInstance" parent="Spatial"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -14.3136, 0, 20.0223 )
mesh = SubResource( 3 )
material/0 = SubResource( 4 )
[node name="SpawnPath" type="Path" parent="."]
curve = SubResource( 5 )
[node name="SpawnLocation" type="PathFollow" parent="SpawnPath"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -14.295, 0, -12.6559 )
[node name="MobTimer" type="Timer" parent="."]
wait_time = 0.5
autostart = true
[connection signal="timeout" from="MobTimer" to="." method="_on_MobTimer_timeout"]

21
Mob.gd Normal file
View File

@ -0,0 +1,21 @@
extends KinematicBody
export var min_speed = 10
export var max_speed = 18
var velocity = Vector3.ZERO
func _physics_process(delta):
move_and_slide(velocity)
func initialize(start_position, player_position):
translation = start_position
look_at(player_position,Vector3.UP)
rotate_y(rand_range(-PI/4,PI/4))
var random_speed = rand_range(min_speed,max_speed)
velocity = Vector3.FORWARD * random_speed
velocity = velocity.rotated(Vector3.UP,rotation.y)
func _on_VisibilityNotifier_screen_exited():
queue_free()

24
Mob.tscn Normal file
View File

@ -0,0 +1,24 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://art/mob.glb" type="PackedScene" id=1]
[ext_resource path="res://Mob.gd" type="Script" id=2]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.93419, 0.405612, 0.910644 )
[node name="Mob" type="KinematicBody"]
script = ExtResource( 2 )
[node name="Pivot" type="Spatial" parent="."]
[node name="Character" parent="Pivot" instance=ExtResource( 1 )]
[node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.182673, 0 )
shape = SubResource( 1 )
[node name="VisibilityNotifier" type="VisibilityNotifier" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.476604 )
aabb = AABB( -1, -1, -1.50229, 2, 2, 3.00459 )
[connection signal="screen_exited" from="VisibilityNotifier" to="." method="_on_VisibilityNotifier_screen_exited"]

24
Player.gd Normal file
View File

@ -0,0 +1,24 @@
extends KinematicBody
export var speed = 14
export var fall_accel = 75
var velocity = Vector3.ZERO
func _physics_process(delta):
var direction = Vector3.ZERO
if Input.is_action_pressed("move_right"):
direction.x += 1
if Input.is_action_pressed("move_left"):
direction.x -= 1
if Input.is_action_pressed("move_forward"):
direction.z -= 1
if Input.is_action_pressed("move_back"):
direction.z += 1
if direction != Vector3.ZERO:
direction = direction.normalized()
$Pivot.look_at(translation+direction,Vector3.UP)
velocity.x = direction.x * speed
velocity.z = direction.z * speed
velocity.y -= fall_accel * delta
velocity = move_and_slide(velocity,Vector3.UP)

18
Player.tscn Normal file
View File

@ -0,0 +1,18 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://art/player.glb" type="PackedScene" id=1]
[ext_resource path="res://Player.gd" type="Script" id=2]
[sub_resource type="SphereShape" id=1]
radius = 1.09537
[node name="Player" type="KinematicBody"]
script = ExtResource( 2 )
[node name="Pivot" type="Spatial" parent="."]
[node name="Character" parent="Pivot" instance=ExtResource( 1 )]
[node name="CollisionShape" type="CollisionShape" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.10691, 0 )
shape = SubResource( 1 )

Binary file not shown.

View File

@ -0,0 +1,15 @@
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggstr"
[deps]
source_file="res://art/House In a Forest Loop.ogg"
dest_files=[ "res://.import/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggstr" ]
[params]
loop=true
loop_offset=0

BIN
art/body.material Normal file

Binary file not shown.

BIN
art/eye.material Normal file

Binary file not shown.

BIN
art/mob.glb Normal file

Binary file not shown.

1064
art/mob.glb.import Normal file

File diff suppressed because it is too large Load Diff

BIN
art/mob_body.material Normal file

Binary file not shown.

BIN
art/mob_eye.material Normal file

Binary file not shown.

BIN
art/player.glb Normal file

Binary file not shown.

1064
art/player.glb.import Normal file

File diff suppressed because it is too large Load Diff

BIN
art/pupil.material Normal file

Binary file not shown.

7
default_env.tres Normal file
View File

@ -0,0 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )

41
export_presets.cfg Normal file
View File

@ -0,0 +1,41 @@
[preset.0]
name="Windows Desktop"
platform="Windows Desktop"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="Z:/GodotExports/3D_Tutorial/BlenderEye.exe"
script_export_mode=1
script_encryption_key=""
[preset.0.options]
custom_template/debug=""
custom_template/release=""
binary_format/64_bits=true
binary_format/embed_pck=true
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
codesign/enable=false
codesign/identity_type=0
codesign/identity=""
codesign/password=""
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PoolStringArray( )
application/icon=""
application/file_version=""
application/product_version=""
application/company_name=""
application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

34
icon.png.import Normal file
View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

65
project.godot Normal file
View File

@ -0,0 +1,65 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
[application]
config/name="RunnerSchuppen"
run/main_scene="res://Main.tscn"
config/icon="res://icon.png"
[display]
window/size/width=720
window/size/height=540
[input]
move_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
]
}
move_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
]
}
move_back={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
]
}
move_forward={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
]
}
jump={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
]
}
[physics]
common/enable_pause_aware_picking=true
[rendering]
quality/driver/driver_name="GLES2"
vram_compression/import_etc=true
vram_compression/import_etc2=false
quality/filters/use_fxaa=true
environment/default_environment="res://default_env.tres"