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
				
			
		
							
								
								
									
										19
									
								
								Pegs/Yellow/Powerups/Spawn/FromBottom.gd
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								Pegs/Yellow/Powerups/Spawn/FromBottom.gd
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,19 @@ | |||
| extends Node2D | ||||
| 
 | ||||
| func _ready() -> void: | ||||
| 	global_position = Vector2(0, 184) | ||||
| 	spawn_animations() | ||||
| 	$Particles2D.emitting = true | ||||
| 
 | ||||
| func spawn_animations(): | ||||
| 	var Sprite = preload("res://Pegs/Yellow/Powerups/Spawn/FromBottomSprite.tscn") | ||||
| 	var counter = 0 | ||||
| 	while counter <= 12: | ||||
| 		var sprite = Sprite.instance() | ||||
| 		add_child(sprite) | ||||
| 		sprite.play("spawn") | ||||
| 		sprite.offset = Vector2(counter * 32, -32) | ||||
| 		sprite.global_position = global_position | ||||
| 		counter += 1 | ||||
| 
 | ||||
| 
 | ||||
							
								
								
									
										35
									
								
								Pegs/Yellow/Powerups/Spawn/FromBottom.tscn
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								Pegs/Yellow/Powerups/Spawn/FromBottom.tscn
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,35 @@ | |||
| [gd_scene load_steps=3 format=2] | ||||
| 
 | ||||
| [ext_resource path="res://Pegs/Yellow/Powerups/Spawn/FromBottom.gd" type="Script" id=2] | ||||
| 
 | ||||
| [sub_resource type="ParticlesMaterial" id=1] | ||||
| emission_shape = 2 | ||||
| emission_box_extents = Vector3( 192, 1, 1 ) | ||||
| flag_disable_z = true | ||||
| direction = Vector3( 0, -100, 0 ) | ||||
| flatness = 1.0 | ||||
| gravity = Vector3( 0, 98, 0 ) | ||||
| initial_velocity = 224.0 | ||||
| orbit_velocity = 0.0 | ||||
| orbit_velocity_random = 0.0 | ||||
| color = Color( 0.454902, 0.337255, 0.607843, 1 ) | ||||
| 
 | ||||
| [node name="FromBottom" type="Node2D"] | ||||
| script = ExtResource( 2 ) | ||||
| 
 | ||||
| [node name="Timer" type="Timer" parent="."] | ||||
| wait_time = 10.0 | ||||
| one_shot = true | ||||
| autostart = true | ||||
| 
 | ||||
| [node name="Particles2D" type="Particles2D" parent="."] | ||||
| position = Vector2( 192, 0 ) | ||||
| z_index = -20 | ||||
| emitting = false | ||||
| amount = 128 | ||||
| lifetime = 2.0 | ||||
| one_shot = true | ||||
| explosiveness = 0.5 | ||||
| process_material = SubResource( 1 ) | ||||
| 
 | ||||
| [connection signal="timeout" from="Timer" to="." method="queue_free"] | ||||
							
								
								
									
										11
									
								
								Pegs/Yellow/Powerups/Spawn/FromBottomSprite.gd
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Pegs/Yellow/Powerups/Spawn/FromBottomSprite.gd
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,11 @@ | |||
| extends AnimatedSprite | ||||
| 
 | ||||
| var ready_for_delete = false | ||||
| 
 | ||||
| func play_backwards(): | ||||
| 	if ready_for_delete: | ||||
| 		queue_free() | ||||
| 	else: | ||||
| 		play("despawn") | ||||
| 		ready_for_delete = true | ||||
| 
 | ||||
							
								
								
									
										98
									
								
								Pegs/Yellow/Powerups/Spawn/FromBottomSprite.tscn
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										98
									
								
								Pegs/Yellow/Powerups/Spawn/FromBottomSprite.tscn
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,98 @@ | |||
| [gd_scene load_steps=18 format=2] | ||||
| 
 | ||||
| [ext_resource path="res://Pegs/Yellow/Powerups/Spawn/fromBottom.png" type="Texture" id=1] | ||||
| [ext_resource path="res://Pegs/Yellow/Powerups/Spawn/FromBottomSprite.gd" type="Script" id=2] | ||||
| 
 | ||||
| [sub_resource type="AtlasTexture" id=1] | ||||
| flags = 2 | ||||
| atlas = ExtResource( 1 ) | ||||
| region = Rect2( 0, 0, 32, 64 ) | ||||
| 
 | ||||
| [sub_resource type="AtlasTexture" id=2] | ||||
| flags = 2 | ||||
| atlas = ExtResource( 1 ) | ||||
| region = Rect2( 32, 0, 32, 64 ) | ||||
| 
 | ||||
| [sub_resource type="AtlasTexture" id=3] | ||||
| flags = 2 | ||||
| atlas = ExtResource( 1 ) | ||||
| region = Rect2( 64, 0, 32, 64 ) | ||||
| 
 | ||||
| [sub_resource type="AtlasTexture" id=4] | ||||
| flags = 2 | ||||
| atlas = ExtResource( 1 ) | ||||
| region = Rect2( 96, 0, 32, 64 ) | ||||
| 
 | ||||
| [sub_resource type="AtlasTexture" id=5] | ||||
| flags = 2 | ||||
| atlas = ExtResource( 1 ) | ||||
| region = Rect2( 128, 0, 32, 64 ) | ||||
| 
 | ||||
| [sub_resource type="AtlasTexture" id=6] | ||||
| flags = 2 | ||||
| atlas = ExtResource( 1 ) | ||||
| region = Rect2( 160, 0, 32, 64 ) | ||||
| 
 | ||||
| [sub_resource type="AtlasTexture" id=7] | ||||
| flags = 2 | ||||
| atlas = ExtResource( 1 ) | ||||
| region = Rect2( 192, 0, 32, 64 ) | ||||
| 
 | ||||
| [sub_resource type="AtlasTexture" id=9] | ||||
| flags = 2 | ||||
| atlas = ExtResource( 1 ) | ||||
| region = Rect2( 192, 0, 32, 64 ) | ||||
| 
 | ||||
| [sub_resource type="AtlasTexture" id=10] | ||||
| flags = 2 | ||||
| atlas = ExtResource( 1 ) | ||||
| region = Rect2( 160, 0, 32, 64 ) | ||||
| 
 | ||||
| [sub_resource type="AtlasTexture" id=11] | ||||
| flags = 2 | ||||
| atlas = ExtResource( 1 ) | ||||
| region = Rect2( 128, 0, 32, 64 ) | ||||
| 
 | ||||
| [sub_resource type="AtlasTexture" id=12] | ||||
| flags = 2 | ||||
| atlas = ExtResource( 1 ) | ||||
| region = Rect2( 96, 0, 32, 64 ) | ||||
| 
 | ||||
| [sub_resource type="AtlasTexture" id=13] | ||||
| flags = 2 | ||||
| atlas = ExtResource( 1 ) | ||||
| region = Rect2( 64, 0, 32, 64 ) | ||||
| 
 | ||||
| [sub_resource type="AtlasTexture" id=14] | ||||
| flags = 2 | ||||
| atlas = ExtResource( 1 ) | ||||
| region = Rect2( 32, 0, 32, 64 ) | ||||
| 
 | ||||
| [sub_resource type="AtlasTexture" id=15] | ||||
| flags = 2 | ||||
| atlas = ExtResource( 1 ) | ||||
| region = Rect2( 0, 0, 32, 64 ) | ||||
| 
 | ||||
| [sub_resource type="SpriteFrames" id=8] | ||||
| animations = [ { | ||||
| "frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ) ], | ||||
| "loop": false, | ||||
| "name": "spawn", | ||||
| "speed": 15.0 | ||||
| }, { | ||||
| "frames": [ SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ) ], | ||||
| "loop": false, | ||||
| "name": "despawn", | ||||
| "speed": 15.0 | ||||
| } ] | ||||
| 
 | ||||
| [node name="FromBottomSprite" type="AnimatedSprite"] | ||||
| position = Vector2( 0, -32 ) | ||||
| z_index = -200 | ||||
| z_as_relative = false | ||||
| frames = SubResource( 8 ) | ||||
| animation = "despawn" | ||||
| centered = false | ||||
| script = ExtResource( 2 ) | ||||
| 
 | ||||
| [connection signal="animation_finished" from="." to="." method="play_backwards"] | ||||
							
								
								
									
										
											BIN
										
									
								
								Pegs/Yellow/Powerups/Spawn/fromBottom.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Pegs/Yellow/Powerups/Spawn/fromBottom.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 1.2 KiB | 
							
								
								
									
										34
									
								
								Pegs/Yellow/Powerups/Spawn/fromBottom.png.import
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								Pegs/Yellow/Powerups/Spawn/fromBottom.png.import
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,34 @@ | |||
| [remap] | ||||
| 
 | ||||
| importer="texture" | ||||
| type="StreamTexture" | ||||
| path="res://.import/fromBottom.png-f61a8e364dfcd48f694cac6077108a99.stex" | ||||
| metadata={ | ||||
| "vram_texture": false | ||||
| } | ||||
| 
 | ||||
| [deps] | ||||
| 
 | ||||
| source_file="res://Pegs/Yellow/Powerups/Spawn/fromBottom.png" | ||||
| dest_files=[ "res://.import/fromBottom.png-f61a8e364dfcd48f694cac6077108a99.stex" ] | ||||
| 
 | ||||
| [params] | ||||
| 
 | ||||
| compress/mode=0 | ||||
| compress/lossy_quality=0.7 | ||||
| compress/hdr_mode=0 | ||||
| compress/bptc_ldr=0 | ||||
| compress/normal_map=0 | ||||
| flags/repeat=1 | ||||
| flags/filter=false | ||||
| flags/mipmaps=false | ||||
| flags/anisotropic=false | ||||
| flags/srgb=2 | ||||
| process/fix_alpha_border=true | ||||
| process/premult_alpha=false | ||||
| process/HDR_as_SRGB=false | ||||
| process/invert_color=false | ||||
| stream=false | ||||
| size_limit=0 | ||||
| detect_3d=false | ||||
| svg/scale=1.0 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue