feat: ability to share dragons
This commit is contained in:
		
							parent
							
								
									3919df1805
								
							
						
					
					
						commit
						029ad6d45f
					
				
					 15 changed files with 203 additions and 30 deletions
				
			
		| 
						 | 
				
			
			@ -4,7 +4,9 @@ class_name DragonEntity
 | 
			
		|||
 | 
			
		||||
@export var dragon: DragonSprite
 | 
			
		||||
 | 
			
		||||
signal on_pick(position: Vector2, hat: Texture2D, shirt: Texture2D, shoes: Texture2D, dragon_name: String)
 | 
			
		||||
signal on_pick(dragon_id: int, position: Vector2, hat: Texture2D, shirt: Texture2D, shoes: Texture2D, dragon_name: String)
 | 
			
		||||
 | 
			
		||||
var id: int
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
func _ready() -> void:
 | 
			
		||||
| 
						 | 
				
			
			@ -15,7 +17,7 @@ func _input_event(viewport, event, shape_idx) -> void:
 | 
			
		|||
	if event is InputEventMouseButton \
 | 
			
		||||
	and event.button_index == MOUSE_BUTTON_LEFT \
 | 
			
		||||
	and event.is_pressed():
 | 
			
		||||
		on_pick.emit(position, dragon.hat.texture, dragon.shirt.texture, dragon.shoes.texture, dragon.name_label.text)
 | 
			
		||||
		on_pick.emit(id, position, dragon.hat.texture, dragon.shirt.texture, dragon.shoes.texture, dragon.name_label.text)
 | 
			
		||||
		queue_free()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue