Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Dariasteam committed Jul 20, 2018
1 parent 1975b0a commit 5766ed5
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 33 deletions.
4 changes: 2 additions & 2 deletions Scenes/Input_Handler.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 21 additions & 10 deletions Scenes/Player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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()
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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

Expand Down
44 changes: 32 additions & 12 deletions Scenes/Player.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"]


2 changes: 1 addition & 1 deletion Scenes/decal.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
15 changes: 7 additions & 8 deletions Scenes/end_line.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 5766ed5

Please sign in to comment.