Merge branch 'master' of https://gitlab.hexaquo.at/Light/fhwikijam
This commit is contained in:
commit
8ea9eb355f
@ -27,4 +27,7 @@ func _process(delta):
|
||||
else:
|
||||
dir = (_player.transform.origin - transform.origin).normalized()
|
||||
|
||||
if (dir.x != 0.0 and dir.z != 0.0):
|
||||
look_at(transform.origin + Vector3(dir.x, 0.0, dir.z), Vector3.UP)
|
||||
|
||||
move_and_slide(dir * speed)
|
||||
|
File diff suppressed because one or more lines are too long
BIN
WikiJam/Images/crystal-unlit.png
Normal file
BIN
WikiJam/Images/crystal-unlit.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 774 KiB |
34
WikiJam/Images/crystal-unlit.png.import
Normal file
34
WikiJam/Images/crystal-unlit.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/crystal-unlit.png-de903ef8083d4625d4063f5d183cbdb2.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Images/crystal-unlit.png"
|
||||
dest_files=[ "res://.import/crystal-unlit.png-de903ef8083d4625d4063f5d183cbdb2.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
|
BIN
WikiJam/Images/crystal.png
Normal file
BIN
WikiJam/Images/crystal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 840 KiB |
34
WikiJam/Images/crystal.png.import
Normal file
34
WikiJam/Images/crystal.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/crystal.png-799a270c74e70ceee9187ce5a10754d7.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Images/crystal.png"
|
||||
dest_files=[ "res://.import/crystal.png-799a270c74e70ceee9187ce5a10754d7.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
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
34
WikiJam/Models/Blender/DinoSide.jpg.import
Normal file
34
WikiJam/Models/Blender/DinoSide.jpg.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/DinoSide.jpg-8a25ef46a4ca2d5424a37b519757838b.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Models/Blender/DinoSide.jpg"
|
||||
dest_files=[ "res://.import/DinoSide.jpg-8a25ef46a4ca2d5424a37b519757838b.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
|
BIN
WikiJam/Models/Crystal.glb
Normal file
BIN
WikiJam/Models/Crystal.glb
Normal file
Binary file not shown.
1062
WikiJam/Models/Crystal.glb.import
Normal file
1062
WikiJam/Models/Crystal.glb.import
Normal file
File diff suppressed because it is too large
Load Diff
1062
WikiJam/Models/Dino.glb.import
Normal file
1062
WikiJam/Models/Dino.glb.import
Normal file
File diff suppressed because it is too large
Load Diff
@ -5,18 +5,19 @@ export(NodePath) var body_nodepath
|
||||
export(NodePath) var camera_nodepath
|
||||
export(NodePath) var animation_nodepath
|
||||
export(NodePath) var ui_nodepath
|
||||
export(NodePath) var interact_area_nodepath
|
||||
|
||||
# const
|
||||
const GRAVITY = -24.8
|
||||
const JUMP_SPEED = 8
|
||||
const MOVE_SPEED = 6
|
||||
const SPRINT_SPEED = 10
|
||||
const MOVE_SPEED = 8
|
||||
const SPRINT_SPEED = 12
|
||||
const ACCEL = 15.0
|
||||
const MAX_SLOPE_ANGLE = 40
|
||||
const MOUSE_SENSITIVITY = 0.05
|
||||
const INTERACT_DISTANCE = 4
|
||||
const SPRINT_DEC = 0.015;
|
||||
const SPRINT_ACC = 0.0015;
|
||||
const SPRINT_DEC = 0.01;
|
||||
const SPRINT_ACC = 0.005;
|
||||
|
||||
# private members
|
||||
var _body: Spatial
|
||||
@ -24,6 +25,7 @@ var _camera: Camera
|
||||
var _animation: AnimationPlayer
|
||||
var _interface: Control
|
||||
var _sprintometer: ProgressBar
|
||||
var _interact_area: Area
|
||||
var _dir = Vector3()
|
||||
var _vel = Vector3()
|
||||
var _is_sprinting
|
||||
@ -47,6 +49,11 @@ func _ready():
|
||||
_sprintometer = _interface.get_node("ProgressBar")
|
||||
assert(null != _sprintometer)
|
||||
|
||||
_interact_area = get_node(interact_area_nodepath) as Area
|
||||
assert(null != _interact_area)
|
||||
|
||||
_interact_area.connect("area_entered", self, "_on_interact_entered")
|
||||
|
||||
# Setup mouse look
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
|
||||
|
||||
@ -54,7 +61,6 @@ func _ready():
|
||||
func _physics_process(delta):
|
||||
_process_input()
|
||||
_process_movement(delta)
|
||||
_process_collision()
|
||||
#Logger.info("sprintVal: " + String(_sprintVal))
|
||||
|
||||
|
||||
@ -115,20 +121,12 @@ func _process_animations():
|
||||
_sprintometer.value = _sprintVal
|
||||
|
||||
|
||||
func _process_collision():
|
||||
var collCount = get_slide_count()
|
||||
if collCount > 0:
|
||||
#Logger.debug("Collide count: ", collCount)
|
||||
for i in collCount:
|
||||
var collision = get_slide_collision(i)
|
||||
#Logger.debug("Collided with: ", collision.collider.name)
|
||||
#TODO: replace with groups
|
||||
if collision.collider.name == "CrystalBody":
|
||||
#Logger.debug("removing crystal...")
|
||||
collision.collider.queue_free()
|
||||
_interface.increaseScore()
|
||||
elif collision.collider.name == "Dino":
|
||||
_interface.gameOver()
|
||||
func _on_interact_entered(area: Area):
|
||||
if area.is_in_group("Crystal"):
|
||||
area.get_parent().queue_free() # Assuming crystal area is always parent of crystal root
|
||||
_interface.increaseScore()
|
||||
elif area.is_in_group("Dino"):
|
||||
_interface.gameOver()
|
||||
|
||||
|
||||
func _input(event):
|
||||
|
@ -1,10 +1,10 @@
|
||||
[gd_scene load_steps=8 format=2]
|
||||
[gd_scene load_steps=9 format=2]
|
||||
|
||||
[ext_resource path="res://Player/Player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Player/Footsteps.gd" type="Script" id=2]
|
||||
[ext_resource path="res://Resources/Audio/Step.wav" type="AudioStream" id=3]
|
||||
[ext_resource path="res://Player/UI/HUD.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://Player/UI/HUD.gd" type="Script" id=5]
|
||||
[ext_resource path="res://Sounds/dino-eat.wav" type="AudioStream" id=5]
|
||||
|
||||
[sub_resource type="CylinderShape" id=1]
|
||||
height = 2.5
|
||||
@ -42,12 +42,17 @@ tracks/1/keys = {
|
||||
} ]
|
||||
}
|
||||
|
||||
[sub_resource type="CapsuleShape" id=3]
|
||||
radius = 1.58175
|
||||
height = 1.6
|
||||
|
||||
[node name="Player" type="KinematicBody"]
|
||||
script = ExtResource( 1 )
|
||||
body_nodepath = NodePath("Body")
|
||||
camera_nodepath = NodePath("Camera")
|
||||
animation_nodepath = NodePath("WalkAnimationPlayer")
|
||||
ui_nodepath = NodePath("HUD")
|
||||
interact_area_nodepath = NodePath("InteractArea")
|
||||
|
||||
[node name="Body" type="Spatial" parent="."]
|
||||
|
||||
@ -74,68 +79,13 @@ unit_db = -10.0
|
||||
pitch_scale = 1.5
|
||||
|
||||
[node name="HUD" parent="." instance=ExtResource( 4 )]
|
||||
script = ExtResource( 5 )
|
||||
label_nodepath = NodePath("LabelScore")
|
||||
popup_nodepath = NodePath("PopupWon")
|
||||
|
||||
[node name="LabelScore" type="Label" parent="HUD"]
|
||||
margin_left = 15.0
|
||||
margin_top = 15.0
|
||||
margin_right = 115.0
|
||||
margin_bottom = 30.0
|
||||
text = "Score: 0"
|
||||
[node name="GameOverSound" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 5 )
|
||||
|
||||
[node name="PopupWon" type="Popup" parent="HUD"]
|
||||
visible = true
|
||||
margin_left = 383.0
|
||||
margin_top = 187.0
|
||||
margin_right = 530.0
|
||||
margin_bottom = 289.0
|
||||
[node name="InteractArea" type="Area" parent="."]
|
||||
gravity = 0.0
|
||||
|
||||
[node name="PanelFail" type="Panel" parent="HUD/PopupWon"]
|
||||
modulate = Color( 0.996078, 0, 0, 1 )
|
||||
margin_left = -383.0
|
||||
margin_top = -187.36
|
||||
margin_right = 641.0
|
||||
margin_bottom = 412.64
|
||||
|
||||
[node name="PanelWon" type="Panel" parent="HUD/PopupWon"]
|
||||
modulate = Color( 0.0313726, 0, 0.996078, 1 )
|
||||
margin_left = -383.0
|
||||
margin_top = -187.36
|
||||
margin_right = 641.0
|
||||
margin_bottom = 412.64
|
||||
|
||||
[node name="LabelWon" type="Label" parent="HUD/PopupWon"]
|
||||
margin_left = 87.064
|
||||
margin_top = 24.4867
|
||||
margin_right = 169.064
|
||||
margin_bottom = 72.4867
|
||||
text = "Gratulations!
|
||||
|
||||
You Won!"
|
||||
|
||||
[node name="LabelFail" type="Label" parent="HUD/PopupWon"]
|
||||
margin_left = 88.9828
|
||||
margin_top = 28.0094
|
||||
margin_right = 168.983
|
||||
margin_bottom = 76.0094
|
||||
text = " You died!
|
||||
|
||||
Game over"
|
||||
|
||||
[node name="Button" type="Button" parent="HUD/PopupWon"]
|
||||
margin_left = 86.5054
|
||||
margin_top = 144.902
|
||||
margin_right = 179.505
|
||||
margin_bottom = 181.902
|
||||
text = "play again"
|
||||
|
||||
[node name="ProgressBar" type="ProgressBar" parent="HUD"]
|
||||
margin_left = 410.651
|
||||
margin_top = 560.551
|
||||
margin_right = 614.651
|
||||
margin_bottom = 582.551
|
||||
step = 1.0
|
||||
value = 100.0
|
||||
[connection signal="pressed" from="HUD/PopupWon/Button" to="HUD" method="_on_Button_pressed"]
|
||||
[node name="CollisionShape" type="CollisionShape" parent="InteractArea"]
|
||||
transform = Transform( 1, 0, 0, 0, -4.37114e-008, -1, 0, 1, -4.37114e-008, 0, 2, 0 )
|
||||
shape = SubResource( 3 )
|
||||
|
@ -2,11 +2,13 @@ extends Control
|
||||
|
||||
export(NodePath) var label_nodepath
|
||||
export(NodePath) var popup_nodepath
|
||||
export(NodePath) var gameover_sound_path
|
||||
|
||||
const SCORE = 100
|
||||
|
||||
var _labelScore: Label
|
||||
var _popup: Popup
|
||||
var _gameover_sound: AudioStreamPlayer
|
||||
var _score: int = 0
|
||||
|
||||
|
||||
@ -16,6 +18,9 @@ func _ready():
|
||||
|
||||
_popup = get_node(popup_nodepath) as Popup
|
||||
assert(null != _popup)
|
||||
|
||||
_gameover_sound = get_node(gameover_sound_path) as AudioStreamPlayer
|
||||
assert(null != _gameover_sound)
|
||||
|
||||
|
||||
func increaseScore():
|
||||
@ -28,6 +33,7 @@ func increaseScore():
|
||||
|
||||
|
||||
func gameOver():
|
||||
_gameover_sound.play()
|
||||
_endGame(false)
|
||||
|
||||
|
||||
|
@ -1,5 +1,74 @@
|
||||
[gd_scene format=2]
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://Player/UI/HUD.gd" type="Script" id=1]
|
||||
|
||||
[node name="HUD" type="Control"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
script = ExtResource( 1 )
|
||||
label_nodepath = NodePath("../HUD/LabelScore")
|
||||
popup_nodepath = NodePath("../HUD/Popup")
|
||||
gameover_sound_path = NodePath("../GameOverSound")
|
||||
|
||||
[node name="LabelScore" type="Label" parent="."]
|
||||
margin_left = 15.0
|
||||
margin_top = 15.0
|
||||
margin_right = 115.0
|
||||
margin_bottom = 30.0
|
||||
text = "Score: 0"
|
||||
|
||||
[node name="Popup" type="Popup" parent="."]
|
||||
editor/display_folded = true
|
||||
visible = true
|
||||
margin_left = 383.0
|
||||
margin_top = 187.0
|
||||
margin_right = 530.0
|
||||
margin_bottom = 289.0
|
||||
|
||||
[node name="PanelFail" type="Panel" parent="Popup"]
|
||||
modulate = Color( 0.996078, 0, 0, 1 )
|
||||
margin_left = -383.0
|
||||
margin_top = -187.36
|
||||
margin_right = 641.0
|
||||
margin_bottom = 412.64
|
||||
|
||||
[node name="PanelWon" type="Panel" parent="Popup"]
|
||||
modulate = Color( 0.0313726, 0, 0.996078, 1 )
|
||||
margin_left = -383.0
|
||||
margin_top = -187.36
|
||||
margin_right = 641.0
|
||||
margin_bottom = 412.64
|
||||
|
||||
[node name="LabelWon" type="Label" parent="Popup"]
|
||||
margin_left = 87.064
|
||||
margin_top = 24.4867
|
||||
margin_right = 169.064
|
||||
margin_bottom = 72.4867
|
||||
text = "Gratulations!
|
||||
|
||||
You Won!"
|
||||
|
||||
[node name="LabelFail" type="Label" parent="Popup"]
|
||||
margin_left = 88.9828
|
||||
margin_top = 28.0094
|
||||
margin_right = 168.983
|
||||
margin_bottom = 76.0094
|
||||
text = " You died!
|
||||
|
||||
Game over"
|
||||
|
||||
[node name="Button" type="Button" parent="Popup"]
|
||||
margin_left = 86.5054
|
||||
margin_top = 144.902
|
||||
margin_right = 179.505
|
||||
margin_bottom = 181.902
|
||||
text = "play again"
|
||||
|
||||
[node name="ProgressBar" type="ProgressBar" parent="."]
|
||||
margin_left = 410.651
|
||||
margin_top = 560.551
|
||||
margin_right = 614.651
|
||||
margin_bottom = 582.551
|
||||
step = 1.0
|
||||
value = 100.0
|
||||
[connection signal="pressed" from="Popup/Button" to="." method="_on_Button_pressed"]
|
||||
|
BIN
WikiJam/Sounds/ding.wav
Normal file
BIN
WikiJam/Sounds/ding.wav
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user