From 5766ed591d693026d170c06e64bc2f7bab9961c5 Mon Sep 17 00:00:00 2001 From: dariasteam Date: Fri, 20 Jul 2018 12:46:34 +0100 Subject: [PATCH] Update --- Scenes/Input_Handler.tscn | 4 ++-- Scenes/Player.gd | 31 ++++++++++++++++++--------- Scenes/Player.tscn | 44 ++++++++++++++++++++++++++++----------- Scenes/decal.tscn | 2 +- Scenes/end_line.gd | 15 +++++++------ 5 files changed, 63 insertions(+), 33 deletions(-) diff --git a/Scenes/Input_Handler.tscn b/Scenes/Input_Handler.tscn index bfff00d..9849c74 100644 --- a/Scenes/Input_Handler.tscn +++ b/Scenes/Input_Handler.tscn @@ -137,9 +137,9 @@ focus/stop_mouse = true size_flags/horizontal = 2 size_flags/vertical = 0 margin/left = 120.0 -margin/top = 102.0 +margin/top = 112.0 margin/right = 601.0 -margin/bottom = 160.0 +margin/bottom = 170.0 custom_styles/fg = SubResource( 1 ) range/min = 0.0 range/max = 30.0 diff --git a/Scenes/Player.gd b/Scenes/Player.gd index fbdfab2..d0205a8 100644 --- a/Scenes/Player.gd +++ b/Scenes/Player.gd @@ -12,6 +12,7 @@ onready var axis = get_node ("RigidBody/Axis") onready var ball = get_node ("RigidBody/Axis/Group/Ball") onready var area = get_node ("RigidBody/Axis/Group/Area") onready var rigid_2 = get_node("RigidBody2") +onready var light = get_node("RigidBody/Axis/Group/OmniLight") onready var camera_axis = get_node ("RigidBody2/CameraAxis") @@ -32,20 +33,27 @@ export (int) var n_platforms_to_meteorize = 2 var meteor_charged = true var meteor = false -func die(): +func die(): + rigid.set_gravity_scale(0) + rigid_2.set_gravity_scale(0) + rigid_2.set_linear_velocity(Vector3(0,0,0)) + rigid.set_linear_velocity(Vector3(0,0,0)) + rigid_2.set_sleeping(true) + rigid.set_sleeping(true) + die_sound.play(0) die_particles.set_emitting(true) ball.queue_free() area.queue_free() rigid.set_gravity_scale(0) - rigid.set_linear_velocity(Vector3(0,0,0)) - rigid.set_sleeping(true) + + trail.set_emitting(false) - idle_particles.set_emitting(false) - rigid_2.set_sleeping(true) - rigid.set_linear_velocity(Vector3(0,0,0)) + idle_particles.set_emitting(false) get_node("Timer").start() + + func on_platform_passed(): global.update_points((counter + 1) * 10) global.update_progress() @@ -57,9 +65,9 @@ func on_platform_passed(): if (counter == n_platforms_to_meteorize - 1): rigid.set_gravity_scale(0) - if (counter >= n_platforms_to_meteorize): - meteor_particles.set_emitting(true) + if (counter >= n_platforms_to_meteorize): if (meteor_charged): + meteor_particles.set_emitting(true) meteorize() rigid_2.set_sleeping(false) @@ -79,6 +87,7 @@ func _on_set_rotation (rot): func _on_Area_body_enter(body): + light.set_enabled(false) acceleration_sound.stop() if (body.is_in_group("wall")): colliding = true @@ -101,10 +110,10 @@ func _on_Area_body_enter(body): else: jump_sound.play(0) var aux = decal.instance() - aux.set_translation(Vector3(-1.5, 0.01,-0.5)) + aux.set_translation(Vector3(-1.5, 0.01,-0.5)) aux.rotate_z(rand_range(0, 360)) body.add_child(aux) - + rigid.set_linear_velocity(Vector3(0,0,0)) rigid.apply_impulse(Vector3(0,0,0), Vector3(0,70,0)) splash.set_emitting(true) @@ -116,8 +125,10 @@ func _ready(): ball.set_material_override(global.mat_player) var color = global.mat_player.get_parameter(FixedMaterial.PARAM_DIFFUSE) trail.get_material().set_parameter(FixedMaterial.PARAM_DIFFUSE, color) + light.set_color(1,color) func meteorize(): + light.set_enabled(true) meteor = true meteor_charged = false diff --git a/Scenes/Player.tscn b/Scenes/Player.tscn index c53473e..d51e1cc 100644 --- a/Scenes/Player.tscn +++ b/Scenes/Player.tscn @@ -118,7 +118,7 @@ continuous_cd = false contacts_reported = 1 contact_monitor = false sleeping = false -can_sleep = false +can_sleep = true axis_lock = 1 velocity/linear = Vector3( 0, 0, 0 ) velocity/angular = Vector3( 0, 0, 0 ) @@ -553,7 +553,7 @@ input/ray_pickable = false input/capture_on_drag = false shape_count = 1 shapes/0/shape = SubResource( 2 ) -shapes/0/transform = Transform( 0.363368, 0, 0, 0, 0.363368, 0, 0, 0, 0.363368, 0, -0.216982, -0.108771 ) +shapes/0/transform = Transform( 0.141244, 0, 0, 0, 0.141244, 0, 0, 0, 0.141244, 0, -0.529141, -0.108771 ) shapes/0/trigger = true space_override = 0 gravity_point = false @@ -571,7 +571,7 @@ collision/mask = 3 [node name="CollisionShape" type="CollisionShape" parent="RigidBody/Axis/Group/Area"] _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) -transform/local = Transform( 0.363368, 0, 0, 0, 0.363368, 0, 0, 0, 0.363368, 0, -0.216982, -0.108771 ) +transform/local = Transform( 0.141244, 0, 0, 0, 0.141244, 0, 0, 0, 0.141244, 0, -0.529141, -0.108771 ) shape = SubResource( 2 ) trigger = true _update_shape_index = 0 @@ -609,6 +609,28 @@ playback/speed = 1.0 blend_times = [ ] autoplay = "" +[node name="OmniLight" type="OmniLight" parent="RigidBody/Axis/Group"] + +_import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) +transform/local = Transform( 2, 0, 0, 0, 2, 0, 0, 0, 2, 0.131386, 0.533863, 7.97447 ) +layers = 1 +params/enabled = false +params/editor_only = false +params/bake_mode = 0 +params/energy = 2.0 +colors/diffuse = Color( 0.171875, 1, 0, 1 ) +colors/specular = Color( 1, 1, 1, 1 ) +shadow/shadow = false +shadow/darkening = 0.0 +shadow/z_offset = 0.001 +shadow/z_slope_scale = 0.0 +shadow/esm_multiplier = 60.0 +shadow/blur_passes = 1.0 +projector = null +operator = 0 +params/radius = 3.67988 +params/attenuation = 1.0 + [node name="Timer" type="Timer" parent="."] process_mode = 1 @@ -658,19 +680,19 @@ input/ray_pickable = true input/capture_on_drag = false shape_count = 1 shapes/0/shape = SubResource( 6 ) -shapes/0/transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0443238, 0.0397879 ) +shapes/0/transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0782349, 0.0397879 ) shapes/0/trigger = true collision/layers = 7 collision/mask = 7 mode = 2 mass = 3.06122 -friction = 1.0 -bounce = 1.0 +friction = 0.0 +bounce = 0.0 gravity_scale = 1.5 custom_integrator = false -continuous_cd = true -contacts_reported = 1 -contact_monitor = true +continuous_cd = false +contacts_reported = 0 +contact_monitor = false sleeping = false can_sleep = true axis_lock = 1 @@ -682,7 +704,7 @@ damp_override/angular = -1.0 [node name="CollisionShape" type="CollisionShape" parent="RigidBody2"] _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) -transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0443238, 0.0397879 ) +transform/local = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0782349, 0.0397879 ) shape = SubResource( 6 ) trigger = true _update_shape_index = 0 @@ -717,6 +739,4 @@ enabled = true [connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"] -[connection signal="body_enter" from="RigidBody2" to="." method="_on_RigidBody_2_body_enter"] - diff --git a/Scenes/decal.tscn b/Scenes/decal.tscn index c203972..8f11f62 100644 --- a/Scenes/decal.tscn +++ b/Scenes/decal.tscn @@ -44,7 +44,7 @@ textures/shade_param_tc = 0 [node name="Quad" type="Quad"] _import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ) -transform/local = Transform( 1, 0, 0, 0, 4.88762e-07, 1, 0, -1, 4.88762e-07, 0, 0, 0 ) +transform/local = Transform( 1, 0, 0, 0, -2.8213e-07, 1, 0, -1, -2.8213e-07, 0, 0, 0 ) layers = 1 geometry/visible = true geometry/material_override = SubResource( 1 ) diff --git a/Scenes/end_line.gd b/Scenes/end_line.gd index 1e26295..0fcd43d 100644 --- a/Scenes/end_line.gd +++ b/Scenes/end_line.gd @@ -4,14 +4,13 @@ var segment = preload ("res://Scenes/Segment.tscn") const SEGMENTS = 16 onready var offset = float(360) / SEGMENTS -func _on_Area_body_enter( body ): - if (!body.is_in_group("camera")): - get_node("StreamPlayer").play(1) - disconnect("body_enter", self, "_on_Area_body_enter") - set_enable_monitoring(false) - get_node("Timer").start() - for child in get_node("Children").get_children(): - child.explode() +func _on_Area_body_enter( body ): + get_node("StreamPlayer").play(1) + disconnect("body_enter", self, "_on_Area_body_enter") + set_enable_monitoring(false) + get_node("Timer").start() + for child in get_node("Children").get_children(): + child.explode() func _ready(): for i in range(0, SEGMENTS):