mirror of
				https://git.kittycat.homes/zoe/pegchamp.git
				synced 2024-08-15 03:15:39 +00:00 
			
		
		
		
	more sfx
This commit is contained in:
		
							parent
							
								
									e08c2c3ef2
								
							
						
					
					
						commit
						7b67b3aef6
					
				
					 24 changed files with 238 additions and 167 deletions
				
			
		
							
								
								
									
										3
									
								
								.import/bounce.wav-47078fe0d68ca69236bb0ffae2794bc9.md5
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								.import/bounce.wav-47078fe0d68ca69236bb0ffae2794bc9.md5
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,3 @@ | ||||||
|  | source_md5="cc3b0974b5bb983daf546e5481ae3515" | ||||||
|  | dest_md5="7238adc01eb4165d8e2d17f64752aa63" | ||||||
|  | 
 | ||||||
							
								
								
									
										
											BIN
										
									
								
								.import/bounce.wav-47078fe0d68ca69236bb0ffae2794bc9.sample
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.import/bounce.wav-47078fe0d68ca69236bb0ffae2794bc9.sample
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										3
									
								
								.import/popup.wav-2e0856004658cfec43b137fce4a3ec7a.md5
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								.import/popup.wav-2e0856004658cfec43b137fce4a3ec7a.md5
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,3 @@ | ||||||
|  | source_md5="376997cce90f26640dce8e9ef1b6d1dd" | ||||||
|  | dest_md5="56fc4714a7edef7b24c10cc9b9842629" | ||||||
|  | 
 | ||||||
							
								
								
									
										
											BIN
										
									
								
								.import/popup.wav-2e0856004658cfec43b137fce4a3ec7a.sample
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.import/popup.wav-2e0856004658cfec43b137fce4a3ec7a.sample
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										14
									
								
								Effects/Background.tscn
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								Effects/Background.tscn
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,14 @@ | ||||||
|  | [gd_scene load_steps=2 format=2] | ||||||
|  | 
 | ||||||
|  | [ext_resource path="res://Stages/Background.png" type="Texture" id=1] | ||||||
|  | 
 | ||||||
|  | [node name="Background" type="ParallaxBackground"] | ||||||
|  | 
 | ||||||
|  | [node name="ParallaxLayer" type="ParallaxLayer" parent="."] | ||||||
|  | motion_scale = Vector2( 0.5, 1 ) | ||||||
|  | 
 | ||||||
|  | [node name="Background" type="Sprite" parent="ParallaxLayer"] | ||||||
|  | z_index = -200 | ||||||
|  | texture = ExtResource( 1 ) | ||||||
|  | region_enabled = true | ||||||
|  | region_rect = Rect2( 0, 0, 768, 432 ) | ||||||
|  | @ -21,8 +21,5 @@ __meta__ = { | ||||||
| 
 | 
 | ||||||
| [connection signal="changed" from="." to="." method="save_volume"] | [connection signal="changed" from="." to="." method="save_volume"] | ||||||
| [connection signal="focus_entered" from="." to="ButtonSFX" method="on_hover"] | [connection signal="focus_entered" from="." to="ButtonSFX" method="on_hover"] | ||||||
| [connection signal="focus_exited" from="." to="." method="save_volume"] |  | ||||||
| [connection signal="focus_exited" from="." to="ButtonSFX" method="on_select"] |  | ||||||
| [connection signal="mouse_entered" from="." to="ButtonSFX" method="on_hover"] | [connection signal="mouse_entered" from="." to="ButtonSFX" method="on_hover"] | ||||||
| [connection signal="mouse_exited" from="." to="ButtonSFX" method="on_select"] |  | ||||||
| [connection signal="value_changed" from="." to="." method="_on_MusicVolumeSlider_value_changed"] | [connection signal="value_changed" from="." to="." method="_on_MusicVolumeSlider_value_changed"] | ||||||
|  |  | ||||||
|  | @ -1,9 +1,9 @@ | ||||||
| [gd_scene load_steps=13 format=2] | [gd_scene load_steps=14 format=2] | ||||||
| 
 | 
 | ||||||
| [ext_resource path="res://Menu/Theme.tres" type="Theme" id=1] | [ext_resource path="res://Menu/Theme.tres" type="Theme" id=1] | ||||||
| [ext_resource path="res://Menu/LevelList.tscn" type="PackedScene" id=2] | [ext_resource path="res://Menu/LevelList.tscn" type="PackedScene" id=2] | ||||||
| [ext_resource path="res://Effects/FadeIn.tscn" type="PackedScene" id=3] | [ext_resource path="res://Effects/FadeIn.tscn" type="PackedScene" id=3] | ||||||
| [ext_resource path="res://Cannon/Cannon.tscn" type="PackedScene" id=4] | [ext_resource path="res://Menu/MainMenuCam.gd" type="Script" id=4] | ||||||
| [ext_resource path="res://Menu/Buttons/Fullscreen/FullscreenButton.tscn" type="PackedScene" id=5] | [ext_resource path="res://Menu/Buttons/Fullscreen/FullscreenButton.tscn" type="PackedScene" id=5] | ||||||
| [ext_resource path="res://Menu/Buttons/CameraFXButton.tscn" type="PackedScene" id=6] | [ext_resource path="res://Menu/Buttons/CameraFXButton.tscn" type="PackedScene" id=6] | ||||||
| [ext_resource path="res://Menu/LevelInfo.tscn" type="PackedScene" id=7] | [ext_resource path="res://Menu/LevelInfo.tscn" type="PackedScene" id=7] | ||||||
|  | @ -12,10 +12,13 @@ | ||||||
| [ext_resource path="res://Menu/Buttons/AudioSliders/MusicVolume2.png" type="Texture" id=11] | [ext_resource path="res://Menu/Buttons/AudioSliders/MusicVolume2.png" type="Texture" id=11] | ||||||
| [ext_resource path="res://Menu/Buttons/AudioSliders/SFXVolume1.png" type="Texture" id=12] | [ext_resource path="res://Menu/Buttons/AudioSliders/SFXVolume1.png" type="Texture" id=12] | ||||||
| [ext_resource path="res://Menu/Buttons/AudioSliders/SFXVolume2.png" type="Texture" id=13] | [ext_resource path="res://Menu/Buttons/AudioSliders/SFXVolume2.png" type="Texture" id=13] | ||||||
|  | [ext_resource path="res://Effects/Background.tscn" type="PackedScene" id=14] | ||||||
| 
 | 
 | ||||||
| [node name="CanvasLayer" type="CanvasLayer"] | [node name="Node2D" type="Node2D"] | ||||||
| 
 | 
 | ||||||
| [node name="Control" type="Control" parent="."] | [node name="CanvasLayer" type="CanvasLayer" parent="."] | ||||||
|  | 
 | ||||||
|  | [node name="Control" type="Control" parent="CanvasLayer"] | ||||||
| anchor_right = 1.0 | anchor_right = 1.0 | ||||||
| anchor_bottom = 1.0 | anchor_bottom = 1.0 | ||||||
| margin_left = 4.0 | margin_left = 4.0 | ||||||
|  | @ -27,7 +30,7 @@ __meta__ = { | ||||||
| "_edit_use_anchors_": false | "_edit_use_anchors_": false | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| [node name="TabContainer" type="TabContainer" parent="Control"] | [node name="TabContainer" type="TabContainer" parent="CanvasLayer/Control"] | ||||||
| anchor_right = 1.0 | anchor_right = 1.0 | ||||||
| anchor_bottom = 1.0 | anchor_bottom = 1.0 | ||||||
| theme = ExtResource( 1 ) | theme = ExtResource( 1 ) | ||||||
|  | @ -38,7 +41,7 @@ __meta__ = { | ||||||
| "_edit_use_anchors_": false | "_edit_use_anchors_": false | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| [node name="Main Menu" type="Tabs" parent="Control/TabContainer"] | [node name="Main Menu" type="Tabs" parent="CanvasLayer/Control/TabContainer"] | ||||||
| anchor_right = 1.0 | anchor_right = 1.0 | ||||||
| anchor_bottom = 1.0 | anchor_bottom = 1.0 | ||||||
| margin_left = 4.0 | margin_left = 4.0 | ||||||
|  | @ -47,7 +50,7 @@ margin_right = -4.0 | ||||||
| margin_bottom = -4.0 | margin_bottom = -4.0 | ||||||
| theme = ExtResource( 1 ) | theme = ExtResource( 1 ) | ||||||
| 
 | 
 | ||||||
| [node name="VBoxContainer" type="VBoxContainer" parent="Control/TabContainer/Main Menu"] | [node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/Control/TabContainer/Main Menu"] | ||||||
| anchor_right = 1.0 | anchor_right = 1.0 | ||||||
| anchor_bottom = 1.0 | anchor_bottom = 1.0 | ||||||
| alignment = 2 | alignment = 2 | ||||||
|  | @ -55,13 +58,13 @@ __meta__ = { | ||||||
| "_edit_use_anchors_": false | "_edit_use_anchors_": false | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| [node name="HBoxContainer" type="HBoxContainer" parent="Control/TabContainer/Main Menu/VBoxContainer"] | [node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/Control/TabContainer/Main Menu/VBoxContainer"] | ||||||
| margin_top = 125.0 | margin_top = 125.0 | ||||||
| margin_right = 368.0 | margin_right = 368.0 | ||||||
| margin_bottom = 165.0 | margin_bottom = 165.0 | ||||||
| alignment = 1 | alignment = 1 | ||||||
| 
 | 
 | ||||||
| [node name="SFX Volume" parent="Control/TabContainer/Main Menu/VBoxContainer/HBoxContainer" instance=ExtResource( 9 )] | [node name="SFX Volume" parent="CanvasLayer/Control/TabContainer/Main Menu/VBoxContainer/HBoxContainer" instance=ExtResource( 9 )] | ||||||
| margin_right = 100.0 | margin_right = 100.0 | ||||||
| margin_bottom = 40.0 | margin_bottom = 40.0 | ||||||
| rect_min_size = Vector2( 100, 40 ) | rect_min_size = Vector2( 100, 40 ) | ||||||
|  | @ -69,7 +72,7 @@ custom_icons/grabber_highlight = ExtResource( 13 ) | ||||||
| custom_icons/grabber = ExtResource( 12 ) | custom_icons/grabber = ExtResource( 12 ) | ||||||
| bus_channel = "SFX" | bus_channel = "SFX" | ||||||
| 
 | 
 | ||||||
| [node name="Music Volume" parent="Control/TabContainer/Main Menu/VBoxContainer/HBoxContainer" instance=ExtResource( 9 )] | [node name="Music Volume" parent="CanvasLayer/Control/TabContainer/Main Menu/VBoxContainer/HBoxContainer" instance=ExtResource( 9 )] | ||||||
| margin_left = 104.0 | margin_left = 104.0 | ||||||
| margin_right = 204.0 | margin_right = 204.0 | ||||||
| margin_bottom = 40.0 | margin_bottom = 40.0 | ||||||
|  | @ -80,7 +83,7 @@ custom_icons/grabber_highlight = ExtResource( 11 ) | ||||||
| custom_icons/grabber = ExtResource( 10 ) | custom_icons/grabber = ExtResource( 10 ) | ||||||
| bus_channel = "Music" | bus_channel = "Music" | ||||||
| 
 | 
 | ||||||
| [node name="FullscreenButton" parent="Control/TabContainer/Main Menu/VBoxContainer/HBoxContainer" instance=ExtResource( 5 )] | [node name="FullscreenButton" parent="CanvasLayer/Control/TabContainer/Main Menu/VBoxContainer/HBoxContainer" instance=ExtResource( 5 )] | ||||||
| anchor_right = 0.0 | anchor_right = 0.0 | ||||||
| anchor_bottom = 0.0 | anchor_bottom = 0.0 | ||||||
| margin_left = 208.0 | margin_left = 208.0 | ||||||
|  | @ -91,9 +94,9 @@ size_flags_vertical = 4 | ||||||
| theme = ExtResource( 1 ) | theme = ExtResource( 1 ) | ||||||
| align = 2 | align = 2 | ||||||
| 
 | 
 | ||||||
| [node name="CameraFXButton" parent="Control/TabContainer/Main Menu/VBoxContainer/HBoxContainer" instance=ExtResource( 6 )] | [node name="CameraFXButton" parent="CanvasLayer/Control/TabContainer/Main Menu/VBoxContainer/HBoxContainer" instance=ExtResource( 6 )] | ||||||
| 
 | 
 | ||||||
| [node name="Levels" type="Tabs" parent="Control/TabContainer"] | [node name="Levels" type="Tabs" parent="CanvasLayer/Control/TabContainer"] | ||||||
| visible = false | visible = false | ||||||
| anchor_right = 1.0 | anchor_right = 1.0 | ||||||
| anchor_bottom = 1.0 | anchor_bottom = 1.0 | ||||||
|  | @ -103,7 +106,7 @@ margin_right = -4.0 | ||||||
| margin_bottom = -4.0 | margin_bottom = -4.0 | ||||||
| theme = ExtResource( 1 ) | theme = ExtResource( 1 ) | ||||||
| 
 | 
 | ||||||
| [node name="HBoxContainer" type="HBoxContainer" parent="Control/TabContainer/Levels"] | [node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/Control/TabContainer/Levels"] | ||||||
| anchor_right = 1.0 | anchor_right = 1.0 | ||||||
| anchor_bottom = 1.0 | anchor_bottom = 1.0 | ||||||
| custom_constants/separation = 4 | custom_constants/separation = 4 | ||||||
|  | @ -111,18 +114,30 @@ __meta__ = { | ||||||
| "_edit_use_anchors_": false | "_edit_use_anchors_": false | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| [node name="LevelList" parent="Control/TabContainer/Levels/HBoxContainer" instance=ExtResource( 2 )] | [node name="LevelList" parent="CanvasLayer/Control/TabContainer/Levels/HBoxContainer" instance=ExtResource( 2 )] | ||||||
| margin_left = 0.0 | margin_left = 0.0 | ||||||
| margin_right = 192.0 | margin_right = 192.0 | ||||||
| 
 | 
 | ||||||
| [node name="LevelInfo" parent="Control/TabContainer/Levels/HBoxContainer" instance=ExtResource( 7 )] | [node name="LevelInfo" parent="CanvasLayer/Control/TabContainer/Levels/HBoxContainer" instance=ExtResource( 7 )] | ||||||
| anchor_right = 0.0 | anchor_right = 0.0 | ||||||
| anchor_bottom = 0.0 | anchor_bottom = 0.0 | ||||||
| margin_left = 196.0 | margin_left = 196.0 | ||||||
| margin_right = 313.0 | margin_right = 313.0 | ||||||
| margin_bottom = 165.0 | margin_bottom = 165.0 | ||||||
| 
 | 
 | ||||||
| [node name="Transition" parent="." instance=ExtResource( 3 )] | [node name="Transition" parent="CanvasLayer" instance=ExtResource( 3 )] | ||||||
| 
 | 
 | ||||||
| [node name="Cannon" parent="." instance=ExtResource( 4 )] | [node name="MainMenuCam" type="Camera2D" parent="."] | ||||||
| visible = false | pause_mode = 2 | ||||||
|  | current = true | ||||||
|  | zoom = Vector2( 0.975, 0.975 ) | ||||||
|  | limit_left = 0 | ||||||
|  | limit_top = 0 | ||||||
|  | limit_right = 384 | ||||||
|  | limit_bottom = 216 | ||||||
|  | limit_smoothed = true | ||||||
|  | smoothing_enabled = true | ||||||
|  | smoothing_speed = 2.4 | ||||||
|  | script = ExtResource( 4 ) | ||||||
|  | 
 | ||||||
|  | [node name="Background" parent="." instance=ExtResource( 14 )] | ||||||
|  |  | ||||||
							
								
								
									
										4
									
								
								Menu/MainMenuCam.gd
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								Menu/MainMenuCam.gd
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,4 @@ | ||||||
|  | extends Camera2D | ||||||
|  | 
 | ||||||
|  | func _process(delta: float) -> void: | ||||||
|  | 	global_position = lerp(global_position, get_global_mouse_position(), 0.05) | ||||||
							
								
								
									
										9
									
								
								Pegs/Yellow/Powerups/PowerupSFX.tscn
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								Pegs/Yellow/Powerups/PowerupSFX.tscn
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,9 @@ | ||||||
|  | [gd_scene load_steps=2 format=2] | ||||||
|  | 
 | ||||||
|  | [ext_resource path="res://SFX/stab.wav" type="AudioStream" id=1] | ||||||
|  | 
 | ||||||
|  | [node name="PowerupSFX" type="AudioStreamPlayer2D"] | ||||||
|  | stream = ExtResource( 1 ) | ||||||
|  | bus = "SFX" | ||||||
|  | 
 | ||||||
|  | [connection signal="finished" from="." to="." method="queue_free"] | ||||||
|  | @ -1,4 +1,17 @@ | ||||||
| extends Sprite | extends Sprite | ||||||
| 
 | 
 | ||||||
| func animate(): | func _ready() -> void: | ||||||
|  | 	$AudioStreamPlayer2D.pitch_scale = rand_range(0.5, 1.5) | ||||||
|  | 
 | ||||||
|  | func animate_hit(): | ||||||
| 	$AnimationPlayer.play("Spring") | 	$AnimationPlayer.play("Spring") | ||||||
|  | 
 | ||||||
|  | func animate_spawn(delay): | ||||||
|  | 		var timer = Timer.new() | ||||||
|  | 		timer.connect("timeout", self, "play_spawn_animation") | ||||||
|  | 		timer.one_shot = true | ||||||
|  | 		add_child(timer) | ||||||
|  | 		timer.start(delay * 0.02) | ||||||
|  | 
 | ||||||
|  | func play_spawn_animation(): | ||||||
|  | 	$AnimationPlayer.play("Spawn") | ||||||
|  |  | ||||||
|  | @ -1,7 +1,39 @@ | ||||||
| [gd_scene load_steps=4 format=2] | [gd_scene load_steps=6 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-Sheet.png" type="Texture" id=1] | ||||||
| [ext_resource path="res://Pegs/Yellow/Powerups/Spring/Spring.gd" type="Script" id=2] | [ext_resource path="res://Pegs/Yellow/Powerups/Spring/Spring.gd" type="Script" id=2] | ||||||
|  | [ext_resource path="res://SFX/popup.wav" type="AudioStream" id=3] | ||||||
|  | 
 | ||||||
|  | [sub_resource type="Animation" id=2] | ||||||
|  | resource_name = "Spawn" | ||||||
|  | length = 0.25 | ||||||
|  | step = 0.025 | ||||||
|  | tracks/0/type = "value" | ||||||
|  | tracks/0/path = NodePath(".:offset") | ||||||
|  | tracks/0/interp = 1 | ||||||
|  | tracks/0/loop_wrap = true | ||||||
|  | tracks/0/imported = false | ||||||
|  | tracks/0/enabled = true | ||||||
|  | tracks/0/keys = { | ||||||
|  | "times": PoolRealArray( 0, 0.25 ), | ||||||
|  | "transitions": PoolRealArray( 1, 1 ), | ||||||
|  | "update": 0, | ||||||
|  | "values": [ Vector2( 0, 32 ), Vector2( 0, 0 ) ] | ||||||
|  | } | ||||||
|  | tracks/1/type = "audio" | ||||||
|  | tracks/1/path = NodePath("AudioStreamPlayer2D") | ||||||
|  | tracks/1/interp = 1 | ||||||
|  | tracks/1/loop_wrap = true | ||||||
|  | tracks/1/imported = false | ||||||
|  | tracks/1/enabled = true | ||||||
|  | tracks/1/keys = { | ||||||
|  | "clips": [ { | ||||||
|  | "end_offset": 0.0, | ||||||
|  | "start_offset": 0.0, | ||||||
|  | "stream": ExtResource( 3 ) | ||||||
|  | } ], | ||||||
|  | "times": PoolRealArray( 0 ) | ||||||
|  | } | ||||||
| 
 | 
 | ||||||
| [sub_resource type="Animation" id=1] | [sub_resource type="Animation" id=1] | ||||||
| resource_name = "Spring" | resource_name = "Spring" | ||||||
|  | @ -22,9 +54,15 @@ tracks/0/keys = { | ||||||
| [node name="Sprite" type="Sprite"] | [node name="Sprite" type="Sprite"] | ||||||
| texture = ExtResource( 1 ) | texture = ExtResource( 1 ) | ||||||
| centered = false | centered = false | ||||||
|  | offset = Vector2( 0, 32 ) | ||||||
| hframes = 9 | hframes = 9 | ||||||
| region_rect = Rect2( 0, 0, 32, 32 ) | region_rect = Rect2( 0, 0, 32, 32 ) | ||||||
| script = ExtResource( 2 ) | script = ExtResource( 2 ) | ||||||
| 
 | 
 | ||||||
| [node name="AnimationPlayer" type="AnimationPlayer" parent="."] | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] | ||||||
|  | anims/Spawn = SubResource( 2 ) | ||||||
| anims/Spring = SubResource( 1 ) | anims/Spring = SubResource( 1 ) | ||||||
|  | 
 | ||||||
|  | [node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."] | ||||||
|  | stream = ExtResource( 3 ) | ||||||
|  | bus = "SFX" | ||||||
|  |  | ||||||
							
								
								
									
										7
									
								
								Pegs/Yellow/Powerups/Spring/SpringSFX.tscn
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								Pegs/Yellow/Powerups/Spring/SpringSFX.tscn
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,7 @@ | ||||||
|  | [gd_scene load_steps=2 format=2] | ||||||
|  | 
 | ||||||
|  | [ext_resource path="res://SFX/bounce.wav" type="AudioStream" id=1] | ||||||
|  | 
 | ||||||
|  | [node name="BounceSFX" type="AudioStreamPlayer"] | ||||||
|  | stream = ExtResource( 1 ) | ||||||
|  | bus = "SFX" | ||||||
|  | @ -1,16 +1,37 @@ | ||||||
| extends StaticBody2D | extends StaticBody2D | ||||||
| 
 | 
 | ||||||
| func _ready() -> void: | func _ready() -> void: | ||||||
|  | 	if GameStats.powerup_active: | ||||||
|  | 		queue_free() | ||||||
|  | 	else: GameStats.powerup_active = true | ||||||
| 	position = Vector2(0, 184) | 	position = Vector2(0, 184) | ||||||
| 	 | 	 | ||||||
|  | 	# spawn all the springs with some delays | ||||||
|  | 	var counter = 0 | ||||||
|  | 	for child in get_children(): | ||||||
|  | 		if child.has_method("animate_spawn"): | ||||||
|  | 			counter += 1 | ||||||
|  | 			child.animate_spawn(rand_range(1, counter)) | ||||||
|  | 
 | ||||||
| func explode(): | func explode(): | ||||||
| 	queue_free() | 	queue_free() | ||||||
|  | 	Engine.time_scale = 1 | ||||||
|  | 	GameStats.powerup_active = false | ||||||
| 
 | 
 | ||||||
| func make_green(): | func make_green(): | ||||||
| 	for child in get_children(): | 	for child in get_children(): | ||||||
| 		if child.has_method("animate"): | 		if child.has_method("animate_hit"): | ||||||
| 			child.animate() | 			child.animate_hit() | ||||||
| 	$DeathTimer.start() | 	$DeathTimer.start() | ||||||
| 	 | 	 | ||||||
|  | 	var SFX = preload("res://Pegs/Yellow/Powerups/Spring/SpringSFX.tscn") | ||||||
|  | 	var main = get_tree().current_scene | ||||||
|  | 	var sfx = SFX.instance() | ||||||
|  | 	main.add_child(sfx) | ||||||
|  | 	sfx.play(0.0) | ||||||
|  | 	 | ||||||
|  | 	if GameStats.camera_fx: | ||||||
|  | 		Engine.time_scale = 0.25 | ||||||
|  | 
 | ||||||
| func spring(): | func spring(): | ||||||
| 	pass | 	pass | ||||||
|  |  | ||||||
|  | @ -1,15 +1,19 @@ | ||||||
| [gd_scene load_steps=4 format=2] | [gd_scene load_steps=5 format=2] | ||||||
| 
 | 
 | ||||||
| [ext_resource path="res://Pegs/Yellow/Powerups/Spring/Spring.tscn" type="PackedScene" id=1] | [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] | [ext_resource path="res://Pegs/Yellow/Powerups/Spring/Springs.gd" type="Script" id=2] | ||||||
| 
 | 
 | ||||||
| [sub_resource type="RectangleShape2D" id=1] | [sub_resource type="PhysicsMaterial" id=1] | ||||||
|  | bounce = 1.0 | ||||||
|  | 
 | ||||||
|  | [sub_resource type="RectangleShape2D" id=2] | ||||||
| extents = Vector2( 192, 16 ) | extents = Vector2( 192, 16 ) | ||||||
| 
 | 
 | ||||||
| [node name="Springs" type="StaticBody2D"] | [node name="Springs" type="StaticBody2D"] | ||||||
| z_index = -24 | z_index = -24 | ||||||
| collision_layer = 8 | collision_layer = 8 | ||||||
| collision_mask = 0 | collision_mask = 0 | ||||||
|  | physics_material_override = SubResource( 1 ) | ||||||
| script = ExtResource( 2 ) | script = ExtResource( 2 ) | ||||||
| 
 | 
 | ||||||
| [node name="Spring" parent="." instance=ExtResource( 1 )] | [node name="Spring" parent="." instance=ExtResource( 1 )] | ||||||
|  | @ -49,10 +53,10 @@ position = Vector2( 352, 0 ) | ||||||
| 
 | 
 | ||||||
| [node name="CollisionShape2D2" type="CollisionShape2D" parent="."] | [node name="CollisionShape2D2" type="CollisionShape2D" parent="."] | ||||||
| position = Vector2( 192, 16 ) | position = Vector2( 192, 16 ) | ||||||
| shape = SubResource( 1 ) | shape = SubResource( 2 ) | ||||||
| 
 | 
 | ||||||
| [node name="DeathTimer" type="Timer" parent="."] | [node name="DeathTimer" type="Timer" parent="."] | ||||||
| wait_time = 0.24 | wait_time = 0.1 | ||||||
| one_shot = true | one_shot = true | ||||||
| 
 | 
 | ||||||
| [connection signal="timeout" from="DeathTimer" to="." method="explode"] | [connection signal="timeout" from="DeathTimer" to="." method="explode"] | ||||||
|  |  | ||||||
|  | @ -23,6 +23,15 @@ func make_green(): | ||||||
| 	 | 	 | ||||||
| 	powerup.global_position = global_position | 	powerup.global_position = global_position | ||||||
| 	 | 	 | ||||||
|  | 	# has to run before adding powerup as child  | ||||||
|  | 	# because adding the powerup changes powerup_active to true | ||||||
|  | 	if !GameStats.powerup_active: | ||||||
|  | 		var SFX = preload("res://Pegs/Yellow/Powerups/PowerupSFX.tscn") | ||||||
|  | 		var sfx = SFX.instance() | ||||||
|  | 		main.add_child(sfx) | ||||||
|  | 		sfx.global_position = global_position | ||||||
|  | 		sfx.play(0) | ||||||
|  | 	 | ||||||
| 	main.add_child(powerup) | 	main.add_child(powerup) | ||||||
| 	 | 	 | ||||||
| 	#finally delete the old peg | 	#finally delete the old peg | ||||||
|  |  | ||||||
							
								
								
									
										
											BIN
										
									
								
								SFX/bounce.wav
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								SFX/bounce.wav
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										21
									
								
								SFX/bounce.wav.import
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								SFX/bounce.wav.import
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,21 @@ | ||||||
|  | [remap] | ||||||
|  | 
 | ||||||
|  | importer="wav" | ||||||
|  | type="AudioStreamSample" | ||||||
|  | path="res://.import/bounce.wav-47078fe0d68ca69236bb0ffae2794bc9.sample" | ||||||
|  | 
 | ||||||
|  | [deps] | ||||||
|  | 
 | ||||||
|  | source_file="res://SFX/bounce.wav" | ||||||
|  | dest_files=[ "res://.import/bounce.wav-47078fe0d68ca69236bb0ffae2794bc9.sample" ] | ||||||
|  | 
 | ||||||
|  | [params] | ||||||
|  | 
 | ||||||
|  | force/8_bit=false | ||||||
|  | force/mono=false | ||||||
|  | force/max_rate=false | ||||||
|  | force/max_rate_hz=44100 | ||||||
|  | edit/trim=false | ||||||
|  | edit/normalize=false | ||||||
|  | edit/loop=false | ||||||
|  | compress/mode=0 | ||||||
							
								
								
									
										
											BIN
										
									
								
								SFX/popup.wav
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								SFX/popup.wav
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										21
									
								
								SFX/popup.wav.import
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								SFX/popup.wav.import
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,21 @@ | ||||||
|  | [remap] | ||||||
|  | 
 | ||||||
|  | importer="wav" | ||||||
|  | type="AudioStreamSample" | ||||||
|  | path="res://.import/popup.wav-2e0856004658cfec43b137fce4a3ec7a.sample" | ||||||
|  | 
 | ||||||
|  | [deps] | ||||||
|  | 
 | ||||||
|  | source_file="res://SFX/popup.wav" | ||||||
|  | dest_files=[ "res://.import/popup.wav-2e0856004658cfec43b137fce4a3ec7a.sample" ] | ||||||
|  | 
 | ||||||
|  | [params] | ||||||
|  | 
 | ||||||
|  | force/8_bit=false | ||||||
|  | force/mono=false | ||||||
|  | force/max_rate=false | ||||||
|  | force/max_rate_hz=44100 | ||||||
|  | edit/trim=false | ||||||
|  | edit/normalize=false | ||||||
|  | edit/loop=false | ||||||
|  | compress/mode=0 | ||||||
|  | @ -3,6 +3,6 @@ extends Camera2D | ||||||
| 
 | 
 | ||||||
| func _process(_delta): | func _process(_delta): | ||||||
| 	if GameStats.camera_fx: | 	if GameStats.camera_fx: | ||||||
| 		var zoomlevel = clamp(Engine.time_scale, 0.5, 0.975) | 		var zoomlevel = clamp(Engine.time_scale, 0.65, 0.975) | ||||||
| 		zoom = lerp(zoom, Vector2(zoomlevel, zoomlevel), smoothing_speed / 200) | 		zoom = lerp(zoom, Vector2(zoomlevel, zoomlevel), smoothing_speed / 200) | ||||||
| 	else: zoom = Vector2(1, 1) | 	else: zoom = Vector2(1, 1) | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| [gd_scene load_steps=28 format=2] | [gd_scene load_steps=27 format=2] | ||||||
| 
 | 
 | ||||||
| [ext_resource path="res://Cannon/Cannon.tscn" type="PackedScene" id=1] | [ext_resource path="res://Cannon/Cannon.tscn" type="PackedScene" id=1] | ||||||
| [ext_resource path="res://Borders/tileset.png" type="Texture" id=2] | [ext_resource path="res://Borders/tileset.png" type="Texture" id=2] | ||||||
|  | @ -11,8 +11,7 @@ | ||||||
| [ext_resource path="res://Stages/Camera.gd" type="Script" id=9] | [ext_resource path="res://Stages/Camera.gd" type="Script" id=9] | ||||||
| [ext_resource path="res://Stages/World.gd" type="Script" id=10] | [ext_resource path="res://Stages/World.gd" type="Script" id=10] | ||||||
| [ext_resource path="res://Effects/FadeIn.tscn" type="PackedScene" id=11] | [ext_resource path="res://Effects/FadeIn.tscn" type="PackedScene" id=11] | ||||||
| [ext_resource path="res://Stages/Background.png" type="Texture" id=12] | [ext_resource path="res://Effects/Background.tscn" type="PackedScene" id=12] | ||||||
| [ext_resource path="res://Pegs/Purple/PurpleBar.tscn" type="PackedScene" id=13] |  | ||||||
| [ext_resource path="res://Menu/Pause.tscn" type="PackedScene" id=14] | [ext_resource path="res://Menu/Pause.tscn" type="PackedScene" id=14] | ||||||
| [ext_resource path="res://Pegs/Yellow/PowerupCards.tscn" type="PackedScene" id=15] | [ext_resource path="res://Pegs/Yellow/PowerupCards.tscn" type="PackedScene" id=15] | ||||||
| 
 | 
 | ||||||
|  | @ -163,16 +162,7 @@ script = ExtResource( 10 ) | ||||||
| light_mask = 0 | light_mask = 0 | ||||||
| z_index = 20 | z_index = 20 | ||||||
| 
 | 
 | ||||||
| [node name="ParallaxBackground" type="ParallaxBackground" parent="Decoration"] | [node name="Background" parent="Decoration" instance=ExtResource( 12 )] | ||||||
| 
 |  | ||||||
| [node name="ParallaxLayer" type="ParallaxLayer" parent="Decoration/ParallaxBackground"] |  | ||||||
| motion_scale = Vector2( 0.5, 0.5 ) |  | ||||||
| 
 |  | ||||||
| [node name="Background" type="Sprite" parent="Decoration/ParallaxBackground/ParallaxLayer"] |  | ||||||
| z_index = -200 |  | ||||||
| texture = ExtResource( 12 ) |  | ||||||
| region_enabled = true |  | ||||||
| region_rect = Rect2( 0, 0, 768, 432 ) |  | ||||||
| 
 | 
 | ||||||
| [node name="TileMap" type="TileMap" parent="."] | [node name="TileMap" type="TileMap" parent="."] | ||||||
| tile_set = SubResource( 10 ) | tile_set = SubResource( 10 ) | ||||||
|  | @ -234,6 +224,27 @@ position = Vector2( 0, 248 ) | ||||||
| [node name="PinkPeg" parent="Pegs" instance=ExtResource( 8 )] | [node name="PinkPeg" parent="Pegs" instance=ExtResource( 8 )] | ||||||
| position = Vector2( 190, 72 ) | position = Vector2( 190, 72 ) | ||||||
| 
 | 
 | ||||||
|  | [node name="YellowPeg" parent="Pegs" instance=ExtResource( 4 )] | ||||||
|  | position = Vector2( 136, 101 ) | ||||||
|  | 
 | ||||||
|  | [node name="YellowPeg3" parent="Pegs" instance=ExtResource( 4 )] | ||||||
|  | position = Vector2( 149, 112 ) | ||||||
|  | 
 | ||||||
|  | [node name="YellowPeg4" parent="Pegs" instance=ExtResource( 4 )] | ||||||
|  | position = Vector2( 164, 131 ) | ||||||
|  | 
 | ||||||
|  | [node name="YellowPeg5" parent="Pegs" instance=ExtResource( 4 )] | ||||||
|  | position = Vector2( 189, 121 ) | ||||||
|  | 
 | ||||||
|  | [node name="YellowPeg6" parent="Pegs" instance=ExtResource( 4 )] | ||||||
|  | position = Vector2( 204, 111 ) | ||||||
|  | 
 | ||||||
|  | [node name="YellowPeg7" parent="Pegs" instance=ExtResource( 4 )] | ||||||
|  | position = Vector2( 212, 126 ) | ||||||
|  | 
 | ||||||
|  | [node name="YellowPeg2" parent="Pegs" instance=ExtResource( 4 )] | ||||||
|  | position = Vector2( 163, 115 ) | ||||||
|  | 
 | ||||||
| [node name="Bucket" parent="." instance=ExtResource( 6 )] | [node name="Bucket" parent="." instance=ExtResource( 6 )] | ||||||
| position = Vector2( 192, 209 ) | position = Vector2( 192, 209 ) | ||||||
| 
 | 
 | ||||||
|  | @ -241,24 +252,6 @@ position = Vector2( 192, 209 ) | ||||||
| 
 | 
 | ||||||
| [node name="Pause" parent="." instance=ExtResource( 14 )] | [node name="Pause" parent="." instance=ExtResource( 14 )] | ||||||
| 
 | 
 | ||||||
| [node name="YellowPeg" parent="." instance=ExtResource( 4 )] |  | ||||||
| position = Vector2( 152, 38 ) |  | ||||||
| 
 |  | ||||||
| [node name="PurpleBar" parent="." instance=ExtResource( 13 )] |  | ||||||
| position = Vector2( 70, 100 ) |  | ||||||
| 
 |  | ||||||
| [node name="PurpleBar2" parent="." instance=ExtResource( 13 )] |  | ||||||
| position = Vector2( 123, 134 ) |  | ||||||
| 
 |  | ||||||
| [node name="PurpleBar3" parent="." instance=ExtResource( 13 )] |  | ||||||
| position = Vector2( 62, 154 ) |  | ||||||
| 
 |  | ||||||
| [node name="PurpleBar4" parent="." instance=ExtResource( 13 )] |  | ||||||
| position = Vector2( 30, 124 ) |  | ||||||
| 
 |  | ||||||
| [node name="PowerupCards" parent="." instance=ExtResource( 15 )] | [node name="PowerupCards" parent="." instance=ExtResource( 15 )] | ||||||
| 
 | 
 | ||||||
| [node name="YellowPeg2" parent="." instance=ExtResource( 4 )] |  | ||||||
| position = Vector2( 298, 53 ) |  | ||||||
| 
 |  | ||||||
| [editable path="Ball"] | [editable path="Ball"] | ||||||
|  |  | ||||||
|  | @ -17,9 +17,12 @@ var score = 0 | ||||||
| var camera_fx = true | var camera_fx = true | ||||||
| var bonus_points = 0 | var bonus_points = 0 | ||||||
| var best_combo = 1 | var best_combo = 1 | ||||||
|  | # is here to prevent multiple powerups from spawning  | ||||||
|  | # if only one of them should be there | ||||||
| var powerup_screen_active = false | var powerup_screen_active = false | ||||||
| var current_powerup = "res://Pegs/Yellow/Powerups/Scattershot/Scattershot.tscn" | var current_powerup = "res://Pegs/Yellow/Powerups/Scattershot/Scattershot.tscn" | ||||||
| var stage_powerup = "res://Pegs/Yellow/PowerupCards/Scattershot.tscn" | var stage_powerup = "res://Pegs/Yellow/PowerupCards/Scattershot.tscn" | ||||||
|  | var powerup_active = false | ||||||
| 
 | 
 | ||||||
| func add_balls(balls): | func add_balls(balls): | ||||||
| 	balls_left += balls | 	balls_left += balls | ||||||
|  |  | ||||||
|  | @ -14,7 +14,7 @@ script_encryption_key="" | ||||||
| [preset.0.options] | [preset.0.options] | ||||||
| 
 | 
 | ||||||
| custom_template/debug="" | custom_template/debug="" | ||||||
| custom_template/release="" | custom_template/release="/mnt/296a894f-4ca1-4eb8-8a77-9940196b59c9/Nextcloud/Documents/Code/Godot/pegchampBuild/pegchamp.x86_64" | ||||||
| binary_format/64_bits=true | binary_format/64_bits=true | ||||||
| binary_format/embed_pck=true | binary_format/embed_pck=true | ||||||
| texture_format/bptc=false | texture_format/bptc=false | ||||||
|  |  | ||||||
|  | @ -1,104 +0,0 @@ | ||||||
| ; Engine configuration file. |  | ||||||
| ; It's best edited using the editor UI and not directly, |  | ||||||
| ; since the parameters that go here are not all obvious. |  | ||||||
| ; |  | ||||||
| ; Format: |  | ||||||
| ;   [section] ; section goes between [] |  | ||||||
| ;   param=value ; assign values to parameters |  | ||||||
| 
 |  | ||||||
| config_version=4 |  | ||||||
| 
 |  | ||||||
| [application] |  | ||||||
| 
 |  | ||||||
| config/name="pegchamp" |  | ||||||
| run/main_scene="res://Menu/MainMenu.tscn" |  | ||||||
| boot_splash/image="res://icon.png" |  | ||||||
| boot_splash/fullsize=false |  | ||||||
| boot_splash/use_filter=false |  | ||||||
| boot_splash/bg_color=Color( 0.847059, 0.74902, 0.847059, 1 ) |  | ||||||
| config/icon="res://icon.png" |  | ||||||
| 
 |  | ||||||
| [autoload] |  | ||||||
| 
 |  | ||||||
| GameStats="*res://Stats/GameStats.gd" |  | ||||||
| Music="*res://Music/Music.tscn" |  | ||||||
| Saves="*res://Stats/Saves.gd" |  | ||||||
| 
 |  | ||||||
| [debug] |  | ||||||
| 
 |  | ||||||
| gdscript/completion/autocomplete_setters_and_getters=true |  | ||||||
| 
 |  | ||||||
| [display] |  | ||||||
| 
 |  | ||||||
| window/size/width=384 |  | ||||||
| window/size/height=216 |  | ||||||
| window/size/test_width=1280 |  | ||||||
| window/size/test_height=720 |  | ||||||
| mouse_cursor/custom_image="res://icon.png" |  | ||||||
| window/stretch/mode="2d" |  | ||||||
| window/stretch/aspect="keep" |  | ||||||
| 
 |  | ||||||
| [global] |  | ||||||
| 
 |  | ||||||
| touch=false |  | ||||||
| 
 |  | ||||||
| [importer_defaults] |  | ||||||
| 
 |  | ||||||
| texture={ |  | ||||||
| "compress/bptc_ldr": 0, |  | ||||||
| "compress/hdr_mode": 0, |  | ||||||
| "compress/lossy_quality": 0.7, |  | ||||||
| "compress/mode": 0, |  | ||||||
| "compress/normal_map": 0, |  | ||||||
| "detect_3d": false, |  | ||||||
| "flags/anisotropic": false, |  | ||||||
| "flags/filter": false, |  | ||||||
| "flags/mipmaps": false, |  | ||||||
| "flags/repeat": 0, |  | ||||||
| "flags/srgb": 2, |  | ||||||
| "process/HDR_as_SRGB": false, |  | ||||||
| "process/fix_alpha_border": true, |  | ||||||
| "process/invert_color": false, |  | ||||||
| "process/premult_alpha": false, |  | ||||||
| "size_limit": 0, |  | ||||||
| "stream": false, |  | ||||||
| "svg/scale": 1.0 |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| [input] |  | ||||||
| 
 |  | ||||||
| shoot={ |  | ||||||
| "deadzone": 0.5, |  | ||||||
| "events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null) |  | ||||||
|  ] |  | ||||||
| } |  | ||||||
| fast_forward={ |  | ||||||
| "deadzone": 0.5, |  | ||||||
| "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null) |  | ||||||
| , Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null) |  | ||||||
|  ] |  | ||||||
| } |  | ||||||
| pause={ |  | ||||||
| "deadzone": 0.5, |  | ||||||
| "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) |  | ||||||
|  ] |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| [input_devices] |  | ||||||
| 
 |  | ||||||
| pointing/emulate_touch_from_mouse=true |  | ||||||
| 
 |  | ||||||
| [layer_names] |  | ||||||
| 
 |  | ||||||
| 2d_physics/layer_1="World" |  | ||||||
| 2d_physics/layer_2="Zones" |  | ||||||
| 2d_physics/layer_3="BallDetection" |  | ||||||
| 
 |  | ||||||
| [physics] |  | ||||||
| 
 |  | ||||||
| common/enable_pause_aware_picking=true |  | ||||||
| 
 |  | ||||||
| [rendering] |  | ||||||
| 
 |  | ||||||
| environment/default_clear_color=Color( 0.847059, 0.74902, 0.847059, 1 ) |  | ||||||
| environment/default_environment="res://default_env.tres" |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue