소스 검색

Match the old ball-loss effect and antialias shapes

The ball-loss burst now recreates cocos2d-x's ParticleSun preset (350
soft additive particles per second for one second, fading from dark
orange to black) as its own scene, replacing the burst of small squares.

All shape drawing is now antialiased so edges stay smooth on
high-resolution screens. Also adds the .import and .uid files Godot
generates, which belong in version control.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gabriel Capella 5 일 전
부모
커밋
bc47ff16ef

+ 36 - 0
godot/assets/fonts/abel.ttf.import

@@ -0,0 +1,36 @@
+[remap]
+
+importer="font_data_dynamic"
+type="FontFile"
+uid="uid://b00qbnp6qa41u"
+path="res://.godot/imported/abel.ttf-2b56058b48b7c3738453622017e7ac26.fontdata"
+
+[deps]
+
+source_file="res://assets/fonts/abel.ttf"
+dest_files=["res://.godot/imported/abel.ttf-2b56058b48b7c3738453622017e7ac26.fontdata"]
+
+[params]
+
+Rendering=null
+antialiasing=1
+generate_mipmaps=false
+disable_embedded_bitmaps=true
+multichannel_signed_distance_field=false
+msdf_pixel_range=8
+msdf_size=48
+allow_system_fallback=true
+force_autohinter=false
+modulate_color_glyphs=false
+hinting=3
+subpixel_positioning=4
+keep_rounding_remainders=true
+oversampling=0.0
+Fallbacks=null
+fallbacks=[]
+Compress=null
+compress=true
+preload=[]
+language_support={}
+script_support={}
+opentype_features={}

+ 24 - 0
godot/assets/sounds/bomb.wav.import

@@ -0,0 +1,24 @@
+[remap]
+
+importer="wav"
+type="AudioStreamWAV"
+uid="uid://2t7pekdlj5qq"
+path="res://.godot/imported/bomb.wav-8f9692c37aa1e90e016a601bd828bf39.sample"
+
+[deps]
+
+source_file="res://assets/sounds/bomb.wav"
+dest_files=["res://.godot/imported/bomb.wav-8f9692c37aa1e90e016a601bd828bf39.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_mode=0
+edit/loop_begin=0
+edit/loop_end=-1
+compress/mode=2

+ 24 - 0
godot/assets/sounds/metal.wav.import

@@ -0,0 +1,24 @@
+[remap]
+
+importer="wav"
+type="AudioStreamWAV"
+uid="uid://cdiwlmalflr22"
+path="res://.godot/imported/metal.wav-164c13e8bb6415f8fae1d1e996dcafc4.sample"
+
+[deps]
+
+source_file="res://assets/sounds/metal.wav"
+dest_files=["res://.godot/imported/metal.wav-164c13e8bb6415f8fae1d1e996dcafc4.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_mode=0
+edit/loop_begin=0
+edit/loop_end=-1
+compress/mode=2

+ 24 - 0
godot/assets/sounds/pipe.wav.import

@@ -0,0 +1,24 @@
+[remap]
+
+importer="wav"
+type="AudioStreamWAV"
+uid="uid://dd30nm4mt3eo5"
+path="res://.godot/imported/pipe.wav-e983c73a9f8d8fb5de2e2e9aa154ce96.sample"
+
+[deps]
+
+source_file="res://assets/sounds/pipe.wav"
+dest_files=["res://.godot/imported/pipe.wav-e983c73a9f8d8fb5de2e2e9aa154ce96.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_mode=0
+edit/loop_begin=0
+edit/loop_end=-1
+compress/mode=2

+ 24 - 0
godot/assets/sounds/win.wav.import

@@ -0,0 +1,24 @@
+[remap]
+
+importer="wav"
+type="AudioStreamWAV"
+uid="uid://dx3m2nukdya5i"
+path="res://.godot/imported/win.wav-6ce9b27206398df6844005a9f67bf690.sample"
+
+[deps]
+
+source_file="res://assets/sounds/win.wav"
+dest_files=["res://.godot/imported/win.wav-6ce9b27206398df6844005a9f67bf690.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_mode=0
+edit/loop_begin=0
+edit/loop_end=-1
+compress/mode=2

+ 35 - 0
godot/scenes/sun_burst.tscn

@@ -0,0 +1,35 @@
+[gd_scene format=3]
+
+[ext_resource type="Script" path="res://scripts/sun_burst.gd" id="1_sun_burst"]
+
+[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_additive"]
+blend_mode = 1
+
+[sub_resource type="Gradient" id="Gradient_glow"]
+colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0)
+
+[sub_resource type="GradientTexture2D" id="GradientTexture2D_glow"]
+gradient = SubResource("Gradient_glow")
+width = 128
+height = 128
+fill = 1
+fill_from = Vector2(0.5, 0.5)
+fill_to = Vector2(0.5, 0)
+
+[sub_resource type="Gradient" id="Gradient_fade"]
+colors = PackedColorArray(0.76, 0.25, 0.12, 1, 0, 0, 0, 1)
+
+[node name="SunBurst" type="CPUParticles2D"]
+material = SubResource("CanvasItemMaterial_additive")
+amount = 525
+lifetime = 1.5
+lifetime_randomness = 0.67
+texture = SubResource("GradientTexture2D_glow")
+spread = 180.0
+gravity = Vector2(0, 0)
+initial_velocity_min = 15.0
+initial_velocity_max = 25.0
+scale_amount_min = 0.156
+scale_amount_max = 0.3125
+color_ramp = SubResource("Gradient_fade")
+script = ExtResource("1_sun_burst")

+ 1 - 1
godot/scripts/ball.gd

@@ -49,4 +49,4 @@ func _kick_power_ups() -> void:
 
 
 func _draw() -> void:
-	draw_circle(Vector2.ZERO, Params.BALL_RADIUS, Params.COLOR_ORANGE if superball else Params.COLOR_GREY)
+	draw_circle(Vector2.ZERO, Params.BALL_RADIUS, Params.COLOR_ORANGE if superball else Params.COLOR_GREY, true, -1.0, true)

+ 1 - 0
godot/scripts/ball.gd.uid

@@ -0,0 +1 @@
+uid://btyp8uclyerh6

+ 4 - 0
godot/scripts/block.gd

@@ -41,6 +41,10 @@ func destroy() -> void:
 
 func _draw() -> void:
 	draw_colored_polygon(_polygon, color)
+	# Polygons have no antialiasing of their own; a smooth outline softens the edge.
+	var outline := _polygon.duplicate()
+	outline.append(_polygon[0])
+	draw_polyline(outline, color, 1.0, true)
 
 
 static func _arc(radius: float, from: float, to: float, steps: int) -> PackedVector2Array:

+ 1 - 0
godot/scripts/block.gd.uid

@@ -0,0 +1 @@
+uid://cxsmtkgbq265l

+ 1 - 0
godot/scripts/blocks.gd.uid

@@ -0,0 +1 @@
+uid://dpna7iddpp41q

+ 1 - 1
godot/scripts/core.gd

@@ -24,4 +24,4 @@ func explode() -> void:
 
 
 func _draw() -> void:
-	draw_circle(Vector2.ZERO, radius, Params.COLOR_RED)
+	draw_circle(Vector2.ZERO, radius, Params.COLOR_RED, true, -1.0, true)

+ 1 - 0
godot/scripts/core.gd.uid

@@ -0,0 +1 @@
+uid://k7402hmxkbbg

+ 4 - 20
godot/scripts/game.gd

@@ -3,6 +3,7 @@ extends Node2D
 
 const BALL_SCENE := preload("res://scenes/ball.tscn")
 const POWER_UP_SCENE := preload("res://scenes/power_up.tscn")
+const SUN_BURST_SCENE := preload("res://scenes/sun_burst.tscn")
 
 var level := 0
 ## Set once the level is won or lost; stops power-up drops and collision handling.
@@ -199,27 +200,10 @@ func _alert(text: String) -> void:
 	tween.tween_callback(label.queue_free)
 
 
-## A short orange flash where a ball fell out.
 func _burst(at: Vector2) -> void:
-	var particles := CPUParticles2D.new()
-	particles.position = at
-	particles.one_shot = true
-	particles.amount = 80
-	particles.lifetime = 1.0
-	particles.explosiveness = 0.9
-	particles.spread = 180.0
-	particles.gravity = Vector2.ZERO
-	particles.initial_velocity_min = 40.0
-	particles.initial_velocity_max = 160.0
-	particles.scale_amount_min = 3.0
-	particles.scale_amount_max = 6.0
-	var ramp := Gradient.new()
-	ramp.set_color(0, Color(1.0, 0.85, 0.3))
-	ramp.set_color(1, Color(1.0, 0.3, 0.0, 0.0))
-	particles.color_ramp = ramp
-	particles.finished.connect(particles.queue_free)
-	add_child(particles)
-	particles.emitting = true
+	var burst: CPUParticles2D = SUN_BURST_SCENE.instantiate()
+	burst.position = at
+	add_child(burst)
 
 
 func _now() -> float:

+ 1 - 0
godot/scripts/game.gd.uid

@@ -0,0 +1 @@
+uid://sggph2rbbqp4

+ 3 - 3
godot/scripts/paddle.gd

@@ -65,6 +65,6 @@ func _move_to(x: float) -> void:
 func _draw() -> void:
 	var half: float = Params.PADDLE_WIDTH / 2.0 * SCALE[width]
 	var cap := Params.PADDLE_HEIGHT / 2.0
-	draw_line(Vector2(-half, 0), Vector2(half, 0), Params.COLOR_GREY, Params.PADDLE_HEIGHT)
-	draw_circle(Vector2(-half, 0), cap, Params.COLOR_GREY)
-	draw_circle(Vector2(half, 0), cap, Params.COLOR_GREY)
+	draw_line(Vector2(-half, 0), Vector2(half, 0), Params.COLOR_GREY, Params.PADDLE_HEIGHT, true)
+	draw_circle(Vector2(-half, 0), cap, Params.COLOR_GREY, true, -1.0, true)
+	draw_circle(Vector2(half, 0), cap, Params.COLOR_GREY, true, -1.0, true)

+ 1 - 0
godot/scripts/paddle.gd.uid

@@ -0,0 +1 @@
+uid://cultsrsvyfkm

+ 1 - 0
godot/scripts/params.gd.uid

@@ -0,0 +1 @@
+uid://qqdnfxcbqa8l

+ 1 - 1
godot/scripts/power_up.gd

@@ -31,4 +31,4 @@ func _on_body_entered(body: Node) -> void:
 
 
 func _draw() -> void:
-	draw_circle(Vector2.ZERO, RADIUS, COLORS[kind])
+	draw_circle(Vector2.ZERO, RADIUS, COLORS[kind], true, -1.0, true)

+ 1 - 0
godot/scripts/power_up.gd.uid

@@ -0,0 +1 @@
+uid://s478hbeynfbe

+ 1 - 0
godot/scripts/progress.gd.uid

@@ -0,0 +1 @@
+uid://m5i4glunijun

+ 11 - 0
godot/scripts/sun_burst.gd

@@ -0,0 +1,11 @@
+extends CPUParticles2D
+## The cocos2d-x ParticleSun preset used when a ball falls out: 350 soft additive particles
+## per second for one second, drifting slowly outwards and fading from dark orange to black.
+## The amount/lifetime pair in the scene gives that rate with lifetimes of 0.5 to 1.5 s.
+
+const DURATION := 1.0
+
+
+func _ready() -> void:
+	get_tree().create_timer(DURATION).timeout.connect(set_emitting.bind(false))
+	get_tree().create_timer(DURATION + lifetime).timeout.connect(queue_free)

+ 1 - 0
godot/scripts/sun_burst.gd.uid

@@ -0,0 +1 @@
+uid://b25ljdoy6y5sl

+ 1 - 0
godot/scripts/title.gd.uid

@@ -0,0 +1 @@
+uid://dyidyud64wj3u

+ 1 - 0
godot/scripts/walls.gd.uid

@@ -0,0 +1 @@
+uid://ep6k8qdkf5df