├── icon.png ├── Assets ├── colored_tilemap_packed.png └── colored_tilemap_packed.png.import ├── .import ├── icon.png-487276ed1e3a0c39cad0279d744ee560.md5 ├── icon.png-f3af6db96c0547400c16259083229195.md5 ├── colored_tilemap_packed.png-693fb4b0f298f73928f6e3962d052fb5.md5 ├── colored_tilemap_packed.png-fba8d71b0f69153adec2ec63836f7043.md5 ├── icon.png-487276ed1e3a0c39cad0279d744ee560.stex ├── icon.png-f3af6db96c0547400c16259083229195.stex ├── colored_tilemap_packed.png-693fb4b0f298f73928f6e3962d052fb5.stex └── colored_tilemap_packed.png-fba8d71b0f69153adec2ec63836f7043.stex ├── Entities ├── GlobalManagers │ └── GameManager.gd ├── Enemies │ ├── Zombie.tscn │ └── Enemy.gd ├── Player │ ├── Player.tscn │ └── Player.gd └── Managers │ └── GridManager.gd ├── default_env.tres ├── icon.png.import ├── project.godot ├── Scenes └── TestScene.tscn └── Tilesets └── mainTileset.tres /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Harrk/godot-astar-microadventure/HEAD/icon.png -------------------------------------------------------------------------------- /Assets/colored_tilemap_packed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Harrk/godot-astar-microadventure/HEAD/Assets/colored_tilemap_packed.png -------------------------------------------------------------------------------- /.import/icon.png-487276ed1e3a0c39cad0279d744ee560.md5: -------------------------------------------------------------------------------- 1 | source_md5="47313fa4c47a9963fddd764e1ec6e4a8" 2 | dest_md5="2ded9e7f9060e2b530aab678b135fc5b" 3 | 4 | -------------------------------------------------------------------------------- /.import/icon.png-f3af6db96c0547400c16259083229195.md5: -------------------------------------------------------------------------------- 1 | source_md5="47313fa4c47a9963fddd764e1ec6e4a8" 2 | dest_md5="fd776f4da6b582f16154b0e1c0ad7524" 3 | 4 | -------------------------------------------------------------------------------- /.import/colored_tilemap_packed.png-693fb4b0f298f73928f6e3962d052fb5.md5: -------------------------------------------------------------------------------- 1 | source_md5="58f32b000c1adb052fb1e01f59ab7ccc" 2 | dest_md5="8e8f39ea4bca5241d694949c211c9700" 3 | 4 | -------------------------------------------------------------------------------- /.import/colored_tilemap_packed.png-fba8d71b0f69153adec2ec63836f7043.md5: -------------------------------------------------------------------------------- 1 | source_md5="58f32b000c1adb052fb1e01f59ab7ccc" 2 | dest_md5="77a35df591ea140aba4c6b3a9eba5c51" 3 | 4 | -------------------------------------------------------------------------------- /.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Harrk/godot-astar-microadventure/HEAD/.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex -------------------------------------------------------------------------------- /.import/icon.png-f3af6db96c0547400c16259083229195.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Harrk/godot-astar-microadventure/HEAD/.import/icon.png-f3af6db96c0547400c16259083229195.stex -------------------------------------------------------------------------------- /Entities/GlobalManagers/GameManager.gd: -------------------------------------------------------------------------------- 1 | extends Node 2 | 3 | var player: Node2D 4 | 5 | func _ready(): 6 | #Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) 7 | Engine.target_fps = 0 # Unlock FPS 8 | -------------------------------------------------------------------------------- /default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | 5 | [resource] 6 | background_mode = 2 7 | background_sky = SubResource( 1 ) 8 | -------------------------------------------------------------------------------- /.import/colored_tilemap_packed.png-693fb4b0f298f73928f6e3962d052fb5.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Harrk/godot-astar-microadventure/HEAD/.import/colored_tilemap_packed.png-693fb4b0f298f73928f6e3962d052fb5.stex -------------------------------------------------------------------------------- /.import/colored_tilemap_packed.png-fba8d71b0f69153adec2ec63836f7043.stex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Harrk/godot-astar-microadventure/HEAD/.import/colored_tilemap_packed.png-fba8d71b0f69153adec2ec63836f7043.stex -------------------------------------------------------------------------------- /Entities/Enemies/Zombie.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Assets/colored_tilemap_packed.png" type="Texture" id=1] 4 | [ext_resource path="res://Entities/Enemies/Enemy.gd" type="Script" id=2] 5 | 6 | [node name="Zombie" type="Node2D"] 7 | script = ExtResource( 2 ) 8 | 9 | [node name="Sprite" type="Sprite" parent="."] 10 | texture = ExtResource( 1 ) 11 | centered = false 12 | region_enabled = true 13 | region_rect = Rect2( 88, 0, 8, 8 ) 14 | -------------------------------------------------------------------------------- /Entities/Enemies/Enemy.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | class_name Enemy 4 | 5 | onready var grid_manager: GridManager = get_parent() 6 | 7 | signal moved 8 | 9 | func _ready(): 10 | grid_manager.connect("grid_refreshed", self, "sync_with_grid") 11 | 12 | func move_towards_player(): 13 | grid_manager.free_cell(position) 14 | var move_path = grid_manager.get_move_path(position, GameManager.player.position) 15 | 16 | if move_path.size() > 2: 17 | move_path.pop_front() 18 | var moveTo = move_path.pop_front() 19 | 20 | emit_signal("moved", position, moveTo) 21 | position = moveTo 22 | 23 | grid_manager.reserve_cell(position) 24 | 25 | func sync_with_grid(): 26 | grid_manager.reserve_cell(position) 27 | -------------------------------------------------------------------------------- /icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Entities/Player/Player.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://Assets/colored_tilemap_packed.png" type="Texture" id=1] 4 | [ext_resource path="res://Entities/Player/Player.gd" type="Script" id=2] 5 | 6 | [node name="Player" type="Node2D"] 7 | script = ExtResource( 2 ) 8 | 9 | [node name="Sprite" type="Sprite" parent="."] 10 | texture = ExtResource( 1 ) 11 | centered = false 12 | region_enabled = true 13 | region_rect = Rect2( 32, 0, 8, 8 ) 14 | 15 | [node name="SleepTimer" type="Timer" parent="."] 16 | wait_time = 0.15 17 | one_shot = true 18 | 19 | [node name="Camera2D" type="Camera2D" parent="."] 20 | current = true 21 | zoom = Vector2( 0.75, 0.75 ) 22 | smoothing_enabled = true 23 | [connection signal="timeout" from="SleepTimer" to="." method="_on_SleepTimer_timeout"] 24 | -------------------------------------------------------------------------------- /Assets/colored_tilemap_packed.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/colored_tilemap_packed.png-693fb4b0f298f73928f6e3962d052fb5.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://Assets/colored_tilemap_packed.png" 13 | dest_files=[ "res://.import/colored_tilemap_packed.png-693fb4b0f298f73928f6e3962d052fb5.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=false 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /Entities/Player/Player.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | class_name Player 4 | 5 | var move_path: Array = [] setget set_move_path 6 | 7 | onready var path: Line2D = $"../PathVisual" 8 | onready var grid_manager: GridManager = get_parent() 9 | onready var cell_size: Vector2 = grid_manager.cell_size 10 | 11 | signal moved 12 | 13 | func _ready(): 14 | GameManager.player = self 15 | 16 | func _process(delta): 17 | var moveTo := position 18 | 19 | if Input.is_action_just_pressed("left"): 20 | moveTo.x -= cell_size.x 21 | elif Input.is_action_just_pressed("right"): 22 | moveTo.x += cell_size.x 23 | elif Input.is_action_just_pressed("up"): 24 | moveTo.y -= cell_size.y 25 | elif Input.is_action_just_pressed("down"): 26 | moveTo.y += cell_size.y 27 | elif Input.is_action_just_pressed("touch"): 28 | var mouse_pos: Vector2 = $Camera2D.get_global_mouse_position() - (cell_size / 2) 29 | var points = grid_manager.get_move_path(position, mouse_pos.snapped(cell_size)) 30 | 31 | if points.size() > 1: 32 | self.move_path = points 33 | move_path.pop_front() 34 | 35 | $SleepTimer.start() 36 | 37 | if moveTo != position and grid_manager.can_move_to(moveTo): 38 | self.move_path = [] 39 | move(moveTo) 40 | 41 | func move(pos): 42 | #grid_manager.free_cell(position) 43 | position = pos 44 | #grid_manager.reserve_cell(position) 45 | emit_signal("moved") 46 | 47 | func set_move_path(value): 48 | move_path = value 49 | path.points = value 50 | 51 | func _on_SleepTimer_timeout(): 52 | if move_path.size() > 0: 53 | var moveTo = move_path.pop_front() 54 | 55 | if moveTo != position and grid_manager.can_move_to(moveTo): 56 | move(moveTo) 57 | $SleepTimer.start() 58 | -------------------------------------------------------------------------------- /Entities/Managers/GridManager.gd: -------------------------------------------------------------------------------- 1 | extends TileMap 2 | 3 | class_name GridManager 4 | 5 | var astar: AStar2D 6 | 7 | signal grid_refreshed 8 | 9 | func _ready(): 10 | astar = AStar2D.new() 11 | generate_grid() 12 | 13 | func generate_grid(): 14 | astar.clear() 15 | 16 | # Get the used area of the tilemap 17 | var size: Vector2 = get_used_rect().size 18 | 19 | # Prepare astar area 20 | astar.reserve_space(size.x * size.y) 21 | 22 | # Build Grid by mapping every tile to a point (grid cell) 23 | for x in size.x: 24 | for y in size.y: 25 | var tile_position = Vector2(x, y) 26 | astar.add_point(get_tile_id(tile_position), map_to_world(tile_position), 1) 27 | 28 | # Register Neighbours 29 | for x in size.x: 30 | for y in size.y: 31 | var id = get_tile_id(Vector2(x, y)) 32 | var peek_tile_id 33 | 34 | # Neighbours (UP, DOWN, LEFT, RIGHT) 35 | peek_tile_id = get_tile_id(Vector2(x, y - 1)) 36 | if astar.has_point(peek_tile_id): 37 | astar.connect_points(id, peek_tile_id, false) 38 | 39 | peek_tile_id = get_tile_id(Vector2(x, y + 1)) 40 | if astar.has_point(peek_tile_id): 41 | astar.connect_points(id, peek_tile_id, false) 42 | 43 | peek_tile_id = get_tile_id(Vector2(x - 1, y)) 44 | if astar.has_point(peek_tile_id): 45 | astar.connect_points(id, peek_tile_id, false) 46 | 47 | peek_tile_id = get_tile_id(Vector2(x + 1, y)) 48 | if astar.has_point(peek_tile_id): 49 | astar.connect_points(id, peek_tile_id, false) 50 | 51 | # Reserve points with tiles 52 | if get_cell(x, y) != INVALID_CELL: 53 | astar.set_point_disabled(id, true) 54 | 55 | emit_signal("grid_refreshed") 56 | 57 | func get_tile_id(tile_pos: Vector2) -> int: 58 | tile_pos = tile_pos - get_used_rect().position 59 | 60 | return int(tile_pos.x + (tile_pos.y * get_used_rect().size.x)) 61 | 62 | func free_cell(pos: Vector2): 63 | var mapPos = world_to_map(pos) 64 | var point_id = get_tile_id(mapPos) 65 | 66 | if astar.has_point(point_id): 67 | astar.set_point_disabled(point_id, false) 68 | 69 | func reserve_cell(pos: Vector2): 70 | var mapPos = world_to_map(pos) 71 | var point_id = get_tile_id(mapPos) 72 | 73 | if astar.has_point(point_id): 74 | astar.set_point_disabled(point_id, true) 75 | 76 | func can_move_to(pos: Vector2) -> bool: 77 | var mapPos = world_to_map(pos) 78 | var point_id = get_tile_id(mapPos) 79 | 80 | return astar.has_point(point_id) and ! astar.is_point_disabled(point_id) 81 | 82 | func get_move_path(current_pos: Vector2, target_pos: Vector2) -> Array: 83 | var start_id = get_tile_id(world_to_map(current_pos)) 84 | var target_id = get_tile_id(world_to_map(target_pos)) 85 | 86 | if astar.has_point(start_id) && astar.has_point(target_id): 87 | return Array(astar.get_point_path(start_id, target_id)) 88 | return [] 89 | 90 | func _on_Player_moved(): 91 | for child in get_children(): 92 | if child.has_method("move_towards_player"): 93 | child.move_towards_player() 94 | -------------------------------------------------------------------------------- /project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ { 12 | "base": "Node2D", 13 | "class": "Enemy", 14 | "language": "GDScript", 15 | "path": "res://Entities/Enemies/Enemy.gd" 16 | }, { 17 | "base": "TileMap", 18 | "class": "GridManager", 19 | "language": "GDScript", 20 | "path": "res://Entities/Managers/GridManager.gd" 21 | }, { 22 | "base": "Node2D", 23 | "class": "Player", 24 | "language": "GDScript", 25 | "path": "res://Entities/Player/Player.gd" 26 | } ] 27 | _global_script_class_icons={ 28 | "Enemy": "", 29 | "GridManager": "", 30 | "Player": "" 31 | } 32 | 33 | [application] 34 | 35 | config/name="Micro Adventure" 36 | run/main_scene="res://Scenes/TestScene.tscn" 37 | config/icon="res://icon.png" 38 | 39 | [autoload] 40 | 41 | GameManager="*res://Entities/GlobalManagers/GameManager.gd" 42 | 43 | [display] 44 | 45 | window/size/width=320 46 | window/size/height=180 47 | window/size/test_width=1280 48 | window/size/test_height=720 49 | window/stretch/mode="2d" 50 | window/stretch/aspect="keep" 51 | 52 | [importer_defaults] 53 | 54 | texture={ 55 | "compress/bptc_ldr": 0, 56 | "compress/hdr_mode": 0, 57 | "compress/lossy_quality": 0.7, 58 | "compress/mode": 0, 59 | "compress/normal_map": 0, 60 | "detect_3d": false, 61 | "flags/anisotropic": false, 62 | "flags/filter": false, 63 | "flags/mipmaps": false, 64 | "flags/repeat": 0, 65 | "flags/srgb": 2, 66 | "process/HDR_as_SRGB": false, 67 | "process/fix_alpha_border": true, 68 | "process/invert_color": false, 69 | "process/premult_alpha": false, 70 | "size_limit": 0, 71 | "stream": false, 72 | "svg/scale": 1.0 73 | } 74 | 75 | [input] 76 | 77 | up={ 78 | "deadzone": 0.5, 79 | "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":87,"unicode":0,"echo":false,"script":null) 80 | , 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) 81 | ] 82 | } 83 | down={ 84 | "deadzone": 0.5, 85 | "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":83,"unicode":0,"echo":false,"script":null) 86 | , 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) 87 | ] 88 | } 89 | left={ 90 | "deadzone": 0.5, 91 | "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":65,"unicode":0,"echo":false,"script":null) 92 | , 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) 93 | ] 94 | } 95 | right={ 96 | "deadzone": 0.5, 97 | "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":68,"unicode":0,"echo":false,"script":null) 98 | , 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) 99 | ] 100 | } 101 | touch={ 102 | "deadzone": 0.5, 103 | "events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null) 104 | ] 105 | } 106 | 107 | [rendering] 108 | 109 | quality/2d/use_pixel_snap=true 110 | environment/default_clear_color=Color( 0.133333, 0.137255, 0.137255, 1 ) 111 | environment/default_environment="res://default_env.tres" 112 | -------------------------------------------------------------------------------- /Scenes/TestScene.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://Tilesets/mainTileset.tres" type="TileSet" id=1] 4 | [ext_resource path="res://Entities/Player/Player.tscn" type="PackedScene" id=2] 5 | [ext_resource path="res://Entities/Managers/GridManager.gd" type="Script" id=3] 6 | [ext_resource path="res://Entities/Enemies/Zombie.tscn" type="PackedScene" id=4] 7 | 8 | [node name="TestScene" type="Node2D"] 9 | 10 | [node name="NonBlockingTilemap" type="TileMap" parent="."] 11 | tile_set = ExtResource( 1 ) 12 | cell_size = Vector2( 8, 8 ) 13 | format = 1 14 | tile_data = PoolIntArray( 262153, 0, 2, 458761, 0, 2, 720922, 0, 2, 917530, 0, 2 ) 15 | 16 | [node name="PathTilemap" type="TileMap" parent="."] 17 | tile_set = ExtResource( 1 ) 18 | cell_size = Vector2( 8, 8 ) 19 | format = 1 20 | tile_data = PoolIntArray( -65532, 3, 0, 0, 3, 0, 1, 3, 0, 2, 3, 0, 4, 3, 0, 5, 3, 0, 6, 3, 0, 7, 3, 0, 8, 3, 0, 9, 3, 0, 10, 3, 0, 12, 3, 0, 33, 3, 0, 34, 3, 0, 35, 3, 0, 36, 3, 0, 37, 3, 0, 38, 3, 0, 39, 3, 0, 65537, 3, 0, 65538, 3, 0, 65539, 3, 0, 65540, 3, 0, 65541, 3, 0, 65542, 3, 0, 65543, 3, 0, 65544, 3, 0, 65545, 3, 0, 65546, 3, 0, 65547, 3, 0, 65548, 3, 0, 65549, 3, 0, 65550, 3, 0, 65551, 3, 0, 65552, 3, 0, 65553, 3, 0, 65554, 3, 0, 65556, 3, 0, 65559, 3, 0, 65560, 3, 0, 65561, 3, 0, 65562, 3, 0, 65568, 3, 0, 65569, 3, 0, 65570, 3, 0, 65571, 3, 0, 65572, 3, 0, 65573, 3, 0, 65574, 3, 0, 196607, 3, 0, 131072, 3, 0, 131073, 3, 0, 131074, 3, 0, 131075, 3, 0, 131084, 3, 0, 131085, 3, 0, 131086, 3, 0, 131087, 3, 0, 131088, 3, 0, 131089, 3, 0, 131090, 3, 0, 131091, 3, 0, 131092, 3, 0, 131093, 3, 0, 131094, 3, 0, 131095, 3, 0, 131098, 3, 0, 131099, 3, 0, 131100, 3, 0, 131101, 3, 0, 131106, 3, 0, 131107, 3, 0, 131108, 3, 0, 131110, 3, 0, 131111, 3, 0, 262143, 3, 0, 196608, 3, 0, 196609, 3, 0, 196627, 3, 0, 196628, 3, 0, 196629, 3, 0, 196630, 3, 0, 196631, 3, 0, 196632, 3, 0, 196635, 3, 0, 196638, 3, 0, 196639, 3, 0, 196642, 3, 0, 196643, 3, 0, 196644, 3, 0, 196646, 3, 0, 196647, 3, 0, 327679, 3, 0, 262144, 3, 0, 262145, 3, 0, 262150, 0, 0, 262151, 0, 1, 262152, 0, 1, 262154, 0, 3, 262168, 3, 0, 262170, 3, 0, 262174, 3, 0, 262178, 3, 0, 262179, 3, 0, 262180, 3, 0, 262182, 3, 0, 262183, 3, 0, 262187, 2, 0, 393215, 3, 0, 327680, 3, 0, 327681, 3, 0, 327686, 0, 65536, 327687, 12, 0, 327688, 11, 0, 327690, 0, 65539, 327709, 3, 0, 327710, 3, 0, 327713, 3, 0, 327714, 3, 0, 327715, 3, 0, 327716, 3, 0, 327717, 3, 0, 327718, 3, 0, 327719, 3, 0, 458751, 3, 0, 393216, 3, 0, 393217, 3, 0, 393222, 0, 65536, 393226, 0, 65539, 393244, 3, 0, 393245, 3, 0, 393250, 3, 0, 393251, 3, 0, 393252, 3, 0, 393253, 3, 0, 393255, 3, 0, 524285, 3, 0, 524286, 3, 0, 524287, 3, 0, 458752, 3, 0, 458758, 0, 131072, 458759, 0, 1, 458760, 0, 1, 458762, 0, 131075, 458777, 3, 0, 458779, 3, 0, 458780, 3, 0, 458781, 3, 0, 458782, 3, 0, 458783, 3, 0, 458786, 3, 0, 458787, 3, 0, 589821, 3, 0, 589822, 3, 0, 524288, 3, 0, 524289, 3, 0, 524313, 3, 0, 524314, 3, 0, 524315, 3, 0, 524316, 3, 0, 524317, 3, 0, 524318, 3, 0, 524319, 3, 0, 524320, 3, 0, 524321, 3, 0, 524322, 3, 0, 524323, 3, 0, 655358, 3, 0, 655359, 3, 0, 589824, 3, 0, 589825, 3, 0, 589853, 3, 0, 589854, 3, 0, 589855, 3, 0, 589859, 3, 0, 589860, 3, 0, 720895, 3, 0, 655360, 3, 0, 655361, 3, 0, 655362, 3, 0, 655390, 3, 0, 655395, 3, 0, 655396, 3, 0, 786430, 3, 0, 786431, 3, 0, 720896, 3, 0, 720898, 3, 0, 720921, 0, 0, 720923, 0, 3, 720931, 3, 0, 720932, 3, 0, 720933, 3, 0, 851966, 3, 0, 786432, 3, 0, 786433, 3, 0, 786434, 3, 0, 786457, 0, 65536, 786459, 0, 65539, 786462, 5, 0, 786464, 9, 0, 786467, 3, 0, 786469, 3, 0, 917502, 3, 0, 917503, 3, 0, 851968, 3, 0, 851993, 0, 65536, 851995, 0, 65539, 852003, 3, 0, 852004, 3, 0, 852005, 3, 0, 983039, 3, 0, 917504, 3, 0, 917514, 3, 0, 917521, 3, 0, 917529, 0, 131072, 917531, 0, 131075, 917539, 3, 0, 917540, 3, 0, 983040, 3, 0, 983041, 3, 0, 983049, 3, 0, 983050, 3, 0, 983051, 3, 0, 983057, 3, 0, 983058, 3, 0, 983072, 3, 0, 983073, 3, 0, 983074, 3, 0, 983075, 3, 0, 983076, 3, 0, 983077, 3, 0, 1048576, 3, 0, 1048577, 3, 0, 1048585, 3, 0, 1048586, 3, 0, 1048587, 3, 0, 1048594, 3, 0, 1048595, 3, 0, 1048596, 3, 0, 1048608, 3, 0, 1048609, 3, 0, 1048610, 3, 0, 1048611, 3, 0, 1048612, 3, 0, 1048613, 3, 0, 1114112, 3, 0, 1114113, 3, 0, 1114127, 3, 0, 1114128, 3, 0, 1114129, 3, 0, 1114130, 3, 0, 1114131, 3, 0, 1114132, 3, 0, 1114133, 3, 0, 1114143, 3, 0, 1114144, 3, 0, 1114147, 3, 0, 1245183, 3, 0, 1179648, 3, 0, 1179650, 3, 0, 1179666, 3, 0, 1179667, 3, 0, 1179668, 3, 0, 1179674, 3, 0, 1179675, 3, 0, 1179676, 3, 0, 1179682, 3, 0, 1179683, 3, 0, 1310719, 3, 0, 1245184, 3, 0, 1245185, 3, 0, 1245186, 3, 0, 1245204, 3, 0, 1245210, 3, 0, 1245212, 3, 0, 1245213, 3, 0, 1245214, 3, 0, 1245217, 3, 0, 1245221, 3, 0, 1245222, 3, 0, 1245223, 3, 0, 1376255, 3, 0, 1310720, 3, 0, 1310721, 3, 0, 1310722, 3, 0, 1310723, 3, 0, 1310724, 3, 0, 1310725, 3, 0, 1310739, 3, 0, 1310740, 3, 0, 1310741, 3, 0, 1310742, 3, 0, 1310746, 3, 0, 1310747, 3, 0, 1310748, 3, 0, 1310749, 3, 0, 1310750, 3, 0, 1310751, 3, 0, 1310752, 3, 0, 1310753, 3, 0, 1310754, 3, 0, 1310757, 3, 0, 1310758, 3, 0, 1310759, 3, 0, 1376256, 3, 0, 1376257, 3, 0, 1376258, 3, 0, 1376259, 3, 0, 1376260, 3, 0, 1376261, 3, 0, 1376262, 3, 0, 1376263, 3, 0, 1376264, 3, 0, 1376265, 3, 0, 1376267, 3, 0, 1376268, 3, 0, 1376269, 3, 0, 1376270, 3, 0, 1376271, 3, 0, 1376274, 3, 0, 1376275, 3, 0, 1376276, 3, 0, 1376277, 3, 0, 1376278, 3, 0, 1376279, 3, 0, 1376280, 3, 0, 1376281, 3, 0, 1376282, 3, 0, 1376283, 3, 0, 1376284, 3, 0, 1376285, 3, 0, 1376286, 3, 0, 1376287, 3, 0, 1376288, 3, 0, 1376290, 3, 0, 1376291, 3, 0, 1376292, 3, 0, 1376293, 3, 0, 1376294, 3, 0, 1441795, 3, 0, 1441796, 3, 0, 1441797, 3, 0, 1441798, 3, 0, 1441801, 3, 0, 1441802, 3, 0, 1441803, 3, 0, 1441804, 3, 0, 1441805, 3, 0, 1441806, 3, 0, 1441807, 3, 0, 1441808, 3, 0, 1441809, 3, 0, 1441810, 3, 0, 1441811, 3, 0, 1441812, 3, 0, 1441813, 3, 0, 1441814, 3, 0, 1441815, 3, 0, 1507334, 3, 0, 1507335, 3, 0, 1507336, 3, 0, 1507337, 3, 0, 1507338, 3, 0, 1507341, 3, 0, 1507342, 3, 0, 1507343, 3, 0, 1507344, 3, 0, 1507345, 3, 0 ) 21 | script = ExtResource( 3 ) 22 | 23 | [node name="PathVisual" type="Line2D" parent="PathTilemap"] 24 | position = Vector2( 4, 4 ) 25 | width = 2.0 26 | default_color = Color( 0.364706, 0.345098, 1, 1 ) 27 | joint_mode = 2 28 | begin_cap_mode = 2 29 | end_cap_mode = 2 30 | 31 | [node name="Player" parent="PathTilemap" instance=ExtResource( 2 )] 32 | position = Vector2( 88, 96 ) 33 | 34 | [node name="Zombie" parent="PathTilemap" instance=ExtResource( 4 )] 35 | position = Vector2( 248, 112 ) 36 | 37 | [node name="Zombie2" parent="PathTilemap" instance=ExtResource( 4 )] 38 | position = Vector2( 264, 80 ) 39 | [connection signal="moved" from="PathTilemap/Player" to="PathTilemap" method="_on_Player_moved"] 40 | -------------------------------------------------------------------------------- /Tilesets/mainTileset.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="TileSet" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://Assets/colored_tilemap_packed.png" type="Texture" id=1] 4 | 5 | [resource] 6 | 0/name = "colored_tilemap_packed.png 0" 7 | 0/texture = ExtResource( 1 ) 8 | 0/tex_offset = Vector2( 0, 0 ) 9 | 0/modulate = Color( 1, 1, 1, 1 ) 10 | 0/region = Rect2( 0, 0, 32, 48 ) 11 | 0/tile_mode = 2 12 | 0/autotile/icon_coordinate = Vector2( 0, 0 ) 13 | 0/autotile/tile_size = Vector2( 8, 8 ) 14 | 0/autotile/spacing = 0 15 | 0/autotile/occluder_map = [ ] 16 | 0/autotile/navpoly_map = [ ] 17 | 0/autotile/priority_map = [ ] 18 | 0/autotile/z_index_map = [ ] 19 | 0/occluder_offset = Vector2( 0, 0 ) 20 | 0/navigation_offset = Vector2( 0, 0 ) 21 | 0/shape_offset = Vector2( 0, 0 ) 22 | 0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 23 | 0/shape_one_way = false 24 | 0/shape_one_way_margin = 0.0 25 | 0/shapes = [ ] 26 | 0/z_index = 0 27 | 1/name = "colored_tilemap_packed.png 1" 28 | 1/texture = ExtResource( 1 ) 29 | 1/tex_offset = Vector2( 0, 0 ) 30 | 1/modulate = Color( 1, 1, 1, 1 ) 31 | 1/region = Rect2( 0, 72, 80, 8 ) 32 | 1/tile_mode = 2 33 | 1/autotile/icon_coordinate = Vector2( 0, 0 ) 34 | 1/autotile/tile_size = Vector2( 8, 8 ) 35 | 1/autotile/spacing = 0 36 | 1/autotile/occluder_map = [ ] 37 | 1/autotile/navpoly_map = [ ] 38 | 1/autotile/priority_map = [ ] 39 | 1/autotile/z_index_map = [ ] 40 | 1/occluder_offset = Vector2( 0, 0 ) 41 | 1/navigation_offset = Vector2( 0, 0 ) 42 | 1/shape_offset = Vector2( 0, 0 ) 43 | 1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 44 | 1/shape_one_way = false 45 | 1/shape_one_way_margin = 0.0 46 | 1/shapes = [ ] 47 | 1/z_index = 0 48 | 2/name = "colored_tilemap_packed.png 2" 49 | 2/texture = ExtResource( 1 ) 50 | 2/tex_offset = Vector2( 0, 0 ) 51 | 2/modulate = Color( 1, 1, 1, 1 ) 52 | 2/region = Rect2( 32, 40, 8, 8 ) 53 | 2/tile_mode = 0 54 | 2/occluder_offset = Vector2( 0, 0 ) 55 | 2/navigation_offset = Vector2( 0, 0 ) 56 | 2/shape_offset = Vector2( 0, 0 ) 57 | 2/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 58 | 2/shape_one_way = false 59 | 2/shape_one_way_margin = 0.0 60 | 2/shapes = [ ] 61 | 2/z_index = 0 62 | 3/name = "colored_tilemap_packed.png 3" 63 | 3/texture = ExtResource( 1 ) 64 | 3/tex_offset = Vector2( 0, 0 ) 65 | 3/modulate = Color( 1, 1, 1, 1 ) 66 | 3/region = Rect2( 40, 40, 8, 8 ) 67 | 3/tile_mode = 0 68 | 3/occluder_offset = Vector2( 0, 0 ) 69 | 3/navigation_offset = Vector2( 0, 0 ) 70 | 3/shape_offset = Vector2( 0, 0 ) 71 | 3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 72 | 3/shape_one_way = false 73 | 3/shape_one_way_margin = 0.0 74 | 3/shapes = [ ] 75 | 3/z_index = 0 76 | 4/name = "colored_tilemap_packed.png 4" 77 | 4/texture = ExtResource( 1 ) 78 | 4/tex_offset = Vector2( 0, 0 ) 79 | 4/modulate = Color( 1, 1, 1, 1 ) 80 | 4/region = Rect2( 48, 40, 8, 8 ) 81 | 4/tile_mode = 0 82 | 4/occluder_offset = Vector2( 0, 0 ) 83 | 4/navigation_offset = Vector2( 0, 0 ) 84 | 4/shape_offset = Vector2( 0, 0 ) 85 | 4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 86 | 4/shape_one_way = false 87 | 4/shape_one_way_margin = 0.0 88 | 4/shapes = [ ] 89 | 4/z_index = 0 90 | 5/name = "colored_tilemap_packed.png 5" 91 | 5/texture = ExtResource( 1 ) 92 | 5/tex_offset = Vector2( 0, 0 ) 93 | 5/modulate = Color( 1, 1, 1, 1 ) 94 | 5/region = Rect2( 64, 56, 8, 8 ) 95 | 5/tile_mode = 0 96 | 5/occluder_offset = Vector2( 0, 0 ) 97 | 5/navigation_offset = Vector2( 0, 0 ) 98 | 5/shape_offset = Vector2( 0, 0 ) 99 | 5/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 100 | 5/shape_one_way = false 101 | 5/shape_one_way_margin = 0.0 102 | 5/shapes = [ ] 103 | 5/z_index = 0 104 | 6/name = "colored_tilemap_packed.png 6" 105 | 6/texture = ExtResource( 1 ) 106 | 6/tex_offset = Vector2( 0, 0 ) 107 | 6/modulate = Color( 1, 1, 1, 1 ) 108 | 6/region = Rect2( 40, 56, 8, 8 ) 109 | 6/tile_mode = 0 110 | 6/occluder_offset = Vector2( 0, 0 ) 111 | 6/navigation_offset = Vector2( 0, 0 ) 112 | 6/shape_offset = Vector2( 0, 0 ) 113 | 6/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 114 | 6/shape_one_way = false 115 | 6/shape_one_way_margin = 0.0 116 | 6/shapes = [ ] 117 | 6/z_index = 0 118 | 7/name = "colored_tilemap_packed.png 7" 119 | 7/texture = ExtResource( 1 ) 120 | 7/tex_offset = Vector2( 0, 0 ) 121 | 7/modulate = Color( 1, 1, 1, 1 ) 122 | 7/region = Rect2( 48, 56, 8, 8 ) 123 | 7/tile_mode = 0 124 | 7/occluder_offset = Vector2( 0, 0 ) 125 | 7/navigation_offset = Vector2( 0, 0 ) 126 | 7/shape_offset = Vector2( 0, 0 ) 127 | 7/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 128 | 7/shape_one_way = false 129 | 7/shape_one_way_margin = 0.0 130 | 7/shapes = [ ] 131 | 7/z_index = 0 132 | 8/name = "colored_tilemap_packed.png 8" 133 | 8/texture = ExtResource( 1 ) 134 | 8/tex_offset = Vector2( 0, 0 ) 135 | 8/modulate = Color( 1, 1, 1, 1 ) 136 | 8/region = Rect2( 56, 56, 8, 8 ) 137 | 8/tile_mode = 0 138 | 8/occluder_offset = Vector2( 0, 0 ) 139 | 8/navigation_offset = Vector2( 0, 0 ) 140 | 8/shape_offset = Vector2( 0, 0 ) 141 | 8/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 142 | 8/shape_one_way = false 143 | 8/shape_one_way_margin = 0.0 144 | 8/shapes = [ ] 145 | 8/z_index = 0 146 | 9/name = "colored_tilemap_packed.png 9" 147 | 9/texture = ExtResource( 1 ) 148 | 9/tex_offset = Vector2( 0, 0 ) 149 | 9/modulate = Color( 1, 1, 1, 1 ) 150 | 9/region = Rect2( 72, 56, 8, 8 ) 151 | 9/tile_mode = 0 152 | 9/occluder_offset = Vector2( 0, 0 ) 153 | 9/navigation_offset = Vector2( 0, 0 ) 154 | 9/shape_offset = Vector2( 0, 0 ) 155 | 9/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 156 | 9/shape_one_way = false 157 | 9/shape_one_way_margin = 0.0 158 | 9/shapes = [ ] 159 | 9/z_index = 0 160 | 10/name = "colored_tilemap_packed.png 10" 161 | 10/texture = ExtResource( 1 ) 162 | 10/tex_offset = Vector2( 0, 0 ) 163 | 10/modulate = Color( 1, 1, 1, 1 ) 164 | 10/region = Rect2( 80, 56, 8, 8 ) 165 | 10/tile_mode = 0 166 | 10/occluder_offset = Vector2( 0, 0 ) 167 | 10/navigation_offset = Vector2( 0, 0 ) 168 | 10/shape_offset = Vector2( 0, 0 ) 169 | 10/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 170 | 10/shape_one_way = false 171 | 10/shape_one_way_margin = 0.0 172 | 10/shapes = [ ] 173 | 10/z_index = 0 174 | 11/name = "colored_tilemap_packed.png 11" 175 | 11/texture = ExtResource( 1 ) 176 | 11/tex_offset = Vector2( 0, 0 ) 177 | 11/modulate = Color( 1, 1, 1, 1 ) 178 | 11/region = Rect2( 48, 24, 8, 8 ) 179 | 11/tile_mode = 0 180 | 11/occluder_offset = Vector2( 0, 0 ) 181 | 11/navigation_offset = Vector2( 0, 0 ) 182 | 11/shape_offset = Vector2( 0, 0 ) 183 | 11/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 184 | 11/shape_one_way = false 185 | 11/shape_one_way_margin = 0.0 186 | 11/shapes = [ ] 187 | 11/z_index = 0 188 | 12/name = "colored_tilemap_packed.png 12" 189 | 12/texture = ExtResource( 1 ) 190 | 12/tex_offset = Vector2( 0, 0 ) 191 | 12/modulate = Color( 1, 1, 1, 1 ) 192 | 12/region = Rect2( 56, 24, 8, 8 ) 193 | 12/tile_mode = 0 194 | 12/occluder_offset = Vector2( 0, 0 ) 195 | 12/navigation_offset = Vector2( 0, 0 ) 196 | 12/shape_offset = Vector2( 0, 0 ) 197 | 12/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 198 | 12/shape_one_way = false 199 | 12/shape_one_way_margin = 0.0 200 | 12/shapes = [ ] 201 | 12/z_index = 0 202 | 13/name = "colored_tilemap_packed.png 13" 203 | 13/texture = ExtResource( 1 ) 204 | 13/tex_offset = Vector2( 0, 0 ) 205 | 13/modulate = Color( 1, 1, 1, 1 ) 206 | 13/region = Rect2( 64, 24, 8, 8 ) 207 | 13/tile_mode = 0 208 | 13/occluder_offset = Vector2( 0, 0 ) 209 | 13/navigation_offset = Vector2( 0, 0 ) 210 | 13/shape_offset = Vector2( 0, 0 ) 211 | 13/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) 212 | 13/shape_one_way = false 213 | 13/shape_one_way_margin = 0.0 214 | 13/shapes = [ ] 215 | 13/z_index = 0 216 | --------------------------------------------------------------------------------