From ff4ff1be6b584cc55c4ee046d7a02a111a3d335f Mon Sep 17 00:00:00 2001 From: hsn6 Date: Sun, 2 Jul 2017 15:06:19 +0430 Subject: [PATCH] plibonigxis desegnado de la ondoj. partiklosistemo por malamikoj. --- Defendiloj/Kugloj/Kuglo/Kuglo.gd | 2 +- Defendiloj/Pistoloj/Ondilo/Ondilo.gd | 2 +- Kontroloj/Komenco.tscn | 2 +- Malamikoj/Malamiko.gd | 4 +- Malamikoj/Malamiko_0_.tscn | 33 +++++++++++++++-- Malamikoj/Malamiko_1_.tscn | 55 +++++++++++++++++++++++++++- Radiko.gd | 23 ++++++------ Radiko.tscn | 6 +-- engine.cfg | 2 +- 9 files changed, 106 insertions(+), 23 deletions(-) diff --git a/Defendiloj/Kugloj/Kuglo/Kuglo.gd b/Defendiloj/Kugloj/Kuglo/Kuglo.gd index cfb2ccc..747b932 100644 --- a/Defendiloj/Kugloj/Kuglo/Kuglo.gd +++ b/Defendiloj/Kugloj/Kuglo/Kuglo.gd @@ -17,7 +17,7 @@ func _fixed_process(delta): func _on_Area2D_body_enter( korpo ): var patro_nomo = korpo.get_parent().nomo if patro_nomo == "Malamiko_0_" or patro_nomo == "Malamiko_1_": - korpo.get_parent().vivo -= log(nivelo+3)*10-10 + korpo.get_parent().vivo -= log(nivelo+3)*10-6 queue_free() diff --git a/Defendiloj/Pistoloj/Ondilo/Ondilo.gd b/Defendiloj/Pistoloj/Ondilo/Ondilo.gd index d3611ad..57f50d3 100644 --- a/Defendiloj/Pistoloj/Ondilo/Ondilo.gd +++ b/Defendiloj/Pistoloj/Ondilo/Ondilo.gd @@ -91,4 +91,4 @@ func _on_Ondo_body_enter( korpo ): if korpo.get_parent().nomo == "Malamiko_2_": korpo.get_parent().vivo -= log(nivelo+3)*70-10 else: - korpo.get_parent().vivo -= log(nivelo+3)*10-10 + korpo.get_parent().vivo -= log(nivelo+3)*15-10 diff --git a/Kontroloj/Komenco.tscn b/Kontroloj/Komenco.tscn index 6d1d958..d272c65 100644 --- a/Kontroloj/Komenco.tscn +++ b/Kontroloj/Komenco.tscn @@ -74,7 +74,7 @@ margin/right = 754.0 margin/bottom = 1273.0 custom_fonts/font = ExtResource( 2 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) -text = "v2.0" +text = "v2.1" autowrap = true percent_visible = 1.0 lines_skipped = 0 diff --git a/Malamikoj/Malamiko.gd b/Malamikoj/Malamiko.gd index cd18a19..bfdc9cd 100644 --- a/Malamikoj/Malamiko.gd +++ b/Malamikoj/Malamiko.gd @@ -41,8 +41,10 @@ func _ready(): func _process(delta): Vivo.set_text(str(vivo)) Vivo_P.set_scale(Vector2(vivo/komenca_vivo, 1)) - if "Malamiko_2_" in get_name(): + if "Malamiko_2_" == nomo: M.get_node("Sprite").rotate(0.05) + elif vivo > 0: + M.get_node("Partiklo").set_explosiveness(vivo/komenca_vivo) if vivo <= 0: M.clear_shapes() Vivo_P.hide() diff --git a/Malamikoj/Malamiko_0_.tscn b/Malamikoj/Malamiko_0_.tscn index dfbf913..c1978d2 100644 --- a/Malamikoj/Malamiko_0_.tscn +++ b/Malamikoj/Malamiko_0_.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=6 format=1] +[gd_scene load_steps=7 format=1] [ext_resource path="res://Malamikoj/Malamiko.gd" type="Script" id=1] [ext_resource path="res://Malamikoj/malamiko_0.png" type="Texture" id=2] [ext_resource path="res://Tiparoj/roboto.fnt" type="BitmapFont" id=3] +[ext_resource path="res://Malamikoj/partiklo.png" type="Texture" id=4] -[sub_resource type="ConvexPolygonShape2D" id=3] +[sub_resource type="ConvexPolygonShape2D" id=1] custom_solver_bias = 0.0 points = Vector2Array( 100, 97.9167, -100, 97.9167, -9.49857e-13, -72.9167 ) @@ -23,7 +24,7 @@ script/script = ExtResource( 1 ) transform/rot = -4.07111e-13 input/pickable = false -shapes/0/shape = SubResource( 3 ) +shapes/0/shape = SubResource( 1 ) shapes/0/transform = Matrix32( 1.2, 7.10542e-15, -7.10542e-15, 1.2, 0, 0 ) shapes/0/trigger = false collision/layers = 4 @@ -107,6 +108,32 @@ playback/active = false playback/repeat = false playback/speed = 1.0 +[node name="Partiklo" type="Particles2D" parent="Malamiko"] + +transform/pos = Vector2( -1.05101e-12, 177.5 ) +transform/rot = -3.39259e-13 +config/amount = 16 +config/lifetime = 0.25 +config/process_mode = 1 +config/half_extents = Vector2( 2, 1 ) +config/texture = ExtResource( 4 ) +params/direction = 0.0 +params/spread = 16.36 +params/linear_velocity = 900.0 +params/spin_velocity = 0.0 +params/orbit_velocity = 0.0 +params/gravity_direction = 0.0 +params/gravity_strength = 0.0 +params/radial_accel = 0.0 +params/tangential_accel = 0.0 +params/damping = 0.0 +params/initial_angle = 0.0 +params/initial_size = 1.5 +params/final_size = 0.0 +params/hue_variation = 0.0 +params/anim_speed_scale = 1.0 +params/anim_initial_pos = 0.0 + [connection signal="tween_complete" from="Malamiko/Efekto" to="." method="_on_Efekto_tween_complete"] diff --git a/Malamikoj/Malamiko_1_.tscn b/Malamikoj/Malamiko_1_.tscn index 95b8284..38305a0 100644 --- a/Malamikoj/Malamiko_1_.tscn +++ b/Malamikoj/Malamiko_1_.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=6 format=1] +[gd_scene load_steps=7 format=1] [ext_resource path="res://Malamikoj/Malamiko.gd" type="Script" id=1] [ext_resource path="res://Malamikoj/malamiko_1.png" type="Texture" id=2] [ext_resource path="res://Tiparoj/roboto.fnt" type="BitmapFont" id=3] +[ext_resource path="res://Malamikoj/partiklo.png" type="Texture" id=4] [sub_resource type="ConvexPolygonShape2D" id=1] @@ -107,6 +108,58 @@ playback/active = false playback/repeat = false playback/speed = 1.0 +[node name="Partiklo" type="Particles2D" parent="Malamiko"] + +transform/pos = Vector2( -50, 177.5 ) +transform/rot = -3.39259e-13 +config/amount = 16 +config/lifetime = 0.25 +config/process_mode = 1 +config/half_extents = Vector2( 2, 1 ) +config/texture = ExtResource( 4 ) +params/direction = 0.0 +params/spread = 16.36 +params/linear_velocity = 900.0 +params/spin_velocity = 0.0 +params/orbit_velocity = 0.0 +params/gravity_direction = 0.0 +params/gravity_strength = 0.0 +params/radial_accel = 0.0 +params/tangential_accel = 0.0 +params/damping = 0.0 +params/initial_angle = 0.0 +params/initial_size = 1.5 +params/final_size = 0.0 +params/hue_variation = 0.0 +params/anim_speed_scale = 1.0 +params/anim_initial_pos = 0.0 + +[node name="Partiklo2" type="Particles2D" parent="Malamiko"] + +transform/pos = Vector2( 50, 177.5 ) +transform/rot = -3.39259e-13 +config/amount = 16 +config/lifetime = 0.25 +config/process_mode = 1 +config/half_extents = Vector2( 2, 1 ) +config/texture = ExtResource( 4 ) +params/direction = 0.0 +params/spread = 16.36 +params/linear_velocity = 900.0 +params/spin_velocity = 0.0 +params/orbit_velocity = 0.0 +params/gravity_direction = 0.0 +params/gravity_strength = 0.0 +params/radial_accel = 0.0 +params/tangential_accel = 0.0 +params/damping = 0.0 +params/initial_angle = 0.0 +params/initial_size = 1.5 +params/final_size = 0.0 +params/hue_variation = 0.0 +params/anim_speed_scale = 1.0 +params/anim_initial_pos = 0.0 + [connection signal="tween_complete" from="Malamiko/Efekto" to="." method="_on_Efekto_tween_complete"] diff --git a/Radiko.gd b/Radiko.gd index 4fa2bcb..32c01c6 100644 --- a/Radiko.gd +++ b/Radiko.gd @@ -38,28 +38,29 @@ func _ready(): get_tree().set_auto_accept_quit(false) tipoj = [ {'sceno': M0, 'grando': 0.3, 'vivo': 40, 'rapido': 3.2, 'unuarenkonto': 0}, + {'sceno': M0, 'grando': 0.3, 'vivo': 40, 'rapido': 3.2, 'unuarenkonto': 0}, {'sceno': M0, 'grando': 0.45, 'vivo': 300, 'rapido': 2.8, 'unuarenkonto': 1}, {'sceno': M0, 'grando': 0.7, 'vivo': 800, 'rapido': 2.2, 'unuarenkonto': 3}, {'sceno': M1, 'grando': 0.8, 'vivo': 2000, 'rapido': 1, 'unuarenkonto': 5}, - {'sceno': M1, 'grando': 1.1, 'vivo': 5000, 'rapido': 0.7, 'unuarenkonto': 10}, + {'sceno': M1, 'grando': 1.3, 'vivo': 5000, 'rapido': 0.7, 'unuarenkonto': 10}, {'sceno': M2, 'grando': 0.45, 'vivo': 200, 'rapido': 1.5, 'unuarenkonto': 7}, {'sceno': M2, 'grando': 0.7, 'vivo': 900, 'rapido': 1, 'unuarenkonto': 12}, ] ondoj = [] - randomize() +# ondoj = [[{'nombro': 1, 'tipo': 6, 'atendo': 20}]] for o in range(50): ondoj.append([]) while ondoj[-1].size() < 5: + randomize() var t = int(rand_range(0, tipoj.size())) if o >= tipoj[t]['unuarenkonto'] and int(rand_range(0,2)) == 1: - var nombro = o - tipoj[t]['unuarenkonto'] + int(rand_range(0,2)) + 1 - #nombro = int(log(nombro*100))-3 + var nombro = int(rand_range(1, o - tipoj[t]['unuarenkonto'] + rand_range(1,3))) var atendo = tipoj[t]['rapido']+tipoj[t]['vivo']/50 + nombro/2 + rand_range(0,5) ondoj[-1].append({'nombro': nombro, 'tipo': t, 'atendo': atendo}) - for ondo in ondoj: - print("***") - for so in ondo: - print(so) +# for ondo in ondoj: +# print("***") +# for so in ondo: +# print(so) set_process(true) func _notification(what): @@ -155,11 +156,11 @@ func _on_Aldoni_Lasero_pressed(): func _je_malamiko_mortigxis(komenca_vivo): - mono += int(log(komenca_vivo)*25-85) + mono += int(log(komenca_vivo)*50-170) func _je_malamiko_batis_bazon(komenca_vivo): Batita.play() - vivo -= int(log(komenca_vivo)*25-85) + vivo -= int(log(komenca_vivo)*50-170) func _on_Atendado_subondoj_timeout(): if subondo < ondoj[ondo].size()-1: @@ -195,7 +196,7 @@ func _on_Zomilo_value_changed( valoro ): )) func _on_vastigu_la_reton_pressed(): - var prezoj = [500, 750, 900, 1200] + var prezoj = [1000, 3200, 6500, 15000] if reto == 0 and mono > prezoj[0]: mono -= prezoj[0] get_node("Reto/N1").show() diff --git a/Radiko.tscn b/Radiko.tscn index b9536d3..e847572 100644 --- a/Radiko.tscn +++ b/Radiko.tscn @@ -938,13 +938,13 @@ focus/ignore_mouse = true focus/stop_mouse = true size_flags/horizontal = 2 size_flags/vertical = 0 -margin/left = 351.0 +margin/left = 347.0 margin/top = 137.0 -margin/right = 459.0 +margin/right = 531.0 margin/bottom = 214.0 custom_fonts/font = ExtResource( 4 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) -text = "500" +text = "1000" percent_visible = 1.0 lines_skipped = 0 max_lines_visible = -1 diff --git a/engine.cfg b/engine.cfg index 119eea3..1455e98 100644 --- a/engine.cfg +++ b/engine.cfg @@ -1,7 +1,7 @@ [application] name="defendo" -main_scene="res://Radiko.tscn" +main_scene="res://Kontroloj/Komenco.tscn" icon="res://ikono.png" [autoload]