inventaire de 3 items #52

This commit is contained in:
Altaezio
2025-09-19 13:30:05 +02:00
parent 42edc97401
commit 88bfa71bd8
12 changed files with 216 additions and 28 deletions

View File

@@ -43,9 +43,7 @@ func inspector_info() -> Inspector.Info:
)
func interact(player : Player) -> bool:
var swapped_item = player.inventory.get_item()
player.get_item(item)
var swapped_item = player.pick_item(item)
if swapped_item:
item = swapped_item
@@ -63,6 +61,7 @@ func pickup_animation(player : Player):
func():
queue_free()
)
object_sprite.pickup_animation()
func generate_sprite() -> ItemObjectSprite:
var spriteNode = SPRITE_SCENE.instantiate() as ItemObjectSprite

View File

@@ -10,3 +10,6 @@ func apply_texture_to_sprite(texture, item_sprite_size = 50.):
1./(texture.get_width()/item_sprite_size),
1./(texture.get_height()/item_sprite_size)
)
func pickup_animation():
%AnimationPlayer.play("pickup")