Added a new character and modified the way :setup and :ready events are run.

This commit is contained in:
Julian Murgia
2020-12-26 21:53:00 +01:00
parent f26d96f115
commit af8a9ea086
58 changed files with 1259 additions and 340 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/8_way_stand.png-bd624ae15a01b85e2dc1bdd162820a10.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://game/assets_sources/8_way_guy/8_way_stand.png"
dest_files=[ "res://.import/8_way_stand.png-bd624ae15a01b85e2dc1bdd162820a10.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/8_way_walk.png-1bdb405563d96a981227d9d82934482d.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://game/assets_sources/8_way_guy/8_way_walk.png"
dest_files=[ "res://.import/8_way_walk.png-1bdb405563d96a981227d9d82934482d.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/8_way_sprite.png-554307c32b89d6eb23c7824829cc57c7.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://game/assets_sources/8_way_guy/not_used/8_way_sprite.png"
dest_files=[ "res://.import/8_way_sprite.png-554307c32b89d6eb23c7824829cc57c7.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

View File

@@ -94,9 +94,9 @@ animations = [ {
"speed": 8.0
} ]
[node name="character" type="Area2D"]
[node name="android" type="Area2D"]
script = ExtResource( 1 )
global_id = "character"
global_id = "android"
interaction_direction = 3
tooltip_name = "Character"
default_action = "talk"

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/8_way_walk.png-ecdd71f288ccb9d3bbd77c0a124c4d5c.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://game/characters/character2/8_way_walk.png"
dest_files=[ "res://.import/8_way_walk.png-ecdd71f288ccb9d3bbd77c0a124c4d5c.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=false
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

View File

@@ -0,0 +1,404 @@
[gd_scene load_steps=78 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escplayer.gd" type="Script" id=1]
[ext_resource path="res://game/characters/character2/character_anims.gd" type="Script" id=2]
[ext_resource path="res://game/characters/character2/8_way_walk.png" type="Texture" id=3]
[sub_resource type="AtlasTexture" id=1]
atlas = ExtResource( 3 )
region = Rect2( 0, 220, 60, 110 )
[sub_resource type="AtlasTexture" id=2]
atlas = ExtResource( 3 )
region = Rect2( 60, 220, 60, 110 )
[sub_resource type="AtlasTexture" id=3]
atlas = ExtResource( 3 )
region = Rect2( 120, 220, 60, 110 )
[sub_resource type="AtlasTexture" id=4]
atlas = ExtResource( 3 )
region = Rect2( 180, 220, 60, 110 )
[sub_resource type="AtlasTexture" id=5]
atlas = ExtResource( 3 )
region = Rect2( 240, 220, 60, 110 )
[sub_resource type="AtlasTexture" id=6]
atlas = ExtResource( 3 )
region = Rect2( 300, 220, 60, 110 )
[sub_resource type="AtlasTexture" id=7]
atlas = ExtResource( 3 )
region = Rect2( 360, 220, 60, 110 )
[sub_resource type="AtlasTexture" id=8]
atlas = ExtResource( 3 )
region = Rect2( 420, 220, 60, 110 )
[sub_resource type="AtlasTexture" id=9]
atlas = ExtResource( 3 )
region = Rect2( 360, 0, 60, 110 )
[sub_resource type="AtlasTexture" id=10]
atlas = ExtResource( 3 )
region = Rect2( 180, 0, 60, 110 )
[sub_resource type="AtlasTexture" id=11]
atlas = ExtResource( 3 )
region = Rect2( 0, 660, 60, 110 )
[sub_resource type="AtlasTexture" id=12]
atlas = ExtResource( 3 )
region = Rect2( 60, 660, 60, 110 )
[sub_resource type="AtlasTexture" id=13]
atlas = ExtResource( 3 )
region = Rect2( 120, 660, 60, 110 )
[sub_resource type="AtlasTexture" id=14]
atlas = ExtResource( 3 )
region = Rect2( 180, 660, 60, 110 )
[sub_resource type="AtlasTexture" id=15]
atlas = ExtResource( 3 )
region = Rect2( 240, 660, 60, 110 )
[sub_resource type="AtlasTexture" id=16]
atlas = ExtResource( 3 )
region = Rect2( 300, 660, 60, 110 )
[sub_resource type="AtlasTexture" id=17]
atlas = ExtResource( 3 )
region = Rect2( 360, 660, 60, 110 )
[sub_resource type="AtlasTexture" id=18]
atlas = ExtResource( 3 )
region = Rect2( 420, 660, 60, 110 )
[sub_resource type="AtlasTexture" id=19]
atlas = ExtResource( 3 )
region = Rect2( 60, 0, 60, 110 )
[sub_resource type="AtlasTexture" id=20]
atlas = ExtResource( 3 )
region = Rect2( 0, 110, 60, 110 )
[sub_resource type="AtlasTexture" id=21]
atlas = ExtResource( 3 )
region = Rect2( 60, 110, 60, 110 )
[sub_resource type="AtlasTexture" id=22]
atlas = ExtResource( 3 )
region = Rect2( 120, 110, 60, 110 )
[sub_resource type="AtlasTexture" id=23]
atlas = ExtResource( 3 )
region = Rect2( 180, 110, 60, 110 )
[sub_resource type="AtlasTexture" id=24]
atlas = ExtResource( 3 )
region = Rect2( 240, 110, 60, 110 )
[sub_resource type="AtlasTexture" id=25]
atlas = ExtResource( 3 )
region = Rect2( 300, 110, 60, 110 )
[sub_resource type="AtlasTexture" id=26]
atlas = ExtResource( 3 )
region = Rect2( 360, 110, 60, 110 )
[sub_resource type="AtlasTexture" id=27]
atlas = ExtResource( 3 )
region = Rect2( 420, 110, 60, 110 )
[sub_resource type="AtlasTexture" id=28]
atlas = ExtResource( 3 )
region = Rect2( 120, 0, 60, 110 )
[sub_resource type="AtlasTexture" id=29]
atlas = ExtResource( 3 )
region = Rect2( 0, 440, 60, 110 )
[sub_resource type="AtlasTexture" id=30]
atlas = ExtResource( 3 )
region = Rect2( 60, 440, 60, 110 )
[sub_resource type="AtlasTexture" id=31]
atlas = ExtResource( 3 )
region = Rect2( 120, 440, 60, 110 )
[sub_resource type="AtlasTexture" id=32]
atlas = ExtResource( 3 )
region = Rect2( 180, 440, 60, 110 )
[sub_resource type="AtlasTexture" id=33]
atlas = ExtResource( 3 )
region = Rect2( 240, 440, 60, 110 )
[sub_resource type="AtlasTexture" id=34]
atlas = ExtResource( 3 )
region = Rect2( 300, 440, 60, 110 )
[sub_resource type="AtlasTexture" id=35]
atlas = ExtResource( 3 )
region = Rect2( 360, 440, 60, 110 )
[sub_resource type="AtlasTexture" id=36]
atlas = ExtResource( 3 )
region = Rect2( 420, 440, 60, 110 )
[sub_resource type="AtlasTexture" id=37]
atlas = ExtResource( 3 )
region = Rect2( 420, 0, 60, 110 )
[sub_resource type="AtlasTexture" id=38]
atlas = ExtResource( 3 )
region = Rect2( 0, 880, 60, 110 )
[sub_resource type="AtlasTexture" id=39]
atlas = ExtResource( 3 )
region = Rect2( 60, 880, 60, 110 )
[sub_resource type="AtlasTexture" id=40]
atlas = ExtResource( 3 )
region = Rect2( 120, 880, 60, 110 )
[sub_resource type="AtlasTexture" id=41]
atlas = ExtResource( 3 )
region = Rect2( 180, 880, 60, 110 )
[sub_resource type="AtlasTexture" id=42]
atlas = ExtResource( 3 )
region = Rect2( 240, 880, 60, 110 )
[sub_resource type="AtlasTexture" id=43]
atlas = ExtResource( 3 )
region = Rect2( 300, 880, 60, 110 )
[sub_resource type="AtlasTexture" id=44]
atlas = ExtResource( 3 )
region = Rect2( 360, 880, 60, 110 )
[sub_resource type="AtlasTexture" id=45]
atlas = ExtResource( 3 )
region = Rect2( 420, 880, 60, 110 )
[sub_resource type="AtlasTexture" id=46]
atlas = ExtResource( 3 )
region = Rect2( 0, 550, 60, 110 )
[sub_resource type="AtlasTexture" id=47]
atlas = ExtResource( 3 )
region = Rect2( 60, 550, 60, 110 )
[sub_resource type="AtlasTexture" id=48]
atlas = ExtResource( 3 )
region = Rect2( 120, 550, 60, 110 )
[sub_resource type="AtlasTexture" id=49]
atlas = ExtResource( 3 )
region = Rect2( 180, 550, 60, 110 )
[sub_resource type="AtlasTexture" id=50]
atlas = ExtResource( 3 )
region = Rect2( 240, 550, 60, 110 )
[sub_resource type="AtlasTexture" id=51]
atlas = ExtResource( 3 )
region = Rect2( 300, 550, 60, 110 )
[sub_resource type="AtlasTexture" id=52]
atlas = ExtResource( 3 )
region = Rect2( 360, 550, 60, 110 )
[sub_resource type="AtlasTexture" id=53]
atlas = ExtResource( 3 )
region = Rect2( 420, 550, 60, 110 )
[sub_resource type="AtlasTexture" id=54]
atlas = ExtResource( 3 )
region = Rect2( 0, 0, 60, 110 )
[sub_resource type="AtlasTexture" id=55]
atlas = ExtResource( 3 )
region = Rect2( 0, 770, 60, 110 )
[sub_resource type="AtlasTexture" id=56]
atlas = ExtResource( 3 )
region = Rect2( 60, 770, 60, 110 )
[sub_resource type="AtlasTexture" id=57]
atlas = ExtResource( 3 )
region = Rect2( 120, 770, 60, 110 )
[sub_resource type="AtlasTexture" id=58]
atlas = ExtResource( 3 )
region = Rect2( 180, 770, 60, 110 )
[sub_resource type="AtlasTexture" id=59]
atlas = ExtResource( 3 )
region = Rect2( 240, 770, 60, 110 )
[sub_resource type="AtlasTexture" id=60]
atlas = ExtResource( 3 )
region = Rect2( 300, 770, 60, 110 )
[sub_resource type="AtlasTexture" id=61]
atlas = ExtResource( 3 )
region = Rect2( 360, 770, 60, 110 )
[sub_resource type="AtlasTexture" id=62]
atlas = ExtResource( 3 )
region = Rect2( 420, 770, 60, 110 )
[sub_resource type="AtlasTexture" id=63]
atlas = ExtResource( 3 )
region = Rect2( 240, 0, 60, 110 )
[sub_resource type="AtlasTexture" id=64]
atlas = ExtResource( 3 )
region = Rect2( 300, 0, 60, 110 )
[sub_resource type="AtlasTexture" id=65]
atlas = ExtResource( 3 )
region = Rect2( 0, 330, 60, 110 )
[sub_resource type="AtlasTexture" id=66]
atlas = ExtResource( 3 )
region = Rect2( 60, 330, 60, 110 )
[sub_resource type="AtlasTexture" id=67]
atlas = ExtResource( 3 )
region = Rect2( 120, 330, 60, 110 )
[sub_resource type="AtlasTexture" id=68]
atlas = ExtResource( 3 )
region = Rect2( 180, 330, 60, 110 )
[sub_resource type="AtlasTexture" id=69]
atlas = ExtResource( 3 )
region = Rect2( 240, 330, 60, 110 )
[sub_resource type="AtlasTexture" id=70]
atlas = ExtResource( 3 )
region = Rect2( 300, 330, 60, 110 )
[sub_resource type="AtlasTexture" id=71]
atlas = ExtResource( 3 )
region = Rect2( 360, 330, 60, 110 )
[sub_resource type="AtlasTexture" id=72]
atlas = ExtResource( 3 )
region = Rect2( 420, 330, 60, 110 )
[sub_resource type="SpriteFrames" id=73]
animations = [ {
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ) ],
"loop": true,
"name": "walk_down",
"speed": 5.0
}, {
"frames": [ SubResource( 9 ) ],
"loop": true,
"name": "idle_right",
"speed": 5.0
}, {
"frames": [ SubResource( 10 ) ],
"loop": true,
"name": "idle_up_left",
"speed": 5.0
}, {
"frames": [ SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ) ],
"loop": true,
"name": "walk_up_left",
"speed": 5.0
}, {
"frames": [ SubResource( 19 ) ],
"loop": true,
"name": "idle_down_left",
"speed": 5.0
}, {
"frames": [ SubResource( 20 ), SubResource( 21 ), SubResource( 22 ), SubResource( 23 ), SubResource( 24 ), SubResource( 25 ), SubResource( 26 ), SubResource( 27 ) ],
"loop": true,
"name": "walk_down_left",
"speed": 5.0
}, {
"frames": [ SubResource( 28 ) ],
"loop": true,
"name": "idle_left",
"speed": 5.0
}, {
"frames": [ SubResource( 29 ), SubResource( 30 ), SubResource( 31 ), SubResource( 32 ), SubResource( 33 ), SubResource( 34 ), SubResource( 35 ), SubResource( 36 ) ],
"loop": true,
"name": "walk_left",
"speed": 8.0
}, {
"frames": [ SubResource( 37 ) ],
"loop": true,
"name": "idle_down_right",
"speed": 5.0
}, {
"frames": [ SubResource( 38 ), SubResource( 39 ), SubResource( 40 ), SubResource( 41 ), SubResource( 42 ), SubResource( 43 ), SubResource( 44 ), SubResource( 45 ) ],
"loop": true,
"name": "walk_up_right",
"speed": 5.0
}, {
"frames": [ SubResource( 46 ), SubResource( 47 ), SubResource( 48 ), SubResource( 49 ), SubResource( 50 ), SubResource( 51 ), SubResource( 52 ), SubResource( 53 ) ],
"loop": true,
"name": "walk_right",
"speed": 5.0
}, {
"frames": [ SubResource( 54 ) ],
"loop": true,
"name": "idle_down",
"speed": 5.0
}, {
"frames": [ SubResource( 55 ), SubResource( 56 ), SubResource( 57 ), SubResource( 58 ), SubResource( 59 ), SubResource( 60 ), SubResource( 61 ), SubResource( 62 ) ],
"loop": true,
"name": "walk_up",
"speed": 5.0
}, {
"frames": [ SubResource( 63 ) ],
"loop": true,
"name": "idle_up",
"speed": 5.0
}, {
"frames": [ SubResource( 64 ) ],
"loop": true,
"name": "idle_up_right",
"speed": 5.0
}, {
"frames": [ SubResource( 65 ), SubResource( 66 ), SubResource( 67 ), SubResource( 68 ), SubResource( 69 ), SubResource( 70 ), SubResource( 71 ), SubResource( 72 ) ],
"loop": true,
"name": "walk_down_right",
"speed": 5.0
} ]
[sub_resource type="CapsuleShape2D" id=74]
height = 0.0
[node name="character" type="KinematicBody2D"]
script = ExtResource( 1 )
global_id = "player"
animations = ExtResource( 2 )
dialog_color = Color( 1, 1, 1, 1 )
[node name="sprite" type="AnimatedSprite" parent="."]
position = Vector2( 0, -78.4786 )
scale = Vector2( 2, 2 )
frames = SubResource( 73 )
animation = "idle_down_right"
[node name="collision" type="CollisionShape2D" parent="."]
shape = SubResource( 74 )
[node name="debug" type="Label" parent="."]
margin_right = 40.0
margin_bottom = 14.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="dialog_position" type="Position2D" parent="."]
position = Vector2( 0, -195.195 )

View File

@@ -0,0 +1,90 @@
#const dir_angles = [
# 0, # 0 NORTH FACE CAMERA
# 45, # 1 NORTHEAST
# 90, # 2 EAST
# 135, # 3 SOUTHEAST
# 180, # 4 SOUTH BACK TO CAMERA
# 225, # 5 SOUTHWEST
# 270, # 6 WEST
# 315, # 7 NORTHWEST
#]
# Angle is [from_angle, area_angle]
# example : on a clock, [180, 45] starts exactly from 6 o'clock (180°)
# and stops between 7 o'clock and 8 o'clock (45° from 6 o'clock)
const dir_angles = [
[340, 40], # 0 UP
[20, 50], # 1 RIGHT UP
[70, 40], # 2 RIGHT
[110, 50], # 3 RIGHT DOWN
[160, 40], # 4 DOWN
[200, 50], # 5 LEFT DOWN
[250, 40], # 6 LEFT
[290, 50] # 7 LEFT UP
]
# Array of animations for each direction, from UP to RIGHT_UP clockwise
# [animation_name, scale] : scale parameter can be set to -1 to mirror the animation
const directions = [
["walk_up", 1], # 0 UP
["walk_up_right", 1], # 1 RIGHT UP
["walk_right", 1], # 2 RIGHT
["walk_down_right", 1], # 3 RIGHT DOWN
["walk_down", 1], # 4 DOWN
["walk_down_left", 1], # 5 LEFT DOWN
["walk_left", 1], # 6 LEFT
["walk_up_left", 1] # 7 LEFT UP
]
const idles = [
["idle_up", 1], # 0 UP
["idle_up_right", 1], # 1 RIGHT UP
["idle_right", 1], # 2 RIGHT
["idle_down_right", 1], # 3 RIGHT DOWN
["idle_down", 1], # 4 DOWN
["idle_down_left", 1], # 5 LEFT DOWN
["idle_left", 1], # 6 LEFT
["idle_up_left", 1] # 7 LEFT UP
]
const speaks = [
["idle_up", 1], # 0 UP
["idle_up_right", 1], # 1 RIGHT UP
["idle_right", 1], # 2 RIGHT
["idle_down_right", 1], # 3 RIGHT DOWN
["idle_down", 1], # 4 DOWN
["idle_down_left", 1], # 5 LEFT DOWN
["idle_left", 1], # 6 LEFT
["idle_up_left", 1] # 7 LEFT UP
]
#const directions = ["walk_left", -1, # 0
# "walk_left", -1, # 1
# "walk_back", 1, # 2
# "walk_back", 1, # 3
# "walk_left", 1, # 4
# "walk_left", 1, # 5
# "walk_front", 1, # 6
# "walk_front", 1 # 7
# ]
#
#const idles = [ "idle_front_right", 1, # 0
# "idle_front_right", 1, # 1
# "idle_back", 1, # 2
# "idle_back", 1, # 3
# "idle_front_left", 1, # 4
# "idle_front_left", 1, # 5
# "idle_front", 1, # 6
# "idle_front", 1 # 7
# ]
#
#const speaks = ["idle_front_left", 1, # 0
# "idle_front_left", 1, # 1
# "idle_back", 1, # 2
# "idle_back", 1, # 3
# "idle_front_right", 1, # 4
# "idle_front_right", 1, # 5
# "idle_front", 1, # 6
# "idle_front", 1 # 7
# ]

View File

@@ -96,16 +96,26 @@ shader_param/col = Color( 0.611765, 0.215686, 0.0431373, 1 )
[sub_resource type="SpriteFrames" id=4]
animations = [ {
"frames": [ ExtResource( 8 ) ],
"loop": true,
"name": "idle_back",
"speed": 5.0
}, {
"frames": [ ExtResource( 10 ), ExtResource( 11 ), ExtResource( 12 ), ExtResource( 13 ), ExtResource( 14 ), ExtResource( 15 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 18 ), ExtResource( 19 ), ExtResource( 20 ) ],
"loop": true,
"name": "walk_front",
"speed": 8.0
}, {
"frames": [ ExtResource( 6 ) ],
"loop": true,
"name": "idle_front_right",
"speed": 5.0
}, {
"frames": [ ExtResource( 9 ) ],
"loop": true,
"name": "idle_back_right",
"speed": 5.0
}, {
"frames": [ ExtResource( 45 ), ExtResource( 46 ), ExtResource( 47 ), ExtResource( 48 ), ExtResource( 49 ), ExtResource( 50 ), ExtResource( 51 ), ExtResource( 52 ), ExtResource( 53 ), ExtResource( 54 ), ExtResource( 55 ), ExtResource( 56 ) ],
"loop": true,
"name": "walk_back",
"speed": 8.0
}, {
"frames": [ ExtResource( 57 ), ExtResource( 58 ), ExtResource( 59 ), ExtResource( 60 ), ExtResource( 61 ), ExtResource( 62 ), ExtResource( 63 ), ExtResource( 64 ), ExtResource( 65 ), ExtResource( 66 ), ExtResource( 67 ), ExtResource( 68 ) ],
"loop": true,
"name": "walk_back_left",
@@ -116,40 +126,30 @@ animations = [ {
"name": "idle_front_left",
"speed": 5.0
}, {
"frames": [ ExtResource( 8 ) ],
"frames": [ ExtResource( 33 ), ExtResource( 34 ), ExtResource( 35 ), ExtResource( 36 ), ExtResource( 37 ), ExtResource( 38 ), ExtResource( 39 ), ExtResource( 40 ), ExtResource( 41 ), ExtResource( 42 ), ExtResource( 43 ), ExtResource( 44 ) ],
"loop": true,
"name": "idle_back",
"speed": 5.0
"name": "walk_left",
"speed": 8.0
}, {
"frames": [ ExtResource( 45 ), ExtResource( 46 ), ExtResource( 47 ), ExtResource( 48 ), ExtResource( 49 ), ExtResource( 50 ), ExtResource( 51 ), ExtResource( 52 ), ExtResource( 53 ), ExtResource( 54 ), ExtResource( 55 ), ExtResource( 56 ) ],
"loop": true,
"name": "walk_back",
"speed": 8.0
}, {
"frames": [ ExtResource( 7 ) ],
"loop": true,
"name": "idle_back_left",
"speed": 5.0
}, {
"frames": [ ExtResource( 5 ) ],
"loop": true,
"name": "idle_front",
"speed": 5.0
}, {
"frames": [ ExtResource( 10 ), ExtResource( 11 ), ExtResource( 12 ), ExtResource( 13 ), ExtResource( 14 ), ExtResource( 15 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 18 ), ExtResource( 19 ), ExtResource( 20 ) ],
"loop": true,
"name": "walk_front",
"speed": 8.0
}, {
"frames": [ ExtResource( 21 ), ExtResource( 22 ), ExtResource( 23 ), ExtResource( 24 ), ExtResource( 25 ), ExtResource( 26 ), ExtResource( 27 ), ExtResource( 28 ), ExtResource( 29 ), ExtResource( 30 ), ExtResource( 31 ), ExtResource( 32 ) ],
"loop": true,
"name": "walk_front_left",
"speed": 8.0
}, {
"frames": [ ExtResource( 6 ) ],
"frames": [ ExtResource( 5 ) ],
"loop": true,
"name": "idle_front_right",
"name": "idle_front",
"speed": 5.0
}, {
"frames": [ ExtResource( 33 ), ExtResource( 34 ), ExtResource( 35 ), ExtResource( 36 ), ExtResource( 37 ), ExtResource( 38 ), ExtResource( 39 ), ExtResource( 40 ), ExtResource( 41 ), ExtResource( 42 ), ExtResource( 43 ), ExtResource( 44 ) ],
"loop": true,
"name": "walk_left",
"speed": 8.0
} ]
[sub_resource type="Animation" id=5]

View File

@@ -6,7 +6,7 @@
[ext_resource path="res://game/items/escitems/filled_sheet_escitem.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/escoria-core/game/core-scripts/items_inventory.gd" type="Script" id=5]
[node name="all_items" type="Node2D"]
[node name="ESCORIA_ALL_ITEMS" type="Node2D"]
visible = false
script = ExtResource( 5 )

View File

@@ -8,6 +8,9 @@ set_active r5_pen false
:use r5_empty_sheet
say player "So, let's see..."
set_global i/r5_pen false
set_global i/r5_empty_sheet false
set_global i/r5_filled_sheet true
#set_global i/r5_pen false
inventory_remove r5_pen
#set_global i/r5_empty_sheet false
inventory_remove r5_empty_sheet
#set_global i/r5_filled_sheet true
inventory_add r5_filled_sheet

View File

@@ -3,7 +3,7 @@
[ext_resource path="res://game/rooms/room1/walkable_area.tscn" type="PackedScene" id=1]
[ext_resource path="res://game/rooms/room1/background.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/eschotspot.gd" type="Script" id=3]
[ext_resource path="res://game/characters/guybrush/guybrush.tscn" type="PackedScene" id=4]
[ext_resource path="res://game/characters/character2/character.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escroom.gd" type="Script" id=6]
[node name="room1" type="Node2D"]
@@ -26,15 +26,6 @@ text = "Move : left click
Fast move : double left click"
[node name="walkable_area" parent="." instance=ExtResource( 1 )]
scales = null
bitmaps_scale = Vector2( 1, 1 )
lightmap = null
player_speed_multiplier = 1.0
player_doubleclick_speed_multiplier = 1.5
lightmap_modulate = Color( 1, 1, 1, 1 )
debug_mode = 1
scale_min = 0.3
scale_max = 1.0
[node name="Hotspots" type="Node2D" parent="."]
@@ -45,6 +36,9 @@ is_exit = true
esc_script = "res://game/rooms/room1/esc/right_exit.esc"
tooltip_name = "Exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 1225.47, 353.99 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/r_door"]
polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953, 1277.95, 399.407 )
@@ -58,6 +52,9 @@ global_id = "r1_item"
esc_script = "res://game/rooms/room1/esc/wall_item.esc"
tooltip_name = "Item on the wall"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 671.798, 373.035 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/item"]
polygon = PoolVector2Array( 635.586, 253.345, 568.928, 60.1716, 709.047, 120.028, 699.524, 247.903 )

View File

@@ -3,7 +3,7 @@
[ext_resource path="res://game/rooms/room2/walkable_area.tscn" type="PackedScene" id=1]
[ext_resource path="res://game/rooms/room2/background.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/eschotspot.gd" type="Script" id=3]
[ext_resource path="res://game/characters/guybrush/guybrush.tscn" type="PackedScene" id=4]
[ext_resource path="res://game/characters/character2/character.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escroom.gd" type="Script" id=6]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=7]
@@ -17,15 +17,6 @@ esc_script = "res://game/rooms/room2/esc/room2_bridge.esc"
player_scene = ExtResource( 4 )
[node name="walkable_area" parent="." instance=ExtResource( 1 )]
scales = null
bitmaps_scale = Vector2( 1, 1 )
lightmap = null
player_speed_multiplier = 1.0
player_doubleclick_speed_multiplier = 1.5
lightmap_modulate = Color( 1, 1, 1, 1 )
debug_mode = 1
scale_min = 0.3
scale_max = 1.0
[node name="background" parent="." instance=ExtResource( 2 )]
@@ -38,6 +29,9 @@ esc_script = "res://game/rooms/room2/esc/right_platform.esc"
interaction_direction = 3
tooltip_name = "Right platform"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 430.893, 451.052 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/r_platform"]
polygon = PoolVector2Array( 870.974, 538.342, 827.536, 353.995, 1181.4, 357.174, 1287.34, 413.325, 1289.46, 545.758 )
@@ -52,6 +46,9 @@ is_exit = true
esc_script = "res://game/rooms/room2/esc/right_exit.esc"
tooltip_name = "Exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 1225.47, 353.99 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/r_door"]
polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953, 1277.95, 399.407 )
@@ -66,6 +63,9 @@ is_exit = true
esc_script = "res://game/rooms/room2/esc/left_exit.esc"
tooltip_name = "Exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 52.1462, 384.691 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/l_door"]
polygon = PoolVector2Array( -1.37926, 443.158, 7.96461, 122.796, 84.0504, 77.4118, 88.055, 377.751 )

View File

@@ -3,7 +3,7 @@
[ext_resource path="res://game/rooms/room3/walkable_area.tscn" type="PackedScene" id=1]
[ext_resource path="res://game/rooms/room3/background.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/eschotspot.gd" type="Script" id=3]
[ext_resource path="res://game/characters/guybrush/guybrush.tscn" type="PackedScene" id=4]
[ext_resource path="res://game/characters/character2/character.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escroom.gd" type="Script" id=6]
[node name="room3" type="Node2D"]
@@ -15,15 +15,6 @@ player_scene = ExtResource( 4 )
[node name="background" parent="." instance=ExtResource( 2 )]
[node name="walkable_area" parent="." instance=ExtResource( 1 )]
scales = null
bitmaps_scale = Vector2( 1, 1 )
lightmap = null
player_speed_multiplier = 1.0
player_doubleclick_speed_multiplier = 1.5
lightmap_modulate = Color( 1, 1, 1, 1 )
debug_mode = 1
scale_min = 0.3
scale_max = 1.0
[node name="Hotspots" type="Node2D" parent="."]
@@ -36,6 +27,9 @@ global_id = "r3_right_platform"
esc_script = "res://game/rooms/room3/esc/right_platform.esc"
tooltip_name = "Right platform"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 430.893, 451.052 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/r_platform"]
polygon = PoolVector2Array( 870.974, 538.342, 827.536, 353.995, 1181.4, 357.174, 1287.34, 413.325, 1289.46, 545.758 )
@@ -56,6 +50,9 @@ is_exit = true
esc_script = "res://game/rooms/room3/esc/right_exit.esc"
tooltip_name = "Exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 1225.47, 353.99 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/r_door"]
polygon = PoolVector2Array( 1177.94, 348.61, 1175.95, 45.3759, 1276.06, 92.0953, 1277.95, 399.407 )
@@ -70,6 +67,9 @@ is_exit = true
esc_script = "res://game/rooms/room3/esc/left_exit.esc"
tooltip_name = "Exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 44.1375, 384.691 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/l_door"]
polygon = PoolVector2Array( -2.71457, 437.818, 6.6293, 121.462, 89.3893, 74.7422, 88.0545, 376.416 )

View File

@@ -9,9 +9,9 @@
[ext_resource path="res://game/rooms/room4/assets/depth_reduced.png" type="Texture" id=8]
[sub_resource type="NavigationPolygon" id=1]
vertices = PoolVector2Array( 1564.36, 574.459, 1576.02, 540.556, 1634.29, 568.102, 1624.42, 800.399, 1536.87, 579.274, 1012.68, 786.929, 1197.79, 675.666, 908.294, 488.354, 996.968, 451.313, 600.739, 456.925, 673.699, 490.599, 371.757, 688.152, 542.371, 788.052, 2.46706, 794.786, 11.4468, 698.255, 189.918, 682.54, 127.06, 573.661, 23.7938, 614.07, 42.8757, 527.64, 125.938, 536.62 )
polygons = [ PoolIntArray( 0, 1, 2, 3 ), PoolIntArray( 4, 0, 3, 5, 6 ), PoolIntArray( 6, 5, 7, 8 ), PoolIntArray( 9, 8, 7, 10 ), PoolIntArray( 11, 12, 13, 14, 15 ), PoolIntArray( 9, 10, 12, 11 ), PoolIntArray( 16, 15, 14, 17, 18 ), PoolIntArray( 16, 18, 19 ) ]
outlines = [ PoolVector2Array( 11.4468, 698.255, 23.7938, 614.07, 42.8757, 527.64, 125.938, 536.62, 127.06, 573.661, 189.918, 682.54, 371.757, 688.152, 600.739, 456.925, 996.968, 451.313, 1197.79, 675.666, 1536.87, 579.274, 1564.36, 574.459, 1576.02, 540.556, 1634.29, 568.102, 1624.42, 800.399, 1012.68, 786.929, 908.294, 488.354, 673.699, 490.599, 542.371, 788.052, 2.46706, 794.786 ) ]
vertices = PoolVector2Array( 371.757, 688.152, 542.371, 788.052, 2.46706, 794.786, 11.4468, 698.255, 189.918, 682.54, 1564.36, 574.459, 1578.66, 529.011, 1635.23, 551.638, 1624.42, 800.399, 1536.87, 579.274, 1012.68, 786.929, 1197.79, 675.666, 908.294, 488.354, 996.968, 451.313, 600.739, 456.925, 673.699, 490.599, 127.06, 573.661, 23.7938, 614.07, 42.8757, 527.64, 125.717, 528.797 )
polygons = [ PoolIntArray( 0, 1, 2, 3, 4 ), PoolIntArray( 5, 6, 7, 8 ), PoolIntArray( 9, 5, 8, 10, 11 ), PoolIntArray( 11, 10, 12, 13 ), PoolIntArray( 14, 13, 12, 15 ), PoolIntArray( 14, 15, 1, 0 ), PoolIntArray( 16, 4, 3, 17, 18 ), PoolIntArray( 16, 18, 19 ) ]
outlines = [ PoolVector2Array( 11.4468, 698.255, 23.7938, 614.07, 42.8757, 527.64, 125.717, 528.797, 127.06, 573.661, 189.918, 682.54, 371.757, 688.152, 600.739, 456.925, 996.968, 451.313, 1197.79, 675.666, 1536.87, 579.274, 1564.36, 574.459, 1578.66, 529.011, 1635.23, 551.638, 1624.42, 800.399, 1012.68, 786.929, 908.294, 488.354, 673.699, 490.599, 542.371, 788.052, 2.46706, 794.786 ) ]
[node name="room4" type="Node2D"]
script = ExtResource( 6 )
@@ -20,15 +20,13 @@ esc_script = "res://game/rooms/room4/esc/room4.esc"
player_scene = ExtResource( 4 )
[node name="background" type="TextureRect" parent="."]
margin_left = 0.943848
margin_right = 2398.94
margin_right = 1663.0
margin_bottom = 549.0
mouse_filter = 2
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
esc_script = ""
[node name="Sprite" type="Sprite" parent="background"]
scale = Vector2( 0.692794, 0.692794 )
@@ -52,14 +50,9 @@ points = PoolVector2Array( 6.10242, 307.886, 2.0979, 129.017, 84.858, 129.017, 8
[node name="walkable_area" type="Navigation2D" parent="."]
script = ExtResource( 1 )
scales = ExtResource( 8 )
bitmaps_scale = Vector2( 1, 1 )
lightmap = null
player_speed_multiplier = 1.0
player_doubleclick_speed_multiplier = 1.8
lightmap_modulate = Color( 1, 1, 1, 1 )
debug_mode = 0
scale_min = 0.4
scale_max = 1.0
[node name="platform" type="NavigationPolygonInstance" parent="walkable_area"]
visible = false
@@ -73,24 +66,6 @@ __meta__ = {
position = Vector2( 697.275, 203.998 )
[node name="Hotspots" type="Node2D" parent="."]
position = Vector2( 0.943848, 0 )
[node name="r_door" type="Area2D" parent="Hotspots"]
script = ExtResource( 3 )
global_id = "r_exit"
is_exit = true
esc_script = "res://game/rooms/room4/esc/right_exit.esc"
tooltip_name = "Exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 84.5736, 279.703 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/r_door"]
polygon = PoolVector2Array( 1567.92, 294.848, 1573.21, 92.4902, 1651.61, 127.452, 1654.79, 343.583 )
[node name="Position2D" type="Position2D" parent="Hotspots/r_door"]
position = Vector2( 1611.46, 301.017 )
[node name="l_door" type="Area2D" parent="Hotspots"]
script = ExtResource( 3 )
@@ -104,7 +79,24 @@ interact_positions = {
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/l_door"]
polygon = PoolVector2Array( 26.3979, 288.491, 27.4573, 70.2414, 147.177, 74.4792, 151.415, 293.788 )
polygon = PoolVector2Array( 29.1046, 292.156, 31.0151, 76.8949, 147.177, 74.4792, 151.415, 293.788 )
[node name="Position2D" type="Position2D" parent="Hotspots/l_door"]
position = Vector2( 83.6298, 279.703 )
[node name="r_door" type="Area2D" parent="Hotspots"]
script = ExtResource( 3 )
global_id = "r_exit"
is_exit = true
esc_script = "res://game/rooms/room4/esc/right_exit.esc"
tooltip_name = "Exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 1612.4, 301.017 )
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/r_door"]
polygon = PoolVector2Array( 1567.92, 294.848, 1573.21, 92.4902, 1657.34, 129.485, 1654.79, 343.583 )
[node name="Position2D" type="Position2D" parent="Hotspots/r_door"]
position = Vector2( 1611.46, 301.017 )

View File

@@ -3,7 +3,7 @@
[ext_resource path="res://addons/escoria-core/game/core-scripts/escterrain.gd" type="Script" id=1]
[ext_resource path="res://game/rooms/room5/background.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/eschotspot.gd" type="Script" id=3]
[ext_resource path="res://game/characters/guybrush/guybrush.tscn" type="PackedScene" id=4]
[ext_resource path="res://game/characters/character2/character.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escroom.gd" type="Script" id=6]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=7]
[ext_resource path="res://game/items/escitems/wrench_escitem.tscn" type="PackedScene" id=8]

View File

@@ -7,32 +7,32 @@ say player "I don't think he'd like that."
:talk
> [!talked_once]
say player "Uhm..."
say character "Yeah?"
say android "Yeah?"
set_global talked_once true
? option1 1000 option2 true
- "What are you doing here?"
say player "What are you doing here?"
say character "I'm working! Can't you see that?"
say character "My colleague is supposed to bring me an important report. And he's not coming!"
say android "I'm working! Can't you see that?"
say android "My colleague is supposed to bring me an important report. And he's not coming!"
?
- "I'll bring you this report!"
say player "I'll bring you this report!"
say character "You will? Great!"
say character "Now please hurry up so I can leave and have lunch."
say android "You will? Great!"
say android "Now please hurry up so I can leave and have lunch."
stop
- "I've got better things to do."
say player "I've got better things to do."
say character "Eh! I'm not asking you anythin'!"
say android "Eh! I'm not asking you anythin'!"
stop
- "I'm selling these fine leather jackets."
say player "I'm selling these fine leather jackets."
say character "Go away, kid."
say android "Go away, kid."
stop
:give filled_sheet
say character "Hey! That's perfect!"
say character "I can finally got away from here!"
walk character 1200,400
set_angle character 45
say android "Hey! That's perfect!"
say android "I can finally got away from here!"
walk android 1200,400
set_angle android 45

View File

@@ -6,7 +6,7 @@
[ext_resource path="res://game/characters/guybrush/guybrush.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=5]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escroom.gd" type="Script" id=6]
[ext_resource path="res://game/characters/character/character.tscn" type="PackedScene" id=7]
[ext_resource path="res://game/characters/character/android.tscn" type="PackedScene" id=7]
[sub_resource type="NavigationPolygon" id=1]
vertices = PoolVector2Array( 1168.92, 640.557, 1182.53, 588.863, 1269.59, 622.872, 1275.03, 799.721, 129.634, 615.792, 1143.08, 613.35, -9.16094, 803.802, 84.5821, 654.06, -6.44019, 711.297, 3.15687, 646.051, 59.2201, 628.698 )
@@ -170,15 +170,15 @@ position = Vector2( 1180.52, 395.193 )
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/r_door/Area2D"]
polygon = PoolVector2Array( 1169.35, 41.7644, 1168.09, 347.925, 1275.18, 407.141, 1278.96, 88.3814 )
[node name="character" parent="Hotspots" instance=ExtResource( 7 )]
[node name="android" parent="Hotspots" instance=ExtResource( 7 )]
position = Vector2( 373.401, 415.66 )
scale = Vector2( -1, 1 )
esc_script = "res://game/rooms/room6/esc/character.esc"
esc_script = "res://game/rooms/room6/esc/android.esc"
interact_positions = {
"default": Vector2( 595.637, 438.337 )
"default": Vector2( 151.165, 438.337 )
}
[node name="Position2D" type="Position2D" parent="Hotspots/character"]
[node name="Position2D" type="Position2D" parent="Hotspots/android"]
position = Vector2( 222.236, 22.6772 )
[node name="player_start" type="Position2D" parent="."]

View File

@@ -1,6 +1,6 @@
:setup
> [eq ESC_LAST_SCENE room5]
teleport player r6_l_exit
> [eq ESC_LAST_SCENE room6]
teleport player r7_l_exit
# Set player look right
set_angle player 180
stop
@@ -9,8 +9,15 @@
stop
:ready
#set_global i/r5_pen true
#set_active r5_pen false
#set_global i/r5_empty_sheet true
#set_active r5_empty_sheet false
camera_push r7_object2 1 LINEAR
wait 3
camera_push player 1 LINEAR
#camera_set_drag_margin_enabled bool bool
#camera_set_pos real int int
#camera_set_target real
#camera_set_zoom real
#camera_set_zoom_height int
#camera_shift int int

View File

@@ -1,10 +1,9 @@
[gd_scene load_steps=10 format=2]
[gd_scene load_steps=7 format=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escterrain.gd" type="Script" id=1]
[ext_resource path="res://game/rooms/room7/background.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/escoria-core/game/core-scripts/eschotspot.gd" type="Script" id=3]
[ext_resource path="res://game/characters/guybrush/guybrush.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escitem.gd" type="Script" id=5]
[ext_resource path="res://addons/escoria-core/game/core-scripts/escroom.gd" type="Script" id=6]
[sub_resource type="NavigationPolygon" id=1]
@@ -12,85 +11,6 @@ vertices = PoolVector2Array( 1976.63, 640.557, 1987.95, 588.863, 2070.07, 622.87
polygons = [ PoolIntArray( 0, 1, 2, 3 ), PoolIntArray( 4, 5, 0, 3, 6, 7 ), PoolIntArray( 7, 6, 8, 9, 10 ) ]
outlines = [ PoolVector2Array( -6.44019, 711.297, 3.15687, 646.051, 59.2201, 628.698, 84.5821, 654.06, 129.634, 615.792, 1956.81, 616.096, 1976.63, 640.557, 1987.95, 588.863, 2070.07, 622.872, 2066.3, 799.721, -9.16094, 803.802 ) ]
[sub_resource type="Animation" id=2]
resource_name = "r_door_close"
tracks/0/type = "value"
tracks/0/path = NodePath("r_door_closed:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("r_door_opened:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Position2D:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 1180.52, 395.193 ) ]
}
[sub_resource type="Animation" id=3]
resource_name = "r_door_open"
length = 0.3
tracks/0/type = "value"
tracks/0/path = NodePath("r_door_closed:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("r_door_opened:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Position2D:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 1225.47, 353.99 ) ]
}
[node name="room7" type="Node2D"]
script = ExtResource( 6 )
__meta__ = {
@@ -101,18 +21,13 @@ esc_script = "res://game/rooms/room7/esc/room7.esc"
player_scene = ExtResource( 4 )
[node name="background" parent="." instance=ExtResource( 2 )]
margin_right = 2088.0
[node name="Line2D" type="Line2D" parent="background"]
points = PoolVector2Array( 398.738, 142.591, 518.947, 64.809, 516.118, 275.527 )
[node name="walkable_area" type="Navigation2D" parent="."]
script = ExtResource( 1 )
scales = null
bitmaps_scale = Vector2( 1, 1 )
lightmap = null
player_speed_multiplier = 1.0
player_doubleclick_speed_multiplier = 1.5
lightmap_modulate = Color( 1, 1, 1, 1 )
debug_mode = 1
scale_min = 0.3
scale_max = 1.0
[node name="platform" type="NavigationPolygonInstance" parent="walkable_area"]
position = Vector2( 7.73163, -264.779 )
@@ -125,7 +40,7 @@ __meta__ = {
[node name="l_exit" type="Area2D" parent="Hotspots"]
script = ExtResource( 3 )
global_id = "r6_l_exit"
global_id = "r7_l_exit"
is_exit = true
esc_script = "res://game/rooms/room7/esc/left_exit.esc"
tooltip_name = "Exit"
@@ -142,7 +57,7 @@ position = Vector2( 37.4521, 392.045 )
[node name="r_exit" type="Area2D" parent="Hotspots"]
script = ExtResource( 3 )
global_id = "r6_r_exit"
global_id = "r7_r_exit"
is_exit = true
esc_script = "res://game/rooms/room7/esc/right_exit.esc"
is_interactive = false
@@ -150,13 +65,13 @@ interaction_direction = 1
tooltip_name = "Exit"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": Vector2( 1232.52, 347.193 ),
"default": Vector2( 2038.8, 347.193 ),
"r6_r_exit_closed": NodePath("r_door_closed/Position2D"),
"r6_r_exit_opened": NodePath("r_door_opened/Position2D")
}
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/r_exit"]
polygon = PoolVector2Array( 1989, 343, 1986, 278.129, 2076, 316.129, 2075, 394 )
polygon = PoolVector2Array( 1982.34, 349.116, 1980.1, 46.0513, 2081.12, 86.4599, 2075, 394 )
[node name="Position2D" type="Position2D" parent="Hotspots/r_exit"]
position = Vector2( 2038.8, 347.193 )
@@ -164,31 +79,20 @@ __meta__ = {
"_editor_description_": ""
}
[node name="r_door" type="Sprite" parent="Hotspots"]
visible = false
script = ExtResource( 5 )
[node name="object2" type="Area2D" parent="Hotspots"]
position = Vector2( 1600.63, 13.4695 )
script = ExtResource( 3 )
global_id = "r7_object2"
dialog_color = Color( 1, 1, 1, 1 )
interact_positions = {
"default": null
}
[node name="r_door_closed" type="Polygon2D" parent="Hotspots/r_door"]
color = Color( 0.482353, 0.568627, 1, 1 )
polygon = PoolVector2Array( 1172.3, 44.8186, 1172.3, 348.012, 1273.9, 401.983, 1277.07, 89.2657 )
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/object2"]
polygon = PoolVector2Array( -112.101, 14.6226, -103.122, 288.503, 130.35, 286.258, 125.861, 16.8675 )
[node name="Line2D" type="Line2D" parent="Hotspots/r_door/r_door_closed"]
points = PoolVector2Array( 1265.23, 266.8, 1253.65, 276.6, 1252.76, 230.273, 1264.34, 233.837 )
default_color = Color( 1, 1, 1, 1 )
[node name="r_door_opened" type="Polygon2D" parent="Hotspots/r_door"]
visible = false
color = Color( 0.482353, 0.568627, 1, 1 )
polygon = PoolVector2Array( 1172.3, 44.8186, 1172.3, 348.012, 1029.82, 349.887, 1025.19, 42.1269 )
[node name="Line2D" type="Line2D" parent="Hotspots/r_door/r_door_opened"]
points = PoolVector2Array( 1048.98, 230.477, 1048.98, 189.89 )
default_color = Color( 1, 1, 1, 1 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="Hotspots/r_door"]
anims/r_door_close = SubResource( 2 )
anims/r_door_open = SubResource( 3 )
[node name="Line2D" type="Line2D" parent="Hotspots/object2"]
points = PoolVector2Array( -74.0056, 70.7457, 2.32182, 28.0921, 89.8739, 77.4804, -82.9853, 268.299, 110.078, 261.564 )
[node name="player_start" type="Position2D" parent="."]
position = Vector2( 76.7617, 437.649 )

View File

@@ -13,8 +13,11 @@
#change_scene res://game/rooms/room4/room4.tscn
# items rooms
change_scene res://game/rooms/room5/room5.tscn
#change_scene res://game/rooms/room5/room5.tscn
# character room
#change_scene res://game/rooms/room6/room6.tscn
# long room with camera shift to object 2 if look on object 1
change_scene res://game/rooms/room7/room7.tscn

114
game/ui/ui_9verbs/game.gd Normal file
View File

@@ -0,0 +1,114 @@
extends Node
"""
Implement methods to react to inputs.
- left_click_on_bg(position : Vector2)
- right_click_on_bg(position : Vector2)
- left_double_click_on_bg(position : Vector2)
- element_focused(element_id : String)
- element_unfocused()
- left_click_on_hotspot(hotspot_global_id : String, event : InputEvent)
- right_click_on_hotspot(hotspot_global_id : String, event : InputEvent)
- left_double_click_on_hotspot(hotspot_global_id : String, event : InputEvent)
- left_click_on_item(item_global_id : String, event : InputEvent)
- right_click_on_item(item_global_id : String, event : InputEvent)
- left_double_click_on_item(item_global_id : String, event : InputEvent)
"""
signal element_focused(element_global_id)
func _input(event):
if event.is_action_pressed("switch_action_verb"):
if event.button_index == BUTTON_WHEEL_UP:
$ui/verbs_layer/verbs_menu.iterate_actions_cursor(-1)
elif event.button_index == BUTTON_WHEEL_DOWN:
$ui/verbs_layer/verbs_menu.iterate_actions_cursor(1)
## BACKGROUND ##
func left_click_on_bg(position : Vector2) -> void:
escoria.do("walk", ["player", position])
func right_click_on_bg(position : Vector2) -> void:
escoria.do("walk", ["player", position])
func left_double_click_on_bg(position : Vector2) -> void:
escoria.do("walk", ["player", position, true])
## ITEM/HOTSPOT FOCUS ##
func element_focused(element_id : String) -> void:
#emit_signal("element_focused", element_id)
# var target_obj = escoria.esc_runner.get_object(element_id)
# if escoria.esc_runner.current_action != "use" && escoria.esc_runner.current_tool == null:
# if target_obj is ESCItem or target_obj is ESCHotspot:
# $ui/verbs_layer/verbs_menu.set_by_name(target_obj.default_action)
pass
func element_unfocused() -> void:
#emit_signal("element_focused", "")
#$ui/verbs_layer/verbs_menu.set_by_name("walk")
pass
## HOTSPOTS ##
func left_click_on_hotspot(hotspot_global_id : String, event : InputEvent) -> void:
escoria.do("hotspot_left_click", [hotspot_global_id, event])
func right_click_on_hotspot(hotspot_global_id : String, event : InputEvent) -> void:
escoria.do("hotspot_right_click", [hotspot_global_id, event])
func left_double_click_on_hotspot(hotspot_global_id : String, event : InputEvent) -> void:
escoria.do("hotspot_left_click", [hotspot_global_id, event])
## ITEMS ##
func left_click_on_item(item_global_id : String, event : InputEvent) -> void:
escoria.do("item_left_click", [item_global_id, event])
func right_click_on_item(item_global_id : String, event : InputEvent) -> void:
escoria.do("item_right_click", [item_global_id, event])
func left_double_click_on_item(item_global_id : String, event : InputEvent) -> void:
escoria.do("item_left_click", [item_global_id, event])
## INVENTORY ##
func left_click_on_inventory_item(inventory_item_global_id : String, event : InputEvent) -> void:
escoria.do("item_left_click", [inventory_item_global_id, event])
if escoria.esc_runner.current_action == "use":
var item = escoria.esc_runner.get_object(inventory_item_global_id)
if item.texture:
$ui/verbs_layer/verbs_menu.set_tool_texture(item.texture)
elif item.inventory_item_scene_file.instance().texture_normal:
$ui/verbs_layer/verbs_menu.set_tool_texture(item.inventory_item_scene_file.instance().texture_normal)
func right_click_on_inventory_item(inventory_item_global_id : String, event : InputEvent) -> void:
escoria.do("item_right_click", [inventory_item_global_id, event])
func left_double_click_on_inventory_item(inventory_item_global_id : String, event : InputEvent) -> void:
pass
func inventory_item_focused(inventory_item_global_id : String) -> void:
emit_signal("element_focused", inventory_item_global_id)
func inventory_item_unfocused() -> void:
emit_signal("element_focused", "")
func open_inventory():
$ui/inventory_layer/inventory_ui/inventory_button.show_inventory()
func close_inventory():
$ui/inventory_layer/inventory_ui/inventory_button.close_inventory()

View File

@@ -1,15 +1,17 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=8 format=2]
[ext_resource path="res://addons/escoria-core/template_scenes/label/action_target_tooltip.tscn" type="PackedScene" id=1]
[ext_resource path="res://game/ui/ui_9verbs/inventory_ui.tscn" type="PackedScene" id=2]
[ext_resource path="res://game/ui/ui_9verbs/verbs_menu.tscn" type="PackedScene" id=3]
[ext_resource path="res://addons/escoria-core/game/scenes/dialogs/dialog_player.tscn" type="PackedScene" id=4]
[ext_resource path="res://game/ui/ui_9verbs/game.gd" type="Script" id=5]
[ext_resource path="res://addons/escoria-core/game/scenes/camera_player/camera.tscn" type="PackedScene" id=6]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.6, 0.6, 0.6, 0.5 )
[node name="game" type="Node"]
script = ExtResource( 5 )
[node name="ui" type="CanvasLayer" parent="."]

View File

@@ -1,7 +1,7 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/escoria-core/game/scenes/inventory/inventory_ui.gd" type="Script" id=1]
[ext_resource path="res://game/items/all_items.tscn" type="PackedScene" id=2]
[ext_resource path="res://game/items/ESCORIA_ALL_ITEMS.tscn" type="PackedScene" id=2]
[ext_resource path="res://game/ui/ui_9verbs/inventory_ui_container.gd" type="Script" id=3]

View File

@@ -1,6 +1,11 @@
tool
extends Control
"""
This script is out of Escoria's scope. It controls the UI reaction to an
UI event (eg right click) to change the cursor accordingly.
"""
func _ready():
for but in $actions.get_children():
but.connect("pressed", self, "_on_action_selected", [but.name])

View File

@@ -21,6 +21,7 @@ Implement methods to react to inputs.
signal element_focused(element_global_id)
func _input(event):
if event.is_action_pressed("switch_action_verb"):
if event.button_index == BUTTON_WHEEL_UP:
@@ -93,7 +94,7 @@ func left_click_on_inventory_item(inventory_item_global_id : String, event : Inp
func right_click_on_inventory_item(inventory_item_global_id : String, event : InputEvent) -> void:
escoria.do("item_right_click", [inventory_item_global_id, event])
func double_left_click_on_inventory_item(inventory_item_global_id : String, event : InputEvent) -> void:
func left_double_click_on_inventory_item(inventory_item_global_id : String, event : InputEvent) -> void:
pass
func inventory_item_focused(inventory_item_global_id : String) -> void:
@@ -101,3 +102,11 @@ func inventory_item_focused(inventory_item_global_id : String) -> void:
func inventory_item_unfocused() -> void:
emit_signal("element_focused", "")
func open_inventory():
$ui/inventory_layer/inventory_ui/inventory_button.show_inventory()
func close_inventory():
$ui/inventory_layer/inventory_ui/inventory_button.close_inventory()

View File

@@ -6,13 +6,20 @@ func _ready():
pass
func _on_inventory_button_pressed():
if !$AnimationPlayer.is_playing() and !showed:
$AnimationPlayer.play("show")
yield($AnimationPlayer, "animation_finished")
showed = true
show_inventory()
elif !$AnimationPlayer.is_playing() and showed:
$AnimationPlayer.play("hide")
yield($AnimationPlayer, "animation_finished")
showed = false
close_inventory()
func show_inventory():
$AnimationPlayer.play("show")
yield($AnimationPlayer, "animation_finished")
showed = true
func close_inventory():
$AnimationPlayer.play("hide")
yield($AnimationPlayer, "animation_finished")
showed = false

View File

@@ -6,7 +6,7 @@
[ext_resource path="res://game/ui/ui_mouse_icons/inventory/inventory_showhide.gd" type="Script" id=4]
[ext_resource path="res://game/ui/ui_mouse_icons/images/frame.png" type="Texture" id=5]
[ext_resource path="res://game/ui/ui_mouse_icons/images/inventory_icon.png" type="Texture" id=6]
[ext_resource path="res://game/items/all_items.tscn" type="PackedScene" id=7]
[ext_resource path="res://game/items/ESCORIA_ALL_ITEMS.tscn" type="PackedScene" id=7]
[sub_resource type="Animation" id=1]
resource_name = "hide"
@@ -100,7 +100,7 @@ __meta__ = {
}
items_container = NodePath("inventory_button/panel/MarginContainer/ScrollContainer/container")
[node name="all_items" parent="." instance=ExtResource( 7 )]
[node name="ESCORIA_ALL_ITEMS" parent="." instance=ExtResource( 7 )]
position = Vector2( 269.391, 275.003 )
[node name="inventory_button" type="TextureButton" parent="."]