Scene Manager & Collecting Items- Jingyue Gao

I created ItemManager.gd script, added SceneManager.gd script, and updated the PlayerController.gd script.

There are three items that could be collected in the scene. The system would count how many items the main character has collected when collecting a new one.

Here is the demonstration:

My Items and SceneManager

This shows my character collecting items.

extends Area2D

export var item_type = 'apple'
signal item_collected

var item_is_collected = false

func _on_Item_body_entered(body):
	if not item_is_collected:
		emit_signal("item_collected", item_type)
		item_is_collected = true
		$AnimatedSprite.play("Collected")

func _on_AnimatedSprite_animation_finished():
	if item_is_collected:
		queue_free()