coyote hunt
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="11f423bdd4ed2639a5486bf4e591b1fe"
|
||||||
|
dest_md5="f3a457935bec02fdf35193bebf7f6d82"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="7749d705a63fa1cb5ff94a279090d0fb"
|
||||||
|
dest_md5="2a4254ee95e898914e2ac9278cfc4a07"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="c09637a85b57ae4a57a7990047e09dc6"
|
||||||
|
dest_md5="f7154fde0c16cdb23fc7fe89c34106f3"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="4a2877b46221d101fe9dc4afd434f8b3"
|
||||||
|
dest_md5="407ca6c5f931f4f366bfccac1f865f31"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="f7b42e3798f5fbc6ffbc08d4bed7b885"
|
||||||
|
dest_md5="2ac2f63d7f2e21bbf94dfb63cf39dd46"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="bbb0258173637aceab3089ce20a81e6d"
|
||||||
|
dest_md5="0a54533b694fbbf9e000487ab968844a"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="f6825a9c0fadbafe6af3d4728d62f7fb"
|
||||||
|
dest_md5="e463d96fe33669c1c036cbdb64ce3e90"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="96dbe5e3b91fa05565170ca1d72df7e5"
|
||||||
|
dest_md5="8cd30cae90ca9d60d119b903c7f6a767"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="e2668f31986a11c869d67282c21ac506"
|
||||||
|
dest_md5="983dca7cc8e813597ac8d2a1585c006b"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="0c8f200205823fbb0552de1abe872893"
|
||||||
|
dest_md5="959514eae00c06ae8c6300722fbaffd9"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="363a4fffe543eb01645f3c16ac0ce1b7"
|
||||||
|
dest_md5="4ae74020d6a01b7c04a95ae618bcaac9"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="f90eb2a42a4830f472ae6e7faaed8cd8"
|
||||||
|
dest_md5="c911b27c9e9aaef63b52f2cf109fc53e"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="bbb0258173637aceab3089ce20a81e6d"
|
||||||
|
dest_md5="0a54533b694fbbf9e000487ab968844a"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="80046739790bbb329462e6c9302446e5"
|
||||||
|
dest_md5="cdb58b58d6806b3fd27e390c0044bf57"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
|
||||||
|
dest_md5="2ded9e7f9060e2b530aab678b135fc5b"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="0c8f200205823fbb0552de1abe872893"
|
||||||
|
dest_md5="959514eae00c06ae8c6300722fbaffd9"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="f6825a9c0fadbafe6af3d4728d62f7fb"
|
||||||
|
dest_md5="e463d96fe33669c1c036cbdb64ce3e90"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="96dbe5e3b91fa05565170ca1d72df7e5"
|
||||||
|
dest_md5="8cd30cae90ca9d60d119b903c7f6a767"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="74ed76981e48b5f246d308f7df03d1ed"
|
||||||
|
dest_md5="f6667eb9247d96820fe0561f089f7ecf"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="e2668f31986a11c869d67282c21ac506"
|
||||||
|
dest_md5="983dca7cc8e813597ac8d2a1585c006b"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="0875168065f5634b350848e92d201af9"
|
||||||
|
dest_md5="30c43c641a7e3c098959489f3153641f"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="7749d705a63fa1cb5ff94a279090d0fb"
|
||||||
|
dest_md5="2a4254ee95e898914e2ac9278cfc4a07"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="c09637a85b57ae4a57a7990047e09dc6"
|
||||||
|
dest_md5="f7154fde0c16cdb23fc7fe89c34106f3"
|
||||||
|
|
@ -0,0 +1,190 @@
|
|||||||
|
[gd_scene load_steps=29 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://res/level/neighbor.png" type="Texture" id=1]
|
||||||
|
[ext_resource path="res://res/character/girl.png" type="Texture" id=2]
|
||||||
|
[ext_resource path="res://res/character/randos.png" type="Texture" id=3]
|
||||||
|
[ext_resource path="res://res/character/wolf.png" type="Texture" id=4]
|
||||||
|
[ext_resource path="res://entity/KinematicBody2D.gd" type="Script" id=5]
|
||||||
|
[ext_resource path="res://entity/Girl.gd" type="Script" id=6]
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=1]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 99, 0, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=2]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 99, 50, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=3]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 99, 100, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=4]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 99, 150, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=5]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 99, 200, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=6]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 33, 0, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=7]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 33, 50, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=8]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 33, 100, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=9]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 33, 150, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=10]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 33, 200, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=11]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 66, 0, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=12]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 66, 50, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=13]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 66, 100, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=14]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 66, 150, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=15]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 66, 200, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=16]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 0, 0, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=17]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 0, 50, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=18]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 0, 100, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=19]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 0, 150, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id=20]
|
||||||
|
flags = 4
|
||||||
|
atlas = ExtResource( 2 )
|
||||||
|
region = Rect2( 0, 200, 33, 50 )
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id=21]
|
||||||
|
animations = [ {
|
||||||
|
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ) ],
|
||||||
|
"loop": true,
|
||||||
|
"name": "WalkRight",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [ SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ) ],
|
||||||
|
"loop": true,
|
||||||
|
"name": "WalkLeft",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [ SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ) ],
|
||||||
|
"loop": true,
|
||||||
|
"name": "WalkUp",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [ SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ) ],
|
||||||
|
"loop": true,
|
||||||
|
"name": "WalkDown",
|
||||||
|
"speed": 5.0
|
||||||
|
} ]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape2D" id=22]
|
||||||
|
radius = 7.49152
|
||||||
|
|
||||||
|
[node name="Node" type="Node"]
|
||||||
|
|
||||||
|
[node name="World" type="Node2D" parent="."]
|
||||||
|
|
||||||
|
[node name="Level" type="Sprite" parent="World"]
|
||||||
|
texture = ExtResource( 1 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_lock_": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="Enter" type="Position2D" parent="World"]
|
||||||
|
position = Vector2( 208.579, 63.3655 )
|
||||||
|
|
||||||
|
[node name="Girl" type="Node" parent="World/Enter"]
|
||||||
|
script = ExtResource( 6 )
|
||||||
|
|
||||||
|
[node name="KinematicBody2D" type="KinematicBody2D" parent="World/Enter/Girl"]
|
||||||
|
position = Vector2( 208.579, 63.3655 )
|
||||||
|
script = ExtResource( 5 )
|
||||||
|
|
||||||
|
[node name="AnimatedSprite" type="AnimatedSprite" parent="World/Enter/Girl/KinematicBody2D"]
|
||||||
|
frames = SubResource( 21 )
|
||||||
|
animation = "WalkDown"
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="World/Enter/Girl/KinematicBody2D"]
|
||||||
|
position = Vector2( 1, -2 )
|
||||||
|
shape = SubResource( 22 )
|
||||||
|
|
||||||
|
[node name="SpawnNPC" type="Position2D" parent="World"]
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_lock_": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="NPC" type="Sprite" parent="World/SpawnNPC"]
|
||||||
|
texture = ExtResource( 3 )
|
||||||
|
region_enabled = true
|
||||||
|
region_rect = Rect2( 7, 4, 34, 38 )
|
||||||
|
region_filter_clip = true
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_lock_": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="SpawnEnemy" type="Position2D" parent="World"]
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_lock_": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="Coyote" type="Sprite" parent="World/SpawnEnemy"]
|
||||||
|
texture = ExtResource( 4 )
|
||||||
|
region_enabled = true
|
||||||
|
region_rect = Rect2( 0, 3, 38, 39 )
|
||||||
|
region_filter_clip = true
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_lock_": true
|
||||||
|
}
|
@ -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 )
|
@ -0,0 +1,3 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
# Variables
|
@ -0,0 +1,74 @@
|
|||||||
|
extends KinematicBody2D
|
||||||
|
|
||||||
|
# Variables
|
||||||
|
## Speed
|
||||||
|
export (int) var base_speed = 200 setget set_base_speed, get_base_speed # Character's speed (scalar)
|
||||||
|
export (int) var speed setget , get_speed # Character's speed (scalar)
|
||||||
|
var speed_mod = 1
|
||||||
|
var speed_ceil = 5
|
||||||
|
var speed_floor = .01
|
||||||
|
## Velocity
|
||||||
|
var can_move = true setget set_can_move, get_can_move
|
||||||
|
export (Vector2) var velocity = Vector2(0,0) setget set_velocity, get_velocity # Character's directional velocity (vector)
|
||||||
|
var internal_velocity = Vector2(0,0) setget set_internal_velocity, get_internal_velocity
|
||||||
|
var external_velocity = Vector2(0,0) setget set_external_velocity, get_external_velocity
|
||||||
|
var velocity_mod = 1
|
||||||
|
|
||||||
|
# Setters + Getters
|
||||||
|
func set_base_speed(new_speed):
|
||||||
|
base_speed = new_speed
|
||||||
|
func get_base_speed():
|
||||||
|
return base_speed
|
||||||
|
func set_can_move(new_bool):
|
||||||
|
can_move = new_bool
|
||||||
|
func get_can_move():
|
||||||
|
return can_move
|
||||||
|
func set_external_velocity(new_velocity):
|
||||||
|
external_velocity = new_velocity
|
||||||
|
func get_external_velocity():
|
||||||
|
return external_velocity
|
||||||
|
func set_internal_velocity(new_velocity):
|
||||||
|
internal_velocity = new_velocity
|
||||||
|
func get_internal_velocity():
|
||||||
|
if not get_can_move():
|
||||||
|
return Vector2(0.0,0.0)
|
||||||
|
return internal_velocity
|
||||||
|
func get_speed():
|
||||||
|
if !get_can_move():
|
||||||
|
return 0
|
||||||
|
else:
|
||||||
|
return base_speed * get_speed_mod()
|
||||||
|
func get_speed_mod():
|
||||||
|
if speed_mod < speed_floor:
|
||||||
|
return speed_floor
|
||||||
|
elif speed_mod > speed_ceil:
|
||||||
|
return speed_ceil
|
||||||
|
else:
|
||||||
|
return speed_mod
|
||||||
|
func set_velocity(new_velocity):
|
||||||
|
velocity = new_velocity
|
||||||
|
func get_velocity():
|
||||||
|
return get_internal_velocity().normalized()
|
||||||
|
func get_velocity_angle():
|
||||||
|
return get_velocity().angle()
|
||||||
|
func get_velocity_length():
|
||||||
|
return get_velocity().length()
|
||||||
|
func get_user():
|
||||||
|
return get_parent()
|
||||||
|
|
||||||
|
# Logic
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
var v = get_velocity() * get_speed() * delta * KnowledgeBase.logic_time
|
||||||
|
print(move_and_collide(v))
|
||||||
|
if v != Vector2(0,0):
|
||||||
|
MessageBus.publish("moved", get_user())
|
||||||
|
|
||||||
|
#func _on_input_event(viewport, event, shape_idx):
|
||||||
|
# get_physics_body_node()._on_input_event(viewport, event, shape_idx)
|
||||||
|
|
||||||
|
func _setup():
|
||||||
|
set_process(true)
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
set_process(false)
|
@ -0,0 +1,8 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
# Event Handler for Encountering Knowledge
|
||||||
|
|
||||||
|
# Learn incoming encountered knowledge
|
||||||
|
func handle(new_content):
|
||||||
|
print_debug("KnowledgeBase: encountered " + new_content[0])
|
||||||
|
KnowledgeBase.learn(new_content)
|
@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene load_steps=2 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Events/knowledge/Encountered.gd" type="Script" id=1]
|
||||||
|
|
||||||
|
[node name="Encountered" type="Node"]
|
||||||
|
script = ExtResource( 1 )
|
@ -0,0 +1,11 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
# Event Handler for Forgetting Knowledge
|
||||||
|
|
||||||
|
# Signals
|
||||||
|
signal forgot
|
||||||
|
|
||||||
|
# Handle
|
||||||
|
func handle(knowledge):
|
||||||
|
if get_tree().get_nodes_in_group("player").size() > 0:
|
||||||
|
get_tree().get_nodes_in_group("player")[0].think("Forgot: " + knowledge)
|
@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene load_steps=2 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Events/knowledge/Forgot.gd" type="Script" id=1]
|
||||||
|
|
||||||
|
[node name="Forgot" type="Node"]
|
||||||
|
script = ExtResource( 1 )
|
@ -0,0 +1,16 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
# Event Handler for Learning Knowledge
|
||||||
|
|
||||||
|
# Signals
|
||||||
|
signal learned
|
||||||
|
|
||||||
|
func bingo(knowledge):
|
||||||
|
if knowledge in KnowledgeBase.bingo_knowledge:
|
||||||
|
MessageBus.publish("bingo", self)
|
||||||
|
|
||||||
|
# Handle
|
||||||
|
func handle(knowledge):
|
||||||
|
if get_tree().get_nodes_in_group("player").size() > 0:
|
||||||
|
get_tree().get_nodes_in_group("player")[0].think("Learned: " + knowledge)
|
||||||
|
bingo(knowledge)
|
@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene load_steps=2 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Events/knowledge/Learned.gd" type="Script" id=1]
|
||||||
|
|
||||||
|
[node name="Learned" type="Node"]
|
||||||
|
script = ExtResource( 1 )
|
@ -0,0 +1,12 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
# Event Handler for Encountering Knowledge
|
||||||
|
|
||||||
|
# Learn incoming encountered knowledge
|
||||||
|
func handle(old_content):
|
||||||
|
print_debug("KnowledgeBase: " + old_content)
|
||||||
|
KnowledgeBase.forget(old_content)
|
||||||
|
|
||||||
|
# Ready
|
||||||
|
func _ready():
|
||||||
|
MessageBus.subscribe("lost", self)
|
@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene load_steps=2 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Events/knowledge/Lost.gd" type="Script" id=1]
|
||||||
|
|
||||||
|
[node name="Lost" type="Node"]
|
||||||
|
script = ExtResource( 1 )
|
@ -0,0 +1,11 @@
|
|||||||
|
extends "res://events/moved/Moved.gd"
|
||||||
|
|
||||||
|
# Event Handler for Character Moving
|
||||||
|
|
||||||
|
func _arrived(character): # at next
|
||||||
|
var next = character.get_next()
|
||||||
|
return next && character.reached_next()
|
||||||
|
|
||||||
|
func _reached(character): # at current dot
|
||||||
|
var cd = character.get_current_dot()
|
||||||
|
return cd && character.reached_current_dot()
|
@ -0,0 +1,6 @@
|
|||||||
|
[gd_scene load_steps=2 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://events/moved/Char.gd" type="Script" id=1]
|
||||||
|
|
||||||
|
[node name="Moved" type="Node"]
|
||||||
|
script = ExtResource( 1 )
|
@ -0,0 +1,51 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
# Event Handler for Moving
|
||||||
|
|
||||||
|
# Variable
|
||||||
|
var topic = "moved"
|
||||||
|
var positions = []
|
||||||
|
|
||||||
|
func _arrived(_character):
|
||||||
|
return false
|
||||||
|
|
||||||
|
# are positions the same?
|
||||||
|
func compare_pos():
|
||||||
|
var p1 = positions[0]
|
||||||
|
for p in positions:
|
||||||
|
if p != p1:
|
||||||
|
return false # moving
|
||||||
|
return true # not moving
|
||||||
|
|
||||||
|
func _reached(_character):
|
||||||
|
return false
|
||||||
|
|
||||||
|
func track_pos(new_pos):
|
||||||
|
positions.append(new_pos)
|
||||||
|
if len(positions) > 50:
|
||||||
|
positions.pop_front()
|
||||||
|
|
||||||
|
# Handle
|
||||||
|
func handle(character):
|
||||||
|
var current_pos = character.get_gpos()
|
||||||
|
track_pos(current_pos)
|
||||||
|
if _arrived(character):
|
||||||
|
character.think("Moved/Arrived")
|
||||||
|
character.emit_signal("arrived")
|
||||||
|
return
|
||||||
|
elif _reached(character):
|
||||||
|
character.think("Moved/Reached Dot")
|
||||||
|
character.emit_signal("reached")
|
||||||
|
return
|
||||||
|
elif compare_pos():
|
||||||
|
character.think("Moved/Not Moving")
|
||||||
|
character.emit_signal("not_moving")
|
||||||
|
return
|
||||||
|
#elif character.get_internal_velocity() != Vector2(0.0,0.0) and character.get_velocity() != character.get_internal_velocity():
|
||||||
|
# var sdfoia = character.get_internal_velocity()
|
||||||
|
# var posjk = character.get_velocity()
|
||||||
|
# character.think("Moved/Wrong Directiaon")
|
||||||
|
# character.emit_signal("wrong_direction")
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
|
@ -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
|
@ -0,0 +1,64 @@
|
|||||||
|
; 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
|
||||||
|
|
||||||
|
_global_script_classes=[ ]
|
||||||
|
_global_script_class_icons={
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[application]
|
||||||
|
|
||||||
|
config/name="CoyoteHunt"
|
||||||
|
run/main_scene="res://Main.tscn"
|
||||||
|
config/icon="res://icon.png"
|
||||||
|
|
||||||
|
[autoload]
|
||||||
|
|
||||||
|
KnowledgeBase="*res://singletons/KnowledgeBase.gd"
|
||||||
|
MessageBus="*res://singletons/MessageBus.gd"
|
||||||
|
|
||||||
|
[display]
|
||||||
|
|
||||||
|
window/size/width=800
|
||||||
|
|
||||||
|
[input]
|
||||||
|
|
||||||
|
ui_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":16777231,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
, 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)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
ui_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":16777233,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
, 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)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
ui_up={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
|
||||||
|
, 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)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
ui_down={
|
||||||
|
"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":16777234,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
, 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)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
[rendering]
|
||||||
|
|
||||||
|
environment/default_environment="res://default_env.tres"
|
After Width: | Height: | Size: 165 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/girl.png-5c2af37ae11c98f8397e9a8eaab71dd1.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://res/character/girl.png"
|
||||||
|
dest_files=[ "res://.import/girl.png-5c2af37ae11c98f8397e9a8eaab71dd1.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
|
After Width: | Height: | Size: 6.2 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/grillman.png-c24e905f4dc4b0bc9b80d248d20fd5f8.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://res/character/grillman.png"
|
||||||
|
dest_files=[ "res://.import/grillman.png-c24e905f4dc4b0bc9b80d248d20fd5f8.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
|
After Width: | Height: | Size: 24 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/randos.png-4e3607b2f3cdf1500e4bae5ce47ac792.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://res/character/randos.png"
|
||||||
|
dest_files=[ "res://.import/randos.png-4e3607b2f3cdf1500e4bae5ce47ac792.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
|
After Width: | Height: | Size: 8.4 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/slime.png-e17719a26081aa14f4130feaf6acfe2e.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://res/character/slime.png"
|
||||||
|
dest_files=[ "res://.import/slime.png-e17719a26081aa14f4130feaf6acfe2e.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
|
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/wolf.png-c2fcd269881e6c06a187fddcc690bc9a.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://res/character/wolf.png"
|
||||||
|
dest_files=[ "res://.import/wolf.png-c2fcd269881e6c06a187fddcc690bc9a.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
|
After Width: | Height: | Size: 184 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/graveyard.png-ce02690c87ca77f6f94fa4f24f015aa8.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://res/level/graveyard.png"
|
||||||
|
dest_files=[ "res://.import/graveyard.png-ce02690c87ca77f6f94fa4f24f015aa8.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
|
After Width: | Height: | Size: 116 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/lake.png-05c24eba17f93b94b17afad1068b707b.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://res/level/lake.png"
|
||||||
|
dest_files=[ "res://.import/lake.png-05c24eba17f93b94b17afad1068b707b.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
|
After Width: | Height: | Size: 128 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/library.png-7570102310ea890595efa260efa49a5b.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://res/level/library.png"
|
||||||
|
dest_files=[ "res://.import/library.png-7570102310ea890595efa260efa49a5b.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
|
After Width: | Height: | Size: 117 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/neighbor.png-2e621ef67fcfd4f19668ff0b81af7224.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://res/level/neighbor.png"
|
||||||
|
dest_files=[ "res://.import/neighbor.png-2e621ef67fcfd4f19668ff0b81af7224.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
|
After Width: | Height: | Size: 264 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/sewers.png-c8c581ec69472520d44800f676cfa99e.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://res/level/sewers.png"
|
||||||
|
dest_files=[ "res://.import/sewers.png-c8c581ec69472520d44800f676cfa99e.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
|
After Width: | Height: | Size: 122 KiB |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/warehouse.png-d6982bccd64eb6fb49faea76f08d16ee.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://res/level/warehouse.png"
|
||||||
|
dest_files=[ "res://.import/warehouse.png-d6982bccd64eb6fb49faea76f08d16ee.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
|
@ -0,0 +1,107 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
# Variables
|
||||||
|
## Other Data
|
||||||
|
var logic_time = 1
|
||||||
|
var draw_time = 1
|
||||||
|
## Handlers
|
||||||
|
#var encountered_handler = load("res://events/knowledge/Encountered.tscn").instance()
|
||||||
|
#var lost_handler = load("res://events/knowledge/Lost.tscn").instance()
|
||||||
|
#var learned_handler = load("res://events/knowledge/Learned.tscn").instance()
|
||||||
|
#var forgot_handler = load("res://events/knowledge/Forgot.tscn").instance()
|
||||||
|
## Keys
|
||||||
|
const bingo_knowledge = []
|
||||||
|
const BINGO_IT4_KEY = "smb001"
|
||||||
|
const BINGO_LVL_KEY = "ml1000"
|
||||||
|
const CHARACTER_CREATION_KEY = "smc001"
|
||||||
|
const ACT_GROUP = ['act100','act200','act001','act002'] # Plastic Tub
|
||||||
|
const IT3_GROUP = ['it3000','it3001','it3002','it3003','it3004'] # Three-Leaf Clover
|
||||||
|
const IT4_GROUP = ['it4000','it4001','it4002','it4003','it4004'] # Four-Leaf Clover
|
||||||
|
const CCB_GROUP = ['ccb000','ccb001','ccb002','ccb003'] # Bad Cat
|
||||||
|
const CCN_GROUP = ['ccn000','ccn001','ccn002','ccn003'] # Neighborhood Cat
|
||||||
|
const CMC_GROUP = ['cmc000','cmc001','cmc002','cmc003'] # Chloe
|
||||||
|
const CMN_GROUP = ['cmn000','cmn001','cmn002','cmn003'] # Night
|
||||||
|
## Knowledge Base
|
||||||
|
var knowledge = {
|
||||||
|
# code: ["title", "desc", ["tags"], "source", "learned?"]
|
||||||
|
'a00000': ['teacti', 'teacti', ["term"], "", false], # activator
|
||||||
|
'ac0000': ['tecont', 'tecont', ["term"], "", false], # container
|
||||||
|
'act100': ['actubb', 'deactubb', ["activator"], "", false], # blue plastic tub
|
||||||
|
'act200': ['actubg', 'deactubg', ["activator"], "", false], # green plastic tub
|
||||||
|
'act001': ['actubb', 'deactubb', ["activator","category"], "", false], # plastic tub category
|
||||||
|
'act002': ['actubb', 'deactubb', ["activator","subcategory"], "", false], # plastic tub subcategory
|
||||||
|
'c00000': ['techar', 'techar', ["term"], "", false], # character
|
||||||
|
'cc0000': ['facata', 'facata', ["faction"], "", false], # cat
|
||||||
|
'ccn000': ['chneig', 'dechneig', ["character"], "", false], # neighborhood cat
|
||||||
|
'ccn001': ['tecate', 'techar', ["ccb000","category"], "", true], # neighborhood cat category
|
||||||
|
'ccn002': ['tefact', 'facata', ["ccb000","faction"], "", false], # neighborhood cat faction
|
||||||
|
'ccn003': ['tehost', 'teally', ["ccb000","hostility"], "", false], # neighborhood cat hostility
|
||||||
|
'ccb000': ['chbadc', 'dechbadc', ["character"], "", false], # bad cat
|
||||||
|
'ccb001': ['tecate', 'techar', ["ccb000","category"], "", true], # bad cat category
|
||||||
|
'ccb002': ['tefact', 'facata', ["ccb000","faction"], "", false], # bad cat faction
|
||||||
|
'ccb003': ['tehost', 'tefoea', ["ccb000","hostility"], "", false], # bad cat hostility
|
||||||
|
'ch0000': ['fahuma', 'fahuma', ["faction"], "", false], # human
|
||||||
|
'cmc000': ['chchlo', 'dechchlo', ["character"], "", false], # chloe
|
||||||
|
'cmc001': ['tecate', 'techar', ["cmc000","category"], "", true], # chloe category
|
||||||
|
'cmc002': ['tefact', 'fashma', ["cmc000","faction"], "", false], # chloe faction
|
||||||
|
'cmc003': ['tehost', 'teally', ["cmc000","hostility"], "", false], # chloe hostility
|
||||||
|
'cmn000': ['chnigh', 'dechnigh', ["character"], "", false], # night
|
||||||
|
'cmn001': ['tecate', 'techar', ["cmc000","category"], "", true], # night category
|
||||||
|
'cmn002': ['tefact', 'tedoct', ["cmc000","faction"], "", false], # night faction
|
||||||
|
'cmn003': ['tehost', 'teally', ["cmc000","hostility"], "", false], # night hostility
|
||||||
|
'cmp001': ['chheli', 'dechheli', ["character"], "", false], # player
|
||||||
|
'i00000': ['teitem', 'teitem', ["term"], "", false], # item
|
||||||
|
'it0000': ['ictrin', 'ictrin', ["item_category"], "", false], # item
|
||||||
|
'it3000': ['it3lea', 'deit3lea', ["item"], "", false], # three-leaf clover
|
||||||
|
'it3001': ['tecate', 'caitem', ["it3000","category"], "", true], # three-leaf clover category
|
||||||
|
'it3002': ['tesubc', 'ictrin', ["it3000","subcategory"], "", false], # three-leaf clover subcategory
|
||||||
|
'it3003': ['terari', 'irmund', ["it3000","rarity"], "", false], # three-leaf clover rarity
|
||||||
|
'it3004': ['tevalu', 'tevalu', ["it3000","value"], "", false], # three-leaf clover value
|
||||||
|
'it4000': ['it4lea', 'deit4lea', ["item"], "", false], # four-leaf clover
|
||||||
|
'it4001': ['tecate', 'caitem', ["it4000","category"], "", true], # four-leaf clover category
|
||||||
|
'it4002': ['tesubc', 'ictrin', ["it4000","subcategory"], "", false], # four-leaf clover subcategory
|
||||||
|
'it4003': ['terari', 'irrare', ["it4000","rarity"], "", false], # four-leaf clover rarity
|
||||||
|
'it4004': ['tevalu', 'tevalu', ["it4000","value"], "", false], # four-leaf clover value
|
||||||
|
'ml0000': ['techlv', 'techlv', ["term"], "", true], # level
|
||||||
|
'ml1000': ['techle', 'techle', ["techlv"], "", false], # level 1
|
||||||
|
'sm0000': ['wogati', 'wogati', ["term"], "", false], # main story
|
||||||
|
'smb000': ['evmibi', 'evmibi', ['sm0000'], "", false], # bingo
|
||||||
|
'smb001': ['it4lea', 'deit4lea', ['smb001'], "", false], # bingo - four-leaf clover pickup
|
||||||
|
'smc000': ['evchcr', 'evchcr', ["sm0000"], "", false], # character creation
|
||||||
|
'smc001': ['evchcr', 'evchcr', ["smc000"], "", false] # character created
|
||||||
|
}
|
||||||
|
|
||||||
|
func learn(new_content):
|
||||||
|
knowledge[new_content[0]][3] = new_content[1] # set source
|
||||||
|
knowledge[new_content[0]][4] = true # set knowledge as learned
|
||||||
|
MessageBus.publish("learned", new_content[0]) # reap benefits
|
||||||
|
|
||||||
|
func forget(old_content):
|
||||||
|
print_debug("KnowledgeBase: Forgetting " + old_content)
|
||||||
|
knowledge[old_content][4] = false # set knowledge as learned
|
||||||
|
MessageBus.publish("forgot", old_content) # reap benefits
|
||||||
|
|
||||||
|
func do_know(key):
|
||||||
|
#print_debug(key + " is " + str(knowledge[key][4]))
|
||||||
|
return knowledge[key][4]
|
||||||
|
|
||||||
|
func has_tag(key,tag):
|
||||||
|
return tag in knowledge[key][2]
|
||||||
|
|
||||||
|
# Ready
|
||||||
|
func _ready():
|
||||||
|
return
|
||||||
|
# add_child(learned_handler)
|
||||||
|
# add_child(forgot_handler)
|
||||||
|
# add_child(encountered_handler)
|
||||||
|
# MessageBus.subscribe("learned", learned_handler)
|
||||||
|
# MessageBus.subscribe("forgot", lost_handler)
|
||||||
|
# MessageBus.subscribe("encountered", encountered_handler)
|
||||||
|
|
||||||
|
# Serialize
|
||||||
|
func serialize():
|
||||||
|
return knowledge
|
||||||
|
|
||||||
|
# Deserialize
|
||||||
|
func deserialize(dict):
|
||||||
|
knowledge = dict
|
@ -0,0 +1,82 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
# Message Bus
|
||||||
|
|
||||||
|
# Signals
|
||||||
|
#signal published()
|
||||||
|
|
||||||
|
# Variables
|
||||||
|
#var Mercur = load("res://entity/Mercur/Mercur.tscn").instance() # mail god
|
||||||
|
var current_ref_id = -1
|
||||||
|
var topicDict = {}
|
||||||
|
var approached_topic = "approached"
|
||||||
|
#var approached_handler = load("res://Events/approached/Approach.tscn").instance()
|
||||||
|
var died_topic = "died"
|
||||||
|
#var died_handler = load("res://Events/died/Died.tscn").instance()
|
||||||
|
var duration = "duration"
|
||||||
|
var earned_xp_topic = "xp_earned"
|
||||||
|
#var earned_xp_handler = load("res://Events/xp_changed/EarnedXP.tscn").instance()
|
||||||
|
var equipped_skill_topic = "skill_equipped"
|
||||||
|
#var equipped_skill_handler = load("res://Events/skill_equipped/EquipSkill.tscn").instance()
|
||||||
|
var gained_level_topic = "level_gained"
|
||||||
|
#var gained_level_handler = load("res://Events/xp_changed/GainLevel.tscn").instance()
|
||||||
|
var interacted_topic = "interacted"
|
||||||
|
#var interacted_handler = load("res://Events/character_interacted/Interact.tscn").instance()
|
||||||
|
var item_picked_up_topic = "item_picked_up"
|
||||||
|
#var learned_item_handler = load("res://Events/item_picked_up/LearnItem/LearnItem.tscn").instance()
|
||||||
|
var learned_skill_topic = "skill_learned"
|
||||||
|
#var learned_skill_handler = load("res://Events/skill_learned/LearnSkill.tscn").instance()
|
||||||
|
var moved_handler = load("res://events/moved/Char.tscn").instance()
|
||||||
|
var moved_topic = "moved"
|
||||||
|
|
||||||
|
func designate_ref_id():
|
||||||
|
current_ref_id += 1
|
||||||
|
return current_ref_id
|
||||||
|
|
||||||
|
# Take data + hand off to Event Handlers subscribed to event
|
||||||
|
func publish(topic, data):
|
||||||
|
if !topicDict.has(topic):
|
||||||
|
# print_debug("publish - unknown topic: " + topic)
|
||||||
|
return
|
||||||
|
for handler in topicDict[topic]:
|
||||||
|
handler.handle(data)
|
||||||
|
|
||||||
|
# Handler begins listening for topic
|
||||||
|
func subscribe(topic, handler):
|
||||||
|
if !topicDict.has(topic):
|
||||||
|
# print_debug("subscribe - new topic: " + topic)
|
||||||
|
topicDict[topic] = []
|
||||||
|
#return
|
||||||
|
topicDict[topic].append(handler)
|
||||||
|
handler.connect("tree_exited", self, "_on_handler_tree_exited", [topic, handler])
|
||||||
|
|
||||||
|
# Handler no longer listens for topic
|
||||||
|
func unsubscribe(topic, handler):
|
||||||
|
if !topicDict.has(topic):
|
||||||
|
# print_debug("Cannot unsubscribe handler that does not exist")
|
||||||
|
return
|
||||||
|
topicDict[topic].erase(handler)
|
||||||
|
|
||||||
|
func _on_handler_tree_exited(topic, handler):
|
||||||
|
unsubscribe(topic, handler)
|
||||||
|
|
||||||
|
# if this character exits tree
|
||||||
|
func _on_tree_exited():
|
||||||
|
#unsubscribe(died_topic, died_handler)
|
||||||
|
#unsubscribe(earned_xp_topic, earned_xp_handler)
|
||||||
|
#unsubscribe(gained_level_topic, gained_level_handler)
|
||||||
|
#subscribe(gained_level_topic, gained_level_handler)
|
||||||
|
#unsubscribe(item_picked_up_topic, learned_item_handler)
|
||||||
|
#unsubscribe(learned_skill_topic, learned_skill_handler)
|
||||||
|
unsubscribe(moved_topic, moved_handler)
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
#subscribe(died_topic, died_handler)
|
||||||
|
#subscribe(earned_xp_topic, earned_xp_handler)
|
||||||
|
#subscribe(gained_level_topic, gained_level_handler)
|
||||||
|
#subscribe(interacted_topic, interacted_handler)
|
||||||
|
#subscribe(item_picked_up_topic, learned_item_handler)
|
||||||
|
#subscribe(learned_skill_topic, learned_skill_handler)
|
||||||
|
subscribe(moved_topic, moved_handler)
|
||||||
|
# connect("tree_exited", self, "_on_tree_exited")
|
||||||
|
|