mirror of
https://github.com/creyD/ludum_dare_46.git
synced 2026-06-16 07:00:20 +02:00
Added Gameplay Animations and Functionality
- Added clap animation for bear trap - Added cards in menu bar - Replaced old bear_trap icon with new one
This commit is contained in:
@@ -9,10 +9,15 @@ script/source = "extends Container
|
||||
func can_drop_data(_pos, data):
|
||||
return typeof(data) == typeof(PackedScene)
|
||||
|
||||
|
||||
func get_nearest_grid_pos(position):
|
||||
return Vector2(floor(position.x / 32.0) * 32, floor(position.y / 32.0) * 32)
|
||||
|
||||
|
||||
#what is to be done when data is dropped
|
||||
func drop_data(_pos, data:PackedScene):
|
||||
var child = data.instance()
|
||||
child.position= _pos
|
||||
child.position = get_nearest_grid_pos(_pos)
|
||||
get_node(get_parent().ObjectParent).add_child(child)
|
||||
"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user