mirror of
https://github.com/Relintai/broken_seals_roguelike.git
synced 2024-11-14 10:57:19 +01:00
Create HEADS, also grab everything from the 2d version once again.
This commit is contained in:
parent
3675e59f8f
commit
ca464def38
2
HEADS
2
HEADS
@ -1 +1 @@
|
||||
{"engine": "48edf6333029fc961528892af190201197b44c40", "world_generator": "58e38c07bd798a44232ecdfe02db038e3c434239", "entity_spell_system": "e9a7a92fb289ba1927a1b74c27eeb4d776e7a4a1", "ui_extensions": "271dcf89e9afe5cb6350de2f2433c8ebf8aba785", "texture_packer": "604c330188e220c15d10ea5bd545a6fc5aab0132", "fastnoise": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e", "ess_data": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}
|
||||
{"engine": "56d44aaac96747d2311b11702598c2e65551f411", "world_generator": "58e38c07bd798a44232ecdfe02db038e3c434239", "entity_spell_system": "e9a7a92fb289ba1927a1b74c27eeb4d776e7a4a1", "ui_extensions": "271dcf89e9afe5cb6350de2f2433c8ebf8aba785", "texture_packer": "604c330188e220c15d10ea5bd545a6fc5aab0132", "fastnoise": "41b7ea05a1f7aa2b8ecddaa1fd739e64d6970f7e", "ess_data": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}
|
@ -7,7 +7,7 @@
|
||||
[ext_resource path="res://scripts/item_visuals/CharacterAtlasEntry2D.gd" type="Script" id=5]
|
||||
[ext_resource path="res://characters/char_t1_outline_split.png" type="Texture" id=6]
|
||||
|
||||
[sub_resource type="CharacterAtlasEntry" id=3]
|
||||
[sub_resource type="CharacterAtlasEntry" id=1]
|
||||
script = ExtResource( 5 )
|
||||
front_rect = Rect2( 101, 15, 9, 12 )
|
||||
back_rect = Rect2( 74, 18, 9, 12 )
|
||||
@ -21,7 +21,7 @@ back_rect = Rect2( 75, 5, 7, 8 )
|
||||
right_rect = Rect2( 9, 0, 7, 8 )
|
||||
left_rect = Rect2( 9, 0, 7, 8 )
|
||||
|
||||
[sub_resource type="CharacterAtlas" id=1]
|
||||
[sub_resource type="CharacterAtlas" id=3]
|
||||
script = ExtResource( 4 )
|
||||
comments = "HUMANOID_BONE_HIP = 0,
|
||||
HUMANOID_BONE_TORSO = 1,
|
||||
@ -43,7 +43,7 @@ HUMANOID_BONE_HEAD = 14,
|
||||
HUMANOID_BONE_HEAD_TOP = 15,
|
||||
HUMANOID_BONES_MAX = 16,"
|
||||
texture = ExtResource( 6 )
|
||||
slots = [ null, SubResource( 3 ), null, null, null, null, null, null, null, null, null, null, null, null, SubResource( 2 ), null ]
|
||||
slots = [ null, SubResource( 1 ), null, null, null, null, null, null, null, null, null, null, null, null, SubResource( 2 ), null ]
|
||||
|
||||
[node name="Character" type="CharacterSkeleton"]
|
||||
script = ExtResource( 1 )
|
||||
@ -53,7 +53,7 @@ front_animation_tree_path = NodePath("../Character/CharacterFrontModel/Animation
|
||||
side_node_path = NodePath("CharacterSideModel")
|
||||
side_animation_player_path = NodePath("../Character/CharacterSideModel/AnimationPlayer")
|
||||
side_animation_tree_path = NodePath("../Character/CharacterSideModel/AnimationTree")
|
||||
character_atlas = SubResource( 1 )
|
||||
character_atlas = SubResource( 3 )
|
||||
|
||||
[node name="CharacterFrontModel" parent="." instance=ExtResource( 3 )]
|
||||
visible = false
|
||||
|
BIN
game/data/tilesets/tiles.png
Normal file
BIN
game/data/tilesets/tiles.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
@ -2,15 +2,15 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/tiles.png-3a48cccc1db1aeab4bf551247aa31792.stex"
|
||||
path="res://.import/tiles.png-e2511033dcd256f37e06e0319c180cc2.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://test_iso_size/tiles.png"
|
||||
dest_files=[ "res://.import/tiles.png-3a48cccc1db1aeab4bf551247aa31792.stex" ]
|
||||
source_file="res://data/tilesets/tiles.png"
|
||||
dest_files=[ "res://.import/tiles.png-e2511033dcd256f37e06e0319c180cc2.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
@ -24,7 +24,7 @@ flags/filter=false
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/fix_alpha_border=false
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
50
game/data/tilesets/tileset.tres
Normal file
50
game/data/tilesets/tileset.tres
Normal file
@ -0,0 +1,50 @@
|
||||
[gd_resource type="TileSet" load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://data/tilesets/tiles.png" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=1]
|
||||
vertices = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=2]
|
||||
vertices = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=3]
|
||||
vertices = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
|
||||
[resource]
|
||||
0/name = "Grass"
|
||||
0/texture = ExtResource( 1 )
|
||||
0/tex_offset = Vector2( 0, 0 )
|
||||
0/modulate = Color( 1, 1, 1, 1 )
|
||||
0/region = Rect2( 32, 32, 32, 32 )
|
||||
0/tile_mode = 0
|
||||
0/occluder_offset = Vector2( 0, 0 )
|
||||
0/navigation_offset = Vector2( 0, 0 )
|
||||
0/navigation = SubResource( 1 )
|
||||
0/shapes = [ ]
|
||||
0/z_index = 0
|
||||
1/name = "Grass Variant"
|
||||
1/texture = ExtResource( 1 )
|
||||
1/tex_offset = Vector2( 0, 0 )
|
||||
1/modulate = Color( 1, 1, 1, 1 )
|
||||
1/region = Rect2( 96, 0, 32, 32 )
|
||||
1/tile_mode = 0
|
||||
1/occluder_offset = Vector2( 0, 0 )
|
||||
1/navigation_offset = Vector2( 0, 0 )
|
||||
1/navigation = SubResource( 2 )
|
||||
1/shapes = [ ]
|
||||
1/z_index = 0
|
||||
2/name = "Grass Variant 2"
|
||||
2/texture = ExtResource( 1 )
|
||||
2/tex_offset = Vector2( 0, 0 )
|
||||
2/modulate = Color( 1, 1, 1, 1 )
|
||||
2/region = Rect2( 96, 32, 32, 32 )
|
||||
2/tile_mode = 0
|
||||
2/occluder_offset = Vector2( 0, 0 )
|
||||
2/navigation_offset = Vector2( 0, 0 )
|
||||
2/navigation = SubResource( 3 )
|
||||
2/shapes = [ ]
|
||||
2/z_index = 0
|
@ -7,8 +7,6 @@ enum GenType {
|
||||
}
|
||||
|
||||
|
||||
export(MeshDataResource) var prop_mesht : MeshDataResource
|
||||
|
||||
|
||||
export(int) var gen_type : int = GenType.NORMAL
|
||||
export(int) var _level_seed : int
|
||||
|
@ -1,90 +0,0 @@
|
||||
extends Spatial
|
||||
|
||||
# Copyright (c) 2019 Péter Magyar
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
export (float) var max_camera_distance : float = 20.0
|
||||
|
||||
var target_camera_distance : float = 6.0
|
||||
var camera_distance : float = target_camera_distance
|
||||
|
||||
var camera : Camera
|
||||
|
||||
var x_rot : float = 0.0
|
||||
var y_rot : float = 0.0
|
||||
|
||||
var player : Entity
|
||||
|
||||
func _ready() -> void:
|
||||
camera = $Camera
|
||||
|
||||
camera.translation.z = target_camera_distance
|
||||
|
||||
player = get_node("..")
|
||||
|
||||
set_physics_process(true)
|
||||
|
||||
func _physics_process(delta):
|
||||
var pos : Vector3 = to_global(Vector3())
|
||||
|
||||
var space_state = get_world().direct_space_state
|
||||
|
||||
var result : Dictionary = space_state.intersect_ray(pos, to_global(Vector3(0, 0, target_camera_distance)), [player], player.collision_mask)
|
||||
|
||||
if result:
|
||||
camera_distance = (result.position - pos).length() - 0.2
|
||||
else:
|
||||
camera_distance = target_camera_distance
|
||||
|
||||
camera.translation.z = camera_distance
|
||||
|
||||
func camera_distance_set_delta(delta : float) -> void:
|
||||
target_camera_distance += delta
|
||||
|
||||
if target_camera_distance > max_camera_distance:
|
||||
target_camera_distance = max_camera_distance
|
||||
elif target_camera_distance < 0:
|
||||
target_camera_distance = 0
|
||||
|
||||
func rotate_delta(x_delta : float, y_delta : float) -> void:
|
||||
x_rot += y_delta
|
||||
y_rot += x_delta
|
||||
|
||||
x_rot = clamp(x_rot, -90, 90)
|
||||
|
||||
if y_rot >= 360:
|
||||
y_rot = y_rot - 360
|
||||
if y_rot < 0:
|
||||
y_rot = y_rot + 360
|
||||
|
||||
rotation_degrees = Vector3(x_rot, y_rot, 0.0)
|
||||
|
||||
func get_y_rot() -> float:
|
||||
return y_rot
|
||||
|
||||
func set_y_rot(yrot : float) -> void:
|
||||
y_rot = yrot
|
||||
|
||||
rotation_degrees = Vector3(x_rot, y_rot, 0.0)
|
||||
|
||||
func a_process(delta : float) -> void:
|
||||
y_rot += delta
|
||||
|
||||
rotation_degrees = Vector3(x_rot, y_rot, 0.0)
|
@ -1,6 +1,29 @@
|
||||
extends CharacterSkeleton
|
||||
class_name CharacterSkeleton2D
|
||||
|
||||
# Copyright Péter Magyar relintai@gmail.com
|
||||
# MIT License, functionality from this class needs to be protable to the entity spell system
|
||||
|
||||
# Copyright (c) 2019 Péter Magyar
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
export (NodePath) var front_node_path : NodePath = ""
|
||||
export (NodePath) var front_animation_player_path : NodePath = ""
|
||||
export (NodePath) var front_animation_tree_path : NodePath = ""
|
||||
|
@ -1,17 +1,20 @@
|
||||
extends Entity
|
||||
|
||||
# Copyright Péter Magyar relintai@gmail.com
|
||||
# MIT License, functionality from this class needs to be protable to the entity spell system
|
||||
|
||||
# Copyright (c) 2019 Péter Magyar
|
||||
#
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
|
@ -1,6 +1,29 @@
|
||||
extends CharacterBones
|
||||
class_name HumanoidCharacterBones2D
|
||||
|
||||
# Copyright Péter Magyar relintai@gmail.com
|
||||
# MIT License, functionality from this class needs to be protable to the entity spell system
|
||||
|
||||
# Copyright (c) 2019 Péter Magyar
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
enum HumanoidBones {
|
||||
HUMANOID_BONE_HIP = 0,
|
||||
HUMANOID_BONE_TORSO = 1,
|
||||
|
@ -10,8 +10,6 @@ radius = 20.0
|
||||
[node name="Mob" type="Entity" groups=[
|
||||
"mobs",
|
||||
]]
|
||||
collision_layer = 3
|
||||
collision_mask = 3
|
||||
character_skeleton_path = NodePath("Character")
|
||||
script = ExtResource( 2 )
|
||||
|
||||
|
@ -1,17 +1,20 @@
|
||||
extends Entity
|
||||
|
||||
# Copyright Péter Magyar relintai@gmail.com
|
||||
# MIT License, functionality from this class needs to be protable to the entity spell system
|
||||
|
||||
# Copyright (c) 2019 Péter Magyar
|
||||
#
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
|
@ -67,13 +67,13 @@ var casting_anim : bool = false
|
||||
|
||||
var last_mouse_over : Entity = null
|
||||
|
||||
var world : Navigation2D = null
|
||||
var world : Node2D = null
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
camera = $Camera as Camera2D
|
||||
|
||||
world = get_node(world_path) as Navigation2D
|
||||
world = get_node(world_path) as Node2D
|
||||
|
||||
func _physics_process(delta : float) -> void:
|
||||
if world.initial_generation:
|
||||
@ -215,7 +215,7 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
|
||||
func target(position : Vector2):
|
||||
var space_state = get_world_2d().direct_space_state
|
||||
var results = space_state.intersect_point(world.make_canvas_position_local(position), 32, [], 2)
|
||||
var results = space_state.intersect_point(world.make_canvas_position_local(position), 32, [], get_collision_layer())
|
||||
#var results = space_state.intersect_point(position, 32, [], 2)
|
||||
|
||||
if results:
|
||||
@ -231,7 +231,7 @@ func target(position : Vector2):
|
||||
|
||||
func cmouseover(event):
|
||||
var space_state = get_world_2d().direct_space_state
|
||||
var results = space_state.intersect_point(world.make_canvas_position_local(position), 32, [], 2)
|
||||
var results = space_state.intersect_point(world.make_canvas_position_local(position), 32, [], get_collision_layer())
|
||||
#var results = space_state.intersect_point(position, 32, [], 2)
|
||||
|
||||
if results:
|
||||
|
@ -10,8 +10,6 @@ radius = 8.0
|
||||
[node name="Player" type="Entity" groups=[
|
||||
"players",
|
||||
]]
|
||||
collision_layer = 3
|
||||
collision_mask = 3
|
||||
character_skeleton_path = NodePath("Character")
|
||||
script = ExtResource( 2 )
|
||||
|
||||
|
@ -33,7 +33,6 @@ func _ready():
|
||||
_shape.radius = 50
|
||||
|
||||
_query = Physics2DShapeQueryParameters.new()
|
||||
_query.collision_layer = 2
|
||||
_query.exclude = [ self ]
|
||||
_query.shape_rid = _shape.get_rid()
|
||||
|
||||
@ -50,6 +49,8 @@ func _physics_process(delta):
|
||||
update_visibility()
|
||||
|
||||
func update_visibility() -> void:
|
||||
_query.collision_layer = get_collision_layer()
|
||||
|
||||
_query.transform = Transform2D(0, position)
|
||||
var res : Array = get_world_2d().direct_space_state.intersect_shape(_query)
|
||||
|
||||
|
@ -291,6 +291,7 @@ actionbar_1_12={
|
||||
|
||||
quality/driver/driver_name="GLES2"
|
||||
quality/driver/fallback_to_gles2=true
|
||||
quality/2d/use_pixel_snap=true
|
||||
vram_compression/import_etc=true
|
||||
quality/directional_shadow/size.mobile=1024
|
||||
quality/shading/force_vertex_shading=true
|
||||
|
@ -1,4 +1,26 @@
|
||||
extends Navigation2D
|
||||
extends Node2D
|
||||
|
||||
# Copyright (c) 2019 Péter Magyar
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
export(PackedScene) var world_layer : PackedScene
|
||||
|
||||
export(bool) var editor_generate : bool = false setget set_editor_generate, get_editor_generate
|
||||
export(bool) var show_loading_screen : bool = true
|
||||
@ -12,8 +34,20 @@ var _player_file_name : String
|
||||
var _player : Entity
|
||||
|
||||
func _ready():
|
||||
# print(get_layer(2))
|
||||
pass # Replace with function body.
|
||||
|
||||
func get_layer(index : int) -> Navigation2D:
|
||||
for ch in get_children():
|
||||
if ch.has_method('collision_layer') and ch.collision_layer() == index:
|
||||
return ch
|
||||
|
||||
var wl : Navigation2D = world_layer.instance() as Navigation2D
|
||||
add_child(wl)
|
||||
wl.collision_layer = index
|
||||
|
||||
return wl
|
||||
|
||||
func load_character(file_name: String) -> void:
|
||||
_player_file_name = file_name
|
||||
_player = Entities.load_player(file_name, Vector2(5, 5), 1) as Entity
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,94 +0,0 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://test_iso_size/tiles.png" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=1]
|
||||
vertices = PoolVector2Array( -23, 0, 0, -11, 23, 0, 0, 11 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
outlines = [ PoolVector2Array( -23, 0, 0, -11, 23, 0, 0, 11 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=2]
|
||||
vertices = PoolVector2Array( 1, -1, -43, -23, -1, -44, 43, -22, 35.4934, -18.1594 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3, 4 ) ]
|
||||
outlines = [ PoolVector2Array( 1, -1, -43, -23, -1, -44, 43, -22, 35.4934, -18.1594 ) ]
|
||||
|
||||
[node name="Node2D" type="Node2D"]
|
||||
|
||||
[node name="BigGrass" type="Sprite" parent="."]
|
||||
position = Vector2( 93, 40 )
|
||||
texture = ExtResource( 1 )
|
||||
centered = false
|
||||
offset = Vector2( -22.5, -24 )
|
||||
region_enabled = true
|
||||
region_rect = Rect2( 35, 234, 45, 35 )
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="BigGrass"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="BigGrass/StaticBody2D"]
|
||||
polygon = PoolVector2Array( 0, 11, -23, 0, 0, -11, 23, 0 )
|
||||
|
||||
[node name="BigGrassWalkable" type="Sprite" parent="."]
|
||||
position = Vector2( 28, 49 )
|
||||
texture = ExtResource( 1 )
|
||||
centered = false
|
||||
offset = Vector2( -22.5, -11 )
|
||||
region_enabled = true
|
||||
region_rect = Rect2( 36, 25, 45, 35 )
|
||||
|
||||
[node name="NavigationPolygonInstance2" type="NavigationPolygonInstance" parent="BigGrassWalkable"]
|
||||
navpoly = SubResource( 1 )
|
||||
|
||||
[node name="Small grass" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
centered = false
|
||||
offset = Vector2( -22.5, -11 )
|
||||
region_enabled = true
|
||||
region_rect = Rect2( 20, 191, 45, 22 )
|
||||
|
||||
[node name="NavigationPolygonInstance" type="NavigationPolygonInstance" parent="Small grass"]
|
||||
navpoly = SubResource( 1 )
|
||||
|
||||
[node name="isometric_0004" type="Sprite" parent="."]
|
||||
position = Vector2( -79.7553, 87.2112 )
|
||||
texture = ExtResource( 1 )
|
||||
centered = false
|
||||
offset = Vector2( -44.5, -22.5 )
|
||||
region_enabled = true
|
||||
region_rect = Rect2( 76, 103, 89, 58 )
|
||||
|
||||
[node name="isometric_0001" type="Sprite" parent="."]
|
||||
position = Vector2( 258, 49 )
|
||||
texture = ExtResource( 1 )
|
||||
centered = false
|
||||
offset = Vector2( -43, -44 )
|
||||
region_enabled = true
|
||||
region_rect = Rect2( 132, 14, 86, 65 )
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="isometric_0001"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="isometric_0001/StaticBody2D"]
|
||||
polygon = PoolVector2Array( -43, 0, 0, 21, 43, 0, 0, -22 )
|
||||
|
||||
[node name="NavigationPolygonInstance" type="NavigationPolygonInstance" parent="isometric_0001"]
|
||||
navpoly = SubResource( 2 )
|
||||
|
||||
[node name="isometric_0003" type="Sprite" parent="."]
|
||||
position = Vector2( 157, 151 )
|
||||
texture = ExtResource( 1 )
|
||||
centered = false
|
||||
offset = Vector2( -43, -44 )
|
||||
region_enabled = true
|
||||
region_rect = Rect2( 132, 14, 86, 65 )
|
||||
|
||||
[node name="isometric_0002" type="Sprite" parent="."]
|
||||
position = Vector2( 129.235, -28.4679 )
|
||||
texture = ExtResource( 1 )
|
||||
centered = false
|
||||
offset = Vector2( -10, -65 )
|
||||
region_enabled = true
|
||||
region_rect = Rect2( 33, 98, 23, 76 )
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="isometric_0002"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="isometric_0002/StaticBody2D"]
|
||||
polygon = PoolVector2Array( -10, 0, 12, 11, 16, 8, -6, -2 )
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 133 B |
@ -1,34 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/lighttext.png-00ed5f4e76e6a4bb9f52c4bb11f9c08d.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://test_iso_size/lighttext.png"
|
||||
dest_files=[ "res://.import/lighttext.png-00ed5f4e76e6a4bb9f52c4bb11f9c08d.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.
Binary file not shown.
@ -1,115 +0,0 @@
|
||||
[gd_resource type="TileSet" load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://test_iso_size/tiles.png" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=1]
|
||||
points = PoolVector2Array( 0, 11, -23, 0, 0, -11, 23, 0 )
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=2]
|
||||
vertices = PoolVector2Array( -23, 0, 0, -11, 23, 0, 0, 11 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3 ) ]
|
||||
outlines = [ PoolVector2Array( -23, 0, 0, -11, 23, 0, 0, 11 ) ]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=3]
|
||||
vertices = PoolVector2Array( 1, -1, -43, -23, -1, -44, 43, -22, 35.4934, -18.1594 )
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3, 4 ) ]
|
||||
outlines = [ PoolVector2Array( 1, -1, -43, -23, -1, -44, 43, -22, 35.4934, -18.1594 ) ]
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=4]
|
||||
points = PoolVector2Array( 0, -22, 43, 0, 0, 21, -43, 0 )
|
||||
|
||||
[sub_resource type="ConvexPolygonShape2D" id=5]
|
||||
points = PoolVector2Array( -6, -2, 16, 8, 12, 11, -10, 0 )
|
||||
|
||||
[resource]
|
||||
0/name = "BigGrass"
|
||||
0/texture = ExtResource( 1 )
|
||||
0/tex_offset = Vector2( -22.5, -24 )
|
||||
0/modulate = Color( 1, 1, 1, 1 )
|
||||
0/region = Rect2( 35, 234, 45, 35 )
|
||||
0/tile_mode = 0
|
||||
0/occluder_offset = Vector2( 0, 0 )
|
||||
0/navigation_offset = Vector2( 0, 0 )
|
||||
0/shapes = [ {
|
||||
"autotile_coord": Vector2( 0, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 1 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
} ]
|
||||
0/z_index = 0
|
||||
1/name = "BigGrassWalkable"
|
||||
1/texture = ExtResource( 1 )
|
||||
1/tex_offset = Vector2( -22.5, -11 )
|
||||
1/modulate = Color( 1, 1, 1, 1 )
|
||||
1/region = Rect2( 36, 25, 45, 35 )
|
||||
1/tile_mode = 0
|
||||
1/occluder_offset = Vector2( 0, 0 )
|
||||
1/navigation_offset = Vector2( 0, 0 )
|
||||
1/navigation = SubResource( 2 )
|
||||
1/shapes = [ ]
|
||||
1/z_index = 0
|
||||
2/name = "Small grass"
|
||||
2/texture = ExtResource( 1 )
|
||||
2/tex_offset = Vector2( -22.5, -11 )
|
||||
2/modulate = Color( 1, 1, 1, 1 )
|
||||
2/region = Rect2( 20, 191, 45, 22 )
|
||||
2/tile_mode = 0
|
||||
2/occluder_offset = Vector2( 0, 0 )
|
||||
2/navigation_offset = Vector2( 0, 0 )
|
||||
2/navigation = SubResource( 2 )
|
||||
2/shapes = [ ]
|
||||
2/z_index = 0
|
||||
3/name = "isometric_0004"
|
||||
3/texture = ExtResource( 1 )
|
||||
3/tex_offset = Vector2( -44.5, -22.5 )
|
||||
3/modulate = Color( 1, 1, 1, 1 )
|
||||
3/region = Rect2( 76, 103, 89, 58 )
|
||||
3/tile_mode = 0
|
||||
3/occluder_offset = Vector2( 0, 0 )
|
||||
3/navigation_offset = Vector2( 0, 0 )
|
||||
3/shapes = [ ]
|
||||
3/z_index = 0
|
||||
4/name = "isometric_0001"
|
||||
4/texture = ExtResource( 1 )
|
||||
4/tex_offset = Vector2( -43, -44 )
|
||||
4/modulate = Color( 1, 1, 1, 1 )
|
||||
4/region = Rect2( 132, 14, 86, 65 )
|
||||
4/tile_mode = 0
|
||||
4/occluder_offset = Vector2( 0, 0 )
|
||||
4/navigation_offset = Vector2( 0, 0 )
|
||||
4/navigation = SubResource( 3 )
|
||||
4/shapes = [ {
|
||||
"autotile_coord": Vector2( 0, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 4 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
} ]
|
||||
4/z_index = 0
|
||||
5/name = "isometric_0003"
|
||||
5/texture = ExtResource( 1 )
|
||||
5/tex_offset = Vector2( -43, -44 )
|
||||
5/modulate = Color( 1, 1, 1, 1 )
|
||||
5/region = Rect2( 132, 14, 86, 65 )
|
||||
5/tile_mode = 0
|
||||
5/occluder_offset = Vector2( 0, 0 )
|
||||
5/navigation_offset = Vector2( 0, 0 )
|
||||
5/shapes = [ ]
|
||||
5/z_index = 0
|
||||
6/name = "isometric_0002"
|
||||
6/texture = ExtResource( 1 )
|
||||
6/tex_offset = Vector2( -10, -65 )
|
||||
6/modulate = Color( 1, 1, 1, 1 )
|
||||
6/region = Rect2( 33, 98, 23, 76 )
|
||||
6/tile_mode = 0
|
||||
6/occluder_offset = Vector2( 0, 0 )
|
||||
6/navigation_offset = Vector2( 0, 0 )
|
||||
6/shapes = [ {
|
||||
"autotile_coord": Vector2( 0, 0 ),
|
||||
"one_way": false,
|
||||
"one_way_margin": 1.0,
|
||||
"shape": SubResource( 5 ),
|
||||
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
|
||||
} ]
|
||||
6/z_index = 0
|
Binary file not shown.
Before Width: | Height: | Size: 8.2 KiB |
Binary file not shown.
31
game/world/WorldLayer.gd
Normal file
31
game/world/WorldLayer.gd
Normal file
@ -0,0 +1,31 @@
|
||||
extends Navigation2D
|
||||
|
||||
# Copyright (c) 2019 Péter Magyar
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in all
|
||||
# copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
var collision_layer : int
|
||||
|
||||
func add_entity(entity : Entity) -> void:
|
||||
entity.owner = self
|
||||
entity.collision_layer = collision_layer
|
||||
|
||||
|
||||
func get_collision_layer() -> int:
|
||||
return collision_layer
|
13
game/world/WorldLayer.tscn
Normal file
13
game/world/WorldLayer.tscn
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user