divers changements pour la sortie du second proto
* ajout du panneau solaire #54 * ajout d'un tutoriel #53 * equilibrage du jeu #73 * ajout d'un son pour l'annonce
This commit is contained in:
@@ -124,18 +124,20 @@ func try_move(move_to : Vector2):
|
||||
instruction = MoveInstruction.new(move_to)
|
||||
|
||||
func pick_item(item : Item) -> Item:
|
||||
inventory.add_item(item)
|
||||
var currentItem : Item = inventory.get_item()
|
||||
var itemSwapped : bool = false
|
||||
play_sfx("pick")
|
||||
if !itemSwapped:
|
||||
currentItem = null
|
||||
return currentItem
|
||||
if inventory.length() >= inventory.size:
|
||||
var currentItem : Item = inventory.get_item()
|
||||
inventory.set_item(item, inventory.current_item_ind)
|
||||
return currentItem
|
||||
else :
|
||||
inventory.add_item(item)
|
||||
return null
|
||||
|
||||
func drop_item():
|
||||
var item_to_drop = inventory.pop_item()
|
||||
planet.drop_item(item_to_drop, global_position)
|
||||
play_sfx("drop")
|
||||
if item_to_drop:
|
||||
planet.drop_item(item_to_drop, global_position)
|
||||
play_sfx("drop")
|
||||
|
||||
func delete_item(item: Item):
|
||||
inventory.remove_item(item)
|
||||
|
||||
Reference in New Issue
Block a user