Skip to content

Commit 9273ea4

Browse files
committed
Melhora das Particulas
Melhoradas
1 parent 48d314f commit 9273ea4

File tree

9 files changed

+57
-37
lines changed

9 files changed

+57
-37
lines changed

ballpart.png

3.16 KB
Loading

ballpart.psd

57.8 KB
Binary file not shown.

godot/ballpart.tex

1.09 KB
Binary file not shown.

godot/blue.tres

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[gd_resource type="ColorRamp" format=1]
2+
3+
[resource]
4+
5+
offsets = FloatArray( 0, 1 )
6+
colors = ColorArray( 0, 1, 0.976562, 1, 0, 0, 0, 1 )
7+

godot/explosion.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func setPart(i,n,u):
1919
else:
2020
xy = 270
2121
self.set_param(0, xy)
22-
self.set_param(2,u*10)
22+
self.set_param(2,u*15)
2323

2424
func _on_Timer_timeout():
2525
self.queue_free()

godot/explosion.tscn

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
[gd_scene load_steps=3 format=1]
1+
[gd_scene load_steps=4 format=1]
22

3-
[ext_resource path="res://explosion.gd" type="Script" id=1]
3+
[ext_resource path="res://ballpart.tex" type="Texture" id=1]
4+
[ext_resource path="res://explosion.gd" type="Script" id=2]
45

56
[sub_resource type="ColorRamp" id=1]
67

7-
offsets = FloatArray( 0, 0.450292, 0.923977 )
8-
colors = ColorArray( 0, 0, 0, 1, 1, 1, 1, 1, 0.996094, 0.940282, 0.575867, 1 )
8+
offsets = FloatArray( 0, 0.192982, 1 )
9+
colors = ColorArray( 1, 1, 1, 1, 0.984466, 0.992188, 0.00387573, 1, 0, 0, 0, 1 )
910

1011
[node name="Particles2D" type="Particles2D"]
1112

@@ -16,6 +17,7 @@ config/preprocess = 1.0
1617
config/process_mode = 1
1718
config/local_space = false
1819
config/explosiveness = 0.0
20+
config/texture = ExtResource( 1 )
1921
params/direction = 0.0
2022
params/spread = 90.0
2123
params/linear_velocity = 200.0
@@ -25,18 +27,16 @@ params/gravity_direction = 0.0
2527
params/gravity_strength = 0.0
2628
params/radial_accel = 0.0
2729
params/tangential_accel = 0.0
28-
params/damping = 900.0
30+
params/damping = 500.0
2931
params/initial_angle = 0.0
30-
params/initial_size = 2.0
32+
params/initial_size = 0.02
3133
params/final_size = 0.0
3234
params/hue_variation = 0.0
3335
params/anim_speed_scale = 1.0
3436
params/anim_initial_pos = 0.0
35-
randomness/spread = 100.0
36-
randomness/linear_velocity = 1.0
37-
randomness/initial_size = 1.0
37+
randomness/damping = 1.0
3838
color/color_ramp = SubResource( 1 )
39-
script/script = ExtResource( 1 )
39+
script/script = ExtResource( 2 )
4040

4141
[node name="Timer" type="Timer" parent="."]
4242

godot/main.gd

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var set = 0 #usado para determinar o tempo da bola parada
66
var rightcor = 0 #usado para ver se a bola foi lançada com a cor correta
77
var parada = 0 #usado para parar a roleta
88
var ball #a bola
9+
var trail #o rastro da bola
910
var roleta #a roleta
1011
var explosao #particulas
1112

@@ -50,7 +51,7 @@ func ballcollisions(): #verifica as colisoes da bola
5051
if(ball.get_collider_velocity() > Vector2(0,0)):
5152
vetory = vetory+Vector2(0,randi()%5+3)
5253
if(ball.get_collider_velocity() < Vector2(0,0)):
53-
vetory = vetory+Vector2(0,-randi()%5+3)
54+
vetory = vetory+Vector2(0,-(randi()%5+3))
5455

5556
if(vetory > Vector2(0,20)):
5657
vetory = Vector2(0,20)
@@ -59,8 +60,10 @@ func ballcollisions(): #verifica as colisoes da bola
5960

6061
if(ball.get_collider() == get_node("BarraVermelha")):
6162
cor = 1
63+
trail.set_color_ramp(load("res://red.tres"))
6264
else:
6365
cor = 0
66+
trail.set_color_ramp(load("res://blue.tres"))
6467
ball.sprite(cor)
6568
else:
6669
vetory = -vetory
@@ -79,6 +82,7 @@ func _ready():
7982
ball = get_node("Ball")
8083
roleta = get_node("Roleta")
8184
explosao = load("res://explosion.tscn")
85+
trail = get_node("Ball/Particles2D")
8286
randomize()
8387
setball()
8488
set_fixed_process(true)
@@ -97,8 +101,10 @@ func _fixed_process(delta):
97101
roleta.parada()
98102
if(vetorx < Vector2(0,0)):
99103
ball.sprite(1)
104+
trail.set_color_ramp(load("res://red.tres"))
100105
else:
101106
ball.sprite(0)
107+
trail.set_color_ramp(load("res://blue.tres"))
102108
rightcor = 1
103109
ball.move(vetorx+vetory)
104110
if(ball.test_move(vetorx+vetory)):

godot/main.tscn

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
1-
[gd_scene load_steps=12 format=1]
1+
[gd_scene load_steps=13 format=1]
22

33
[ext_resource path="res://main.gd" type="Script" id=1]
44
[ext_resource path="res://barraAzul.tscn" type="PackedScene" id=2]
55
[ext_resource path="res://barraVermelha.tscn" type="PackedScene" id=3]
66
[ext_resource path="res://ball.tscn" type="PackedScene" id=4]
7-
[ext_resource path="res://soundtrack_repeat.ogg" type="AudioStream" id=5]
8-
[ext_resource path="res://SoundtrackRepeat.gd" type="Script" id=6]
9-
[ext_resource path="res://soundtrack_intro.ogg" type="AudioStream" id=7]
10-
[ext_resource path="res://Roleta.tscn" type="PackedScene" id=8]
7+
[ext_resource path="res://ballpart.tex" type="Texture" id=5]
8+
[ext_resource path="res://blue.tres" type="ColorRamp" id=6]
9+
[ext_resource path="res://soundtrack_repeat.ogg" type="AudioStream" id=7]
10+
[ext_resource path="res://SoundtrackRepeat.gd" type="Script" id=8]
11+
[ext_resource path="res://soundtrack_intro.ogg" type="AudioStream" id=9]
12+
[ext_resource path="res://Roleta.tscn" type="PackedScene" id=10]
1113

12-
[sub_resource type="ColorRamp" id=3]
13-
14-
offsets = FloatArray( 0, 1 )
15-
colors = ColorArray( 1, 1, 1, 1, 0, 0, 0, 1 )
16-
17-
[sub_resource type="RectangleShape2D" id=1]
14+
[sub_resource type="RectangleShape2D" id=2]
1815

1916
custom_solver_bias = 0.0
2017
extents = Vector2( 12.5475, 32.4343 )
2118

22-
[sub_resource type="RectangleShape2D" id=2]
19+
[sub_resource type="RectangleShape2D" id=3]
2320

2421
custom_solver_bias = 0.0
2522
extents = Vector2( 185.818, 37.6098 )
@@ -49,11 +46,14 @@ z/z = -1
4946

5047
[node name="Particles2D" type="Particles2D" parent="Ball"]
5148

49+
visibility/opacity = 0.5
5250
z/z = -3
53-
config/amount = 60
54-
config/lifetime = 0.35
51+
config/amount = 200
52+
config/lifetime = 0.6
53+
config/time_scale = 2.0
5554
config/process_mode = 1
5655
config/local_space = false
56+
config/texture = ExtResource( 5 )
5757
params/direction = 0.0
5858
params/spread = 0.0
5959
params/linear_velocity = 0.0
@@ -65,20 +65,20 @@ params/radial_accel = 0.0
6565
params/tangential_accel = 0.0
6666
params/damping = 0.0
6767
params/initial_angle = 0.0
68-
params/initial_size = 30.0
69-
params/final_size = 30.0
68+
params/initial_size = 0.5
69+
params/final_size = 0.3
7070
params/hue_variation = 0.0
7171
params/anim_speed_scale = 1.0
7272
params/anim_initial_pos = 0.0
73-
color/color_ramp = SubResource( 3 )
73+
color/color_ramp = ExtResource( 6 )
7474

7575
[node name="StaticBody2D" type="StaticBody2D" parent="."]
7676

7777
input/pickable = false
78-
shapes/0/shape = SubResource( 1 )
78+
shapes/0/shape = SubResource( 2 )
7979
shapes/0/transform = Matrix32( 40.8931, 0, 0, 1, 515.651, -30.5389 )
8080
shapes/0/trigger = false
81-
shapes/1/shape = SubResource( 2 )
81+
shapes/1/shape = SubResource( 3 )
8282
shapes/1/transform = Matrix32( 2.79333, 0, 0, 1, 512.426, 637.492 )
8383
shapes/1/trigger = false
8484
collision/layers = 1
@@ -92,33 +92,33 @@ bounce = 0.0
9292

9393
transform/pos = Vector2( 515.651, -30.5389 )
9494
transform/scale = Vector2( 40.8931, 1 )
95-
shape = SubResource( 1 )
95+
shape = SubResource( 2 )
9696
trigger = false
9797
_update_shape_index = 0
9898

9999
[node name="CollisionShape2D 2" type="CollisionShape2D" parent="StaticBody2D"]
100100

101101
transform/pos = Vector2( 512.426, 637.492 )
102102
transform/scale = Vector2( 2.79333, 1 )
103-
shape = SubResource( 2 )
103+
shape = SubResource( 3 )
104104
trigger = false
105105
_update_shape_index = 1
106106

107107
[node name="Repeat" type="StreamPlayer" parent="."]
108108

109-
stream/stream = ExtResource( 5 )
109+
stream/stream = ExtResource( 7 )
110110
stream/play = false
111111
stream/loop = true
112112
stream/volume_db = 0.0
113113
stream/autoplay = true
114114
stream/paused = true
115115
stream/loop_restart_time = 0.0
116116
stream/buffering_ms = 50
117-
script/script = ExtResource( 6 )
117+
script/script = ExtResource( 8 )
118118

119119
[node name="Intro" type="StreamPlayer" parent="."]
120120

121-
stream/stream = ExtResource( 7 )
121+
stream/stream = ExtResource( 9 )
122122
stream/play = false
123123
stream/loop = false
124124
stream/volume_db = 0.0
@@ -127,7 +127,7 @@ stream/paused = false
127127
stream/loop_restart_time = 0.0
128128
stream/buffering_ms = 500
129129

130-
[node name="Roleta" parent="." instance=ExtResource( 8 )]
130+
[node name="Roleta" parent="." instance=ExtResource( 10 )]
131131

132132
transform/pos = Vector2( 512.372, 299.098 )
133133
transform/scale = Vector2( 0.32, 0.32 )

godot/red.tres

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[gd_resource type="ColorRamp" format=1]
2+
3+
[resource]
4+
5+
offsets = FloatArray( 0, 1 )
6+
colors = ColorArray( 0.972656, 0.577515, 0.577515, 1, 0, 0, 0, 1 )
7+

0 commit comments

Comments
 (0)