mirror of
				https://git.kittycat.homes/zoe/pegchamp.git
				synced 2024-08-15 03:15:39 +00:00 
			
		
		
		
	added cool animation to springs
This commit is contained in:
		
							parent
							
								
									7b67b3aef6
								
							
						
					
					
						commit
						a88727b2d8
					
				
					 13 changed files with 267 additions and 47 deletions
				
			
		|  | @ -3,7 +3,13 @@ extends StaticBody2D | |||
| func _ready() -> void: | ||||
| 	if GameStats.powerup_active: | ||||
| 		queue_free() | ||||
| 	else: GameStats.powerup_active = true | ||||
| 	else:  | ||||
| 		GameStats.powerup_active = true | ||||
| 			# spawn animation | ||||
| 		var main = get_tree().current_scene | ||||
| 		var Anim = preload("res://Pegs/Yellow/Powerups/Spawn/FromBottom.tscn") | ||||
| 		var anim = Anim.instance() | ||||
| 		main.add_child(anim) | ||||
| 	position = Vector2(0, 184) | ||||
| 	 | ||||
| 	# spawn all the springs with some delays | ||||
|  | @ -13,16 +19,17 @@ func _ready() -> void: | |||
| 			counter += 1 | ||||
| 			child.animate_spawn(rand_range(1, counter)) | ||||
| 
 | ||||
| 
 | ||||
| func explode(): | ||||
| 	queue_free() | ||||
| 	Engine.time_scale = 1 | ||||
| 	GameStats.powerup_active = false | ||||
| 
 | ||||
| func make_green(): | ||||
| 	for child in get_children(): | ||||
| 		if child.has_method("animate_hit"): | ||||
| 			child.animate_hit() | ||||
| 	$DeathTimer.start() | ||||
| 	GameStats.powerup_active = false | ||||
| 	 | ||||
| 	var SFX = preload("res://Pegs/Yellow/Powerups/Spring/SpringSFX.tscn") | ||||
| 	var main = get_tree().current_scene | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue