merge
This commit is contained in:
commit
f017b9781f
@ -31,6 +31,7 @@ var _dir = Vector3()
|
||||
var _vel = Vector3()
|
||||
var _is_sprinting : bool
|
||||
var _illegal_areas : int
|
||||
var _save_areas : int
|
||||
var _prev_look
|
||||
|
||||
# TODO: move to global
|
||||
@ -198,29 +199,38 @@ func _on_area_entered (area: Area):
|
||||
elif area.is_in_group("Forbidden"):
|
||||
Logger.info("entering forbidden area!")
|
||||
_illegal_areas += 1
|
||||
elif area.is_in_group("Savehouse"):
|
||||
Logger.info("entering save area!")
|
||||
_save_areas += 1
|
||||
|
||||
|
||||
func _on_area_exited (area: Area):
|
||||
if area.is_in_group("Forbidden"):
|
||||
Logger.info("leaving forbidden area!")
|
||||
_illegal_areas -= 1
|
||||
elif area.is_in_group("Savehouse"):
|
||||
Logger.info("leaving save area!")
|
||||
_save_areas -= 1
|
||||
|
||||
|
||||
func _on_respawn ():
|
||||
Logger.info("respawning")
|
||||
|
||||
# fade to black and restart scene
|
||||
_inventory.hide()
|
||||
_animationFadeOut.play("FadeOut")
|
||||
yield(_animationFadeOut, "animation_finished")
|
||||
|
||||
# reset values
|
||||
_animationFadeOut.seek(0, true)
|
||||
|
||||
# reset values
|
||||
Pills._set_level(Pills.get_max())
|
||||
Daytime._set_time(0)
|
||||
|
||||
get_tree().reload_current_scene()
|
||||
Logger.info("save areas: " + String(_save_areas))
|
||||
if _save_areas < 1:
|
||||
Logger.info("reload scene")
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
_inventory.show()
|
||||
|
||||
|
||||
func Is_in_Illegal_Area ():
|
||||
|
@ -1,6 +1,6 @@
|
||||
extends Node
|
||||
|
||||
const _increase_per_second: float = 100.0 #0.5
|
||||
const _increase_per_second: float = 0.0 #0.5
|
||||
const _max: int = 1440 # 24 hour + 60 mins
|
||||
|
||||
var _time: float setget _set_time, get_time
|
||||
|
77
Level/InFactory.tscn
Normal file
77
Level/InFactory.tscn
Normal file
@ -0,0 +1,77 @@
|
||||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://Level/Interactables/Door/Door.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://Characters/Player/Player.tscn" type="PackedScene" id=2]
|
||||
|
||||
[sub_resource type="CubeMesh" id=4]
|
||||
|
||||
[sub_resource type="BoxShape" id=5]
|
||||
|
||||
[sub_resource type="BoxShape" id=6]
|
||||
|
||||
[sub_resource type="CubeMesh" id=7]
|
||||
|
||||
[node name="InFactory" type="Spatial"]
|
||||
|
||||
[node name="Architecture" type="Spatial" parent="."]
|
||||
|
||||
[node name="EntryHall" type="Spatial" parent="Architecture"]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2 )
|
||||
|
||||
[node name="WallPart1" type="StaticBody" parent="Architecture/EntryHall"]
|
||||
transform = Transform( 2, 0, 0, 0, 1.5, 0, 0, 0, 0.2, -4, 1.5, 0 )
|
||||
collision_layer = 3
|
||||
|
||||
[node name="MeshInstance" type="MeshInstance" parent="Architecture/EntryHall/WallPart1"]
|
||||
layers = 3
|
||||
mesh = SubResource( 4 )
|
||||
material/0 = null
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="Architecture/EntryHall/WallPart1"]
|
||||
shape = SubResource( 5 )
|
||||
|
||||
[node name="WallPart2" type="StaticBody" parent="Architecture/EntryHall"]
|
||||
transform = Transform( 2, 0, 0, 0, 1.5, 0, 0, 0, 0.2, 4, 1.5, 0 )
|
||||
collision_layer = 3
|
||||
|
||||
[node name="MeshInstance" type="MeshInstance" parent="Architecture/EntryHall/WallPart2"]
|
||||
layers = 3
|
||||
mesh = SubResource( 4 )
|
||||
material/0 = null
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="Architecture/EntryHall/WallPart2"]
|
||||
shape = SubResource( 5 )
|
||||
|
||||
[node name="WallPart3" type="StaticBody" parent="Architecture/EntryHall"]
|
||||
transform = Transform( 6, 0, 0, 0, 1, 0, 0, 0, 0.2, 0, 4, 0 )
|
||||
collision_layer = 3
|
||||
|
||||
[node name="MeshInstance" type="MeshInstance" parent="Architecture/EntryHall/WallPart3"]
|
||||
layers = 3
|
||||
mesh = SubResource( 4 )
|
||||
material/0 = null
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="Architecture/EntryHall/WallPart3"]
|
||||
shape = SubResource( 5 )
|
||||
|
||||
[node name="Door" parent="Architecture/EntryHall" instance=ExtResource( 1 )]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 1.5, 0 )
|
||||
|
||||
[node name="Door2" parent="Architecture/EntryHall" instance=ExtResource( 1 )]
|
||||
transform = Transform( -1, 0, -8.74228e-008, 0, 1, 0, 8.74228e-008, 0, -1, 2, 1.5, 0 )
|
||||
invert_open = true
|
||||
|
||||
[node name="Floor" type="StaticBody" parent="Architecture"]
|
||||
transform = Transform( 100, 0, 0, 0, 1, 0, 0, 0, 100, 0, -1, 0 )
|
||||
collision_layer = 3
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape" parent="Architecture/Floor"]
|
||||
shape = SubResource( 6 )
|
||||
|
||||
[node name="MeshInstance" type="MeshInstance" parent="Architecture/Floor"]
|
||||
layers = 3
|
||||
mesh = SubResource( 7 )
|
||||
material/0 = null
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource( 2 )]
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4, 0 )
|
@ -1,6 +1,7 @@
|
||||
extends KinematicBody
|
||||
|
||||
# export variables
|
||||
export(bool) var invert_open
|
||||
export(bool) var card_door
|
||||
export(int) var door_lvl
|
||||
|
||||
@ -14,12 +15,16 @@ var _startingRotY : float
|
||||
var _isMoving = false
|
||||
var _isOpening = false
|
||||
var _degrees = 0
|
||||
var _opening_dir = 1
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
_startingRotY = global_transform.basis.get_euler().y
|
||||
outline = get_node("DoorMesh/Outline") as MeshInstance
|
||||
|
||||
if invert_open:
|
||||
_opening_dir = -1
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
if _isMoving:
|
||||
@ -56,4 +61,4 @@ func _door_move(delta):
|
||||
_degrees = 0
|
||||
_isMoving = false
|
||||
|
||||
rotate_y(_degrees * PI/180 - global_transform.basis.get_euler().y + _startingRotY)
|
||||
rotate_y(_degrees * _opening_dir * PI/180 - global_transform.basis.get_euler().y + _startingRotY)
|
||||
|
@ -28,7 +28,7 @@ surfaces/0 = {
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="DoorMesh" type="MeshInstance" parent="."]
|
||||
transform = Transform( 1, 0, 0, 0, 2, 0, 0, 0, 0.1, 1, 0, 0 )
|
||||
transform = Transform( 1, 0, 0, 0, 1.5, 0, 0, 0, 0.1, 1, 0, 0 )
|
||||
layers = 3
|
||||
mesh = SubResource( 1 )
|
||||
material/0 = null
|
||||
|
@ -245,7 +245,6 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 73, 0, -88 )
|
||||
[node name="Factory" parent="NavigationMeshInstance/BuildingBlocks" instance=ExtResource( 9 )]
|
||||
|
||||
[node name="Ground" type="MeshInstance" parent="NavigationMeshInstance"]
|
||||
editor/display_folded = true
|
||||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -83.9196, -0.0216179, -105.861 )
|
||||
layers = 3
|
||||
mesh = SubResource( 3 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user