mirror of
				https://git.kittycat.homes/zoe/pegchamp.git
				synced 2024-08-15 03:15:39 +00:00 
			
		
		
		
	added springs
This commit is contained in:
		
							parent
							
								
									62762082f7
								
							
						
					
					
						commit
						e08c2c3ef2
					
				
					 19 changed files with 201 additions and 16 deletions
				
			
		|  | @ -5,7 +5,7 @@ var scenes = [] | |||
| func _ready(): | ||||
| 	GameStats.connect("powerup_picked", self, "queue_free") | ||||
| 	scenes.append("res://Pegs/Yellow/PowerupCards/Scattershot.tscn") | ||||
| 	scenes.append("res://Pegs/Yellow/PowerupCards/ExtraBall.tscn") | ||||
| 	scenes.append("res://Pegs/Yellow/PowerupCards/Spring.tscn") | ||||
| 	 | ||||
| 	spawn_powerups(2) | ||||
| 	get_tree().paused = true | ||||
|  |  | |||
|  | @ -1,9 +0,0 @@ | |||
| [gd_scene load_steps=3 format=2] | ||||
| 
 | ||||
| [ext_resource path="res://Pegs/Yellow/PowerupCard.tscn" type="PackedScene" id=1] | ||||
| [ext_resource path="res://Ball/sprite.png" type="Texture" id=2] | ||||
| 
 | ||||
| [node name="TextureButton" instance=ExtResource( 1 )] | ||||
| 
 | ||||
| [node name="Sprite" parent="." index="0"] | ||||
| texture = ExtResource( 2 ) | ||||
							
								
								
									
										11
									
								
								Pegs/Yellow/PowerupCards/Spring.tscn
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Pegs/Yellow/PowerupCards/Spring.tscn
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,11 @@ | |||
| [gd_scene load_steps=3 format=2] | ||||
| 
 | ||||
| [ext_resource path="res://Pegs/Yellow/PowerupCard.tscn" type="PackedScene" id=1] | ||||
| [ext_resource path="res://Pegs/Yellow/Powerups/Spring/spring-Sheet.png" type="Texture" id=2] | ||||
| 
 | ||||
| [node name="Spring" instance=ExtResource( 1 )] | ||||
| powerup = "res://Pegs/Yellow/Powerups/Spring/Springs.tscn" | ||||
| 
 | ||||
| [node name="Sprite" parent="." index="0"] | ||||
| texture = ExtResource( 2 ) | ||||
| hframes = 9 | ||||
							
								
								
									
										4
									
								
								Pegs/Yellow/Powerups/Spring/Spring.gd
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								Pegs/Yellow/Powerups/Spring/Spring.gd
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,4 @@ | |||
| extends Sprite | ||||
| 
 | ||||
| func animate(): | ||||
| 	$AnimationPlayer.play("Spring") | ||||
							
								
								
									
										30
									
								
								Pegs/Yellow/Powerups/Spring/Spring.tscn
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								Pegs/Yellow/Powerups/Spring/Spring.tscn
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,30 @@ | |||
| [gd_scene load_steps=4 format=2] | ||||
| 
 | ||||
| [ext_resource path="res://Pegs/Yellow/Powerups/Spring/spring-Sheet.png" type="Texture" id=1] | ||||
| [ext_resource path="res://Pegs/Yellow/Powerups/Spring/Spring.gd" type="Script" id=2] | ||||
| 
 | ||||
| [sub_resource type="Animation" id=1] | ||||
| resource_name = "Spring" | ||||
| step = 0.01 | ||||
| tracks/0/type = "value" | ||||
| tracks/0/path = NodePath(".:frame") | ||||
| tracks/0/interp = 1 | ||||
| tracks/0/loop_wrap = true | ||||
| tracks/0/imported = false | ||||
| tracks/0/enabled = true | ||||
| tracks/0/keys = { | ||||
| "times": PoolRealArray( 0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06 ), | ||||
| "transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ), | ||||
| "update": 1, | ||||
| "values": [ 0, 4, 6, 8, 6, 2, 0 ] | ||||
| } | ||||
| 
 | ||||
| [node name="Sprite" type="Sprite"] | ||||
| texture = ExtResource( 1 ) | ||||
| centered = false | ||||
| hframes = 9 | ||||
| region_rect = Rect2( 0, 0, 32, 32 ) | ||||
| script = ExtResource( 2 ) | ||||
| 
 | ||||
| [node name="AnimationPlayer" type="AnimationPlayer" parent="."] | ||||
| anims/Spring = SubResource( 1 ) | ||||
							
								
								
									
										16
									
								
								Pegs/Yellow/Powerups/Spring/Springs.gd
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								Pegs/Yellow/Powerups/Spring/Springs.gd
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,16 @@ | |||
| extends StaticBody2D | ||||
| 
 | ||||
| func _ready() -> void: | ||||
| 	position = Vector2(0, 184) | ||||
| 
 | ||||
| func explode(): | ||||
| 	queue_free() | ||||
| 
 | ||||
| func make_green(): | ||||
| 	for child in get_children(): | ||||
| 		if child.has_method("animate"): | ||||
| 			child.animate() | ||||
| 	$DeathTimer.start() | ||||
| 
 | ||||
| func spring(): | ||||
| 	pass | ||||
							
								
								
									
										58
									
								
								Pegs/Yellow/Powerups/Spring/Springs.tscn
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										58
									
								
								Pegs/Yellow/Powerups/Spring/Springs.tscn
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,58 @@ | |||
| [gd_scene load_steps=4 format=2] | ||||
| 
 | ||||
| [ext_resource path="res://Pegs/Yellow/Powerups/Spring/Spring.tscn" type="PackedScene" id=1] | ||||
| [ext_resource path="res://Pegs/Yellow/Powerups/Spring/Springs.gd" type="Script" id=2] | ||||
| 
 | ||||
| [sub_resource type="RectangleShape2D" id=1] | ||||
| extents = Vector2( 192, 16 ) | ||||
| 
 | ||||
| [node name="Springs" type="StaticBody2D"] | ||||
| z_index = -24 | ||||
| collision_layer = 8 | ||||
| collision_mask = 0 | ||||
| script = ExtResource( 2 ) | ||||
| 
 | ||||
| [node name="Spring" parent="." instance=ExtResource( 1 )] | ||||
| 
 | ||||
| [node name="Spring2" parent="." instance=ExtResource( 1 )] | ||||
| position = Vector2( 32, 0 ) | ||||
| 
 | ||||
| [node name="Spring3" parent="." instance=ExtResource( 1 )] | ||||
| position = Vector2( 64, 0 ) | ||||
| 
 | ||||
| [node name="Spring4" parent="." instance=ExtResource( 1 )] | ||||
| position = Vector2( 96, 0 ) | ||||
| 
 | ||||
| [node name="Spring5" parent="." instance=ExtResource( 1 )] | ||||
| position = Vector2( 128, 0 ) | ||||
| 
 | ||||
| [node name="Spring6" parent="." instance=ExtResource( 1 )] | ||||
| position = Vector2( 160, 0 ) | ||||
| 
 | ||||
| [node name="Spring7" parent="." instance=ExtResource( 1 )] | ||||
| position = Vector2( 192, 0 ) | ||||
| 
 | ||||
| [node name="Spring8" parent="." instance=ExtResource( 1 )] | ||||
| position = Vector2( 224, 0 ) | ||||
| 
 | ||||
| [node name="Spring9" parent="." instance=ExtResource( 1 )] | ||||
| position = Vector2( 256, 0 ) | ||||
| 
 | ||||
| [node name="Spring10" parent="." instance=ExtResource( 1 )] | ||||
| position = Vector2( 288, 0 ) | ||||
| 
 | ||||
| [node name="Spring11" parent="." instance=ExtResource( 1 )] | ||||
| position = Vector2( 320, 0 ) | ||||
| 
 | ||||
| [node name="Spring12" parent="." instance=ExtResource( 1 )] | ||||
| position = Vector2( 352, 0 ) | ||||
| 
 | ||||
| [node name="CollisionShape2D2" type="CollisionShape2D" parent="."] | ||||
| position = Vector2( 192, 16 ) | ||||
| shape = SubResource( 1 ) | ||||
| 
 | ||||
| [node name="DeathTimer" type="Timer" parent="."] | ||||
| wait_time = 0.24 | ||||
| one_shot = true | ||||
| 
 | ||||
| [connection signal="timeout" from="DeathTimer" to="." method="explode"] | ||||
							
								
								
									
										
											BIN
										
									
								
								Pegs/Yellow/Powerups/Spring/spring-Sheet.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Pegs/Yellow/Powerups/Spring/spring-Sheet.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 565 B | 
							
								
								
									
										34
									
								
								Pegs/Yellow/Powerups/Spring/spring-Sheet.png.import
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								Pegs/Yellow/Powerups/Spring/spring-Sheet.png.import
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,34 @@ | |||
| [remap] | ||||
| 
 | ||||
| importer="texture" | ||||
| type="StreamTexture" | ||||
| path="res://.import/spring-Sheet.png-718e1b4dad665f9bd10e67650a1d47b1.stex" | ||||
| metadata={ | ||||
| "vram_texture": false | ||||
| } | ||||
| 
 | ||||
| [deps] | ||||
| 
 | ||||
| source_file="res://Pegs/Yellow/Powerups/Spring/spring-Sheet.png" | ||||
| dest_files=[ "res://.import/spring-Sheet.png-718e1b4dad665f9bd10e67650a1d47b1.stex" ] | ||||
| 
 | ||||
| [params] | ||||
| 
 | ||||
| compress/mode=0 | ||||
| compress/lossy_quality=0.7 | ||||
| compress/hdr_mode=0 | ||||
| compress/bptc_ldr=0 | ||||
| compress/normal_map=0 | ||||
| flags/repeat=0 | ||||
| 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