Added cards for objects + MISC

- Added flame animation
- Added cards for objects
- Added new background animation
- Added placeable walls

Co-Authored-By: deranonymos <deranonymos@users.noreply.github.com>
This commit is contained in:
2020-04-20 15:54:40 +02:00
parent 32e73895dc
commit fafd1956c6
390 changed files with 4727 additions and 2117 deletions

View File

@@ -10,21 +10,17 @@ func can_drop_data(_pos, data):
return typeof(data) == typeof(PackedScene)
func get_nearest_grid_pos(position):
return Vector2(round(position.x / 32.0), round(position.y / 32.0))
func get_nearest_global_pos(position):
return Vector2(round(position.x / 32.0) * 32, round(position.y / 32.0) * 32)
func get_nearest_grid_pos(position, scale = 1):
return Vector2(round(position.x / 32.0) * scale, round(position.y / 32.0) * scale)
#what is to be done when data is dropped
func drop_data(_pos, data:PackedScene):
var new_pos = get_nearest_grid_pos(_pos)
grid._draw_object_grid()
if grid.object_grid[new_pos.x - 1][new_pos.y - 1].back() == Grid.Kind.FIELD:
var child = data.instance()
child.position = get_nearest_global_pos(_pos)
child.position = get_nearest_grid_pos(_pos, 32)
ysort.add_child(child)
grid._update_grid()