merged
This commit is contained in:
commit
00ec79dd53
@ -11,6 +11,7 @@ func _ready():
|
|||||||
func _process(delta):
|
func _process(delta):
|
||||||
# Taking a pill
|
# Taking a pill
|
||||||
if Input.is_action_just_pressed("take_pill"):
|
if Input.is_action_just_pressed("take_pill"):
|
||||||
Pills.take_pill()
|
|
||||||
#Logger.info("Player took a pill, new level: %s" % [Pills.get_round_level()])
|
#Logger.info("Player took a pill, new level: %s" % [Pills.get_round_level()])
|
||||||
_animation.play("PillTaking")
|
_animation.play("PillTaking")
|
||||||
|
yield(_animation, "animation_finished")
|
||||||
|
Pills.take_pill()
|
@ -1,11 +1,22 @@
|
|||||||
extends NPC
|
extends NPC
|
||||||
|
|
||||||
|
const diffPerSecond = 5
|
||||||
|
var _arrived_distance_threshold = 0.1
|
||||||
|
|
||||||
var _interactArea: Area
|
var _interactArea: Area
|
||||||
|
var _navPath: Path
|
||||||
|
var _followPath: PathFollow
|
||||||
|
var _current_nav_index = 0
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
#Logger.set_logger_level(Logger.LOG_LEVEL_FINE)
|
#Logger.set_logger_level(Logger.LOG_LEVEL_FINE)
|
||||||
|
|
||||||
|
_followPath = get_node("../") as PathFollow
|
||||||
|
assert(null != _followPath)
|
||||||
|
|
||||||
|
_navPath = get_node("../../") as Path
|
||||||
|
assert(null != _navPath)
|
||||||
|
|
||||||
var _interactArea = get_node("InteractArea") as Area
|
var _interactArea = get_node("InteractArea") as Area
|
||||||
assert(null != _interactArea)
|
assert(null != _interactArea)
|
||||||
_interactArea.connect("area_entered", self, "_on_area_entered")
|
_interactArea.connect("area_entered", self, "_on_area_entered")
|
||||||
@ -13,11 +24,10 @@ func _ready():
|
|||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
# TODO: movement
|
# TODO: movement
|
||||||
#if current_target: # should not be needed -> handled per navigation path
|
#if current_target: # should not be needed -> handled per navigation path
|
||||||
pass
|
_followPath.offset += diffPerSecond * _delta
|
||||||
|
|
||||||
|
|
||||||
func _on_area_entered (area: Area):
|
func _on_area_entered (area: Area):
|
||||||
if area.is_in_group("FactoryEntry"):
|
if area.is_in_group("FactoryEntry"):
|
||||||
# despawn
|
# despawn
|
||||||
queue_free()
|
queue_free()
|
||||||
pass
|
|
@ -1,21 +1,30 @@
|
|||||||
extends Spatial
|
extends Spatial
|
||||||
|
|
||||||
const SPAWN_TIME_MIN = 3000 # min spawntime in ms
|
export(NodePath) var _nodepath
|
||||||
const SPAWN_TIME_MAX = 7000 # max spawntime in ms
|
export(float) var _offset
|
||||||
|
|
||||||
|
const SPAWN_TIME_MIN = 5000 # min spawntime in ms
|
||||||
|
const SPAWN_TIME_MAX = 8000 # max spawntime in ms
|
||||||
|
|
||||||
var _worker
|
var _worker
|
||||||
var _lastSpawn = 0 # timestamp of last spawned worker
|
var _lastSpawn = 0 # timestamp of last spawned worker
|
||||||
|
var _path: Path
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
_worker = load("res://Characters/Worker/Worker.tscn")
|
_worker = load("res://Characters/Worker/Worker.tscn")
|
||||||
assert(null != _worker)
|
assert(null != _worker)
|
||||||
|
|
||||||
|
_path = get_node(_nodepath)
|
||||||
|
assert(null != _path)
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
# spawns new workers after defined time
|
# spawns new workers after defined time
|
||||||
var cur_time = OS.get_ticks_msec()
|
var cur_time = OS.get_ticks_msec()
|
||||||
var diff = rand_range(SPAWN_TIME_MIN, SPAWN_TIME_MAX)
|
var diff = rand_range(SPAWN_TIME_MIN, SPAWN_TIME_MAX)
|
||||||
if cur_time - _lastSpawn > diff:
|
if cur_time - _lastSpawn > diff:
|
||||||
#Logger.info(name + " spawning new worker")
|
#Logger.info(name + " spawning new worker")
|
||||||
var new_worker = _worker.instance()
|
var pathFollow = PathFollow.new()
|
||||||
add_child(new_worker)
|
pathFollow.offset = _offset
|
||||||
|
pathFollow.add_child(_worker.instance())
|
||||||
|
_path.add_child(pathFollow)
|
||||||
_lastSpawn = cur_time
|
_lastSpawn = cur_time
|
||||||
|
253
Level/World.tscn
253
Level/World.tscn
File diff suppressed because one or more lines are too long
BIN
Resources/Models/Body.material
Normal file
BIN
Resources/Models/Body.material
Normal file
Binary file not shown.
BIN
Resources/Models/Eyes.material
Normal file
BIN
Resources/Models/Eyes.material
Normal file
Binary file not shown.
BIN
Resources/Models/Face.material
Normal file
BIN
Resources/Models/Face.material
Normal file
Binary file not shown.
277
Resources/Models/MaskedCharacter.dae
Normal file
277
Resources/Models/MaskedCharacter.dae
Normal file
File diff suppressed because one or more lines are too long
1062
Resources/Models/MaskedCharacter.dae.import
Normal file
1062
Resources/Models/MaskedCharacter.dae.import
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Resources/Models/Material_002.material
Normal file
BIN
Resources/Models/Material_002.material
Normal file
Binary file not shown.
277
Resources/Models/TrueMeldewesen.dae
Normal file
277
Resources/Models/TrueMeldewesen.dae
Normal file
File diff suppressed because one or more lines are too long
1062
Resources/Models/TrueMeldewesen.dae.import
Normal file
1062
Resources/Models/TrueMeldewesen.dae.import
Normal file
File diff suppressed because it is too large
Load Diff
277
Resources/Models/TrueWorker.dae
Normal file
277
Resources/Models/TrueWorker.dae
Normal file
File diff suppressed because one or more lines are too long
1062
Resources/Models/TrueWorker.dae.import
Normal file
1062
Resources/Models/TrueWorker.dae.import
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Resources/Models/eye.material
Normal file
BIN
Resources/Models/eye.material
Normal file
Binary file not shown.
@ -4,20 +4,19 @@
|
|||||||
[ext_resource path="res://UI/PlayButton.gd" type="Script" id=2]
|
[ext_resource path="res://UI/PlayButton.gd" type="Script" id=2]
|
||||||
[ext_resource path="res://UI/ExitButton.gd" type="Script" id=3]
|
[ext_resource path="res://UI/ExitButton.gd" type="Script" id=3]
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=4]
|
|
||||||
size = 180
|
|
||||||
font_data = ExtResource( 1 )
|
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=1]
|
[sub_resource type="DynamicFont" id=1]
|
||||||
size = 32
|
size = 180
|
||||||
font_data = ExtResource( 1 )
|
font_data = ExtResource( 1 )
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=2]
|
[sub_resource type="DynamicFont" id=2]
|
||||||
size = 32
|
size = 32
|
||||||
font_data = ExtResource( 1 )
|
font_data = ExtResource( 1 )
|
||||||
|
|
||||||
[sub_resource type="Animation" id=3]
|
[sub_resource type="DynamicFont" id=3]
|
||||||
resource_name = "Text"
|
size = 32
|
||||||
|
font_data = ExtResource( 1 )
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id=4]
|
||||||
length = 5.0
|
length = 5.0
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/path = NodePath("ForegroundGoesUp:rect_position")
|
tracks/0/path = NodePath("ForegroundGoesUp:rect_position")
|
||||||
@ -86,7 +85,7 @@ margin_left = 1.0
|
|||||||
margin_top = -1.16635
|
margin_top = -1.16635
|
||||||
margin_right = 1025.0
|
margin_right = 1025.0
|
||||||
margin_bottom = 398.834
|
margin_bottom = 398.834
|
||||||
custom_fonts/font = SubResource( 4 )
|
custom_fonts/font = SubResource( 1 )
|
||||||
custom_colors/font_color = Color( 1, 1, 1, 1 )
|
custom_colors/font_color = Color( 1, 1, 1, 1 )
|
||||||
custom_colors/font_color_shadow = Color( 1, 0, 0, 1 )
|
custom_colors/font_color_shadow = Color( 1, 0, 0, 1 )
|
||||||
custom_constants/shadow_offset_x = 4
|
custom_constants/shadow_offset_x = 4
|
||||||
@ -111,7 +110,7 @@ margin_left = 380.0
|
|||||||
margin_top = 410.0
|
margin_top = 410.0
|
||||||
margin_right = 620.0
|
margin_right = 620.0
|
||||||
margin_bottom = 470.0
|
margin_bottom = 470.0
|
||||||
custom_fonts/font = SubResource( 1 )
|
custom_fonts/font = SubResource( 2 )
|
||||||
custom_colors/font_color = Color( 1, 1, 1, 1 )
|
custom_colors/font_color = Color( 1, 1, 1, 1 )
|
||||||
custom_colors/font_color_hover = Color( 0.980392, 0.839216, 0.619608, 1 )
|
custom_colors/font_color_hover = Color( 0.980392, 0.839216, 0.619608, 1 )
|
||||||
text = "Embark"
|
text = "Embark"
|
||||||
@ -123,7 +122,7 @@ margin_left = 380.0
|
|||||||
margin_top = 470.0
|
margin_top = 470.0
|
||||||
margin_right = 620.0
|
margin_right = 620.0
|
||||||
margin_bottom = 530.0
|
margin_bottom = 530.0
|
||||||
custom_fonts/font = SubResource( 2 )
|
custom_fonts/font = SubResource( 3 )
|
||||||
custom_colors/font_color = Color( 1, 1, 1, 1 )
|
custom_colors/font_color = Color( 1, 1, 1, 1 )
|
||||||
text = "Disembark"
|
text = "Disembark"
|
||||||
flat = true
|
flat = true
|
||||||
@ -131,6 +130,6 @@ script = ExtResource( 3 )
|
|||||||
|
|
||||||
[node name="AnimateForeground" type="AnimationPlayer" parent="."]
|
[node name="AnimateForeground" type="AnimationPlayer" parent="."]
|
||||||
autoplay = "Text"
|
autoplay = "Text"
|
||||||
anims/Text = SubResource( 3 )
|
anims/Text = SubResource( 4 )
|
||||||
[connection signal="pressed" from="PlayButton" to="PlayButton" method="_on_PlayButton_pressed"]
|
[connection signal="pressed" from="PlayButton" to="PlayButton" method="_on_PlayButton_pressed"]
|
||||||
[connection signal="pressed" from="ExitButton" to="ExitButton" method="_on_ExitButton_pressed"]
|
[connection signal="pressed" from="ExitButton" to="ExitButton" method="_on_ExitButton_pressed"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user