Added interaction map

This commit is contained in:
EljakimHerrewijnen 2020-10-03 14:49:11 +02:00
parent a6fc79e22d
commit 9841ce41a7
4 changed files with 31 additions and 114 deletions

View File

@ -7,6 +7,7 @@ onready var background_map = get_node("/root/Map1/background")
onready var player = get_node("/root/Map1/Player") onready var player = get_node("/root/Map1/Player")
onready var cell_size = background_map._get_cell_size() onready var cell_size = background_map._get_cell_size()
onready var plants_map = get_node("/root/Map1/interaction_map") onready var plants_map = get_node("/root/Map1/interaction_map")
onready var interaction = get_node("/root/Map1/player_interaction")
var velocity = Vector2() var velocity = Vector2()
@ -27,6 +28,9 @@ func _physics_process(delta):
velocity.x = 0 velocity.x = 0
velocity.y = 0 velocity.y = 0
move_and_slide(velocity, Vector2(0, -1)) move_and_slide(velocity, Vector2(0, -1))
if(interaction.get_cell(int(self.position.x / cell_size.x), int(self.position.y / cell_size.y)) == -1):
interaction.clear()
interaction.set_cell(int(self.position.x / cell_size.x), int(self.position.y / cell_size.y), 0)
#Handles interaction with the map #Handles interaction with the map
func _interaction_process(): func _interaction_process():

View File

@ -1,107 +0,0 @@
[gd_resource type="TileSet" load_steps=2 format=2]
[ext_resource path="res://omgeving/vloer32x32/TilesetGodotVloer.png" type="Texture" id=1]
[resource]
0/name = "TilesetGodotVloer.png 0"
0/texture = ExtResource( 1 )
0/tex_offset = Vector2( 0, 0 )
0/modulate = Color( 1, 1, 1, 1 )
0/region = Rect2( 176, 0, 176, 176 )
0/tile_mode = 0
0/occluder_offset = Vector2( 0, 0 )
0/navigation_offset = Vector2( 0, 0 )
0/shape_offset = Vector2( 0, 0 )
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
0/shape_one_way = false
0/shape_one_way_margin = 0.0
0/shapes = [ ]
0/z_index = 0
1/name = "TilesetGodotVloer.png 1"
1/texture = ExtResource( 1 )
1/tex_offset = Vector2( 0, 0 )
1/modulate = Color( 1, 1, 1, 1 )
1/region = Rect2( 352, 0, 176, 176 )
1/tile_mode = 1
1/autotile/bitmask_mode = 0
1/autotile/bitmask_flags = [ ]
1/autotile/icon_coordinate = Vector2( 0, 0 )
1/autotile/tile_size = Vector2( 176, 176 )
1/autotile/spacing = 0
1/autotile/occluder_map = [ ]
1/autotile/navpoly_map = [ ]
1/autotile/priority_map = [ ]
1/autotile/z_index_map = [ ]
1/occluder_offset = Vector2( 0, 0 )
1/navigation_offset = Vector2( 0, 0 )
1/shape_offset = Vector2( 0, 0 )
1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
1/shape_one_way = false
1/shape_one_way_margin = 0.0
1/shapes = [ ]
1/z_index = 0
2/name = "TilesetGodotVloer.png 2"
2/texture = ExtResource( 1 )
2/tex_offset = Vector2( 0, 0 )
2/modulate = Color( 1, 1, 1, 1 )
2/region = Rect2( 176, 0, 176, 176 )
2/tile_mode = 2
2/autotile/icon_coordinate = Vector2( 0, 0 )
2/autotile/tile_size = Vector2( 176, 176 )
2/autotile/spacing = 0
2/autotile/occluder_map = [ ]
2/autotile/navpoly_map = [ ]
2/autotile/priority_map = [ ]
2/autotile/z_index_map = [ ]
2/occluder_offset = Vector2( 0, 0 )
2/navigation_offset = Vector2( 0, 0 )
2/shape_offset = Vector2( 0, 0 )
2/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
2/shape_one_way = false
2/shape_one_way_margin = 0.0
2/shapes = [ ]
2/z_index = 0
3/name = "Gras_grond_boven"
3/texture = ExtResource( 1 )
3/tex_offset = Vector2( 0, 0 )
3/modulate = Color( 1, 1, 1, 1 )
3/region = Rect2( 0, 0, 528, 176 )
3/tile_mode = 2
3/autotile/icon_coordinate = Vector2( 1, 0 )
3/autotile/tile_size = Vector2( 176, 176 )
3/autotile/spacing = 0
3/autotile/occluder_map = [ ]
3/autotile/navpoly_map = [ ]
3/autotile/priority_map = [ ]
3/autotile/z_index_map = [ ]
3/occluder_offset = Vector2( 0, 0 )
3/navigation_offset = Vector2( 0, 0 )
3/shape_offset = Vector2( 0, 0 )
3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
3/shape_one_way = false
3/shape_one_way_margin = 0.0
3/shapes = [ ]
3/z_index = 0
4/name = "TilesetGodotVloer.png 4"
4/texture = ExtResource( 1 )
4/tex_offset = Vector2( 0, 0 )
4/modulate = Color( 1, 1, 1, 1 )
4/region = Rect2( 176, 0, 176, 176 )
4/tile_mode = 1
4/autotile/bitmask_mode = 0
4/autotile/bitmask_flags = [ ]
4/autotile/icon_coordinate = Vector2( 0, 0 )
4/autotile/tile_size = Vector2( 176, 176 )
4/autotile/spacing = 0
4/autotile/occluder_map = [ ]
4/autotile/navpoly_map = [ ]
4/autotile/priority_map = [ ]
4/autotile/z_index_map = [ ]
4/occluder_offset = Vector2( 0, 0 )
4/navigation_offset = Vector2( 0, 0 )
4/shape_offset = Vector2( 0, 0 )
4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
4/shape_one_way = false
4/shape_one_way_margin = 0.0
4/shapes = [ ]
4/z_index = 0

View File

@ -0,0 +1,19 @@
[gd_resource type="TileSet" load_steps=2 format=2]
[ext_resource path="res://pictures/gui/interaction/tile_interaction.png" type="Texture" id=1]
[resource]
0/name = "tile_interaction.png 0"
0/texture = ExtResource( 1 )
0/tex_offset = Vector2( 0, 0 )
0/modulate = Color( 1, 1, 1, 1 )
0/region = Rect2( 0, 0, 32, 32 )
0/tile_mode = 0
0/occluder_offset = Vector2( 0, 0 )
0/navigation_offset = Vector2( 0, 0 )
0/shape_offset = Vector2( 0, 0 )
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
0/shape_one_way = false
0/shape_one_way_margin = 0.0
0/shapes = [ ]
0/z_index = 0

File diff suppressed because one or more lines are too long