forked from Dariasteam/TowerJumper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7953671
commit 7598ef8
Showing
5 changed files
with
48 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
extends Spatial | ||
|
||
onready var children = get_node("Children") | ||
onready var area = get_node("Deleter") | ||
|
||
var segment = preload ("res://Scenes/Regular_Segment.tscn") | ||
|
||
var next_platform | ||
|
||
var allowed_range = Vector2(-1,-1) | ||
|
||
const SEGMENTS = 16 | ||
onready var offset = float(360) / SEGMENTS | ||
|
||
func send_next_platform_limits(): | ||
if (next_platform.allowed_range != Vector2(-1,-1)): | ||
global.player.limit_rotation_range(next_platform.allowed_range) | ||
else: | ||
global.player.unlimit_rotation_range() | ||
|
||
func explode(): | ||
send_next_platform_limits() | ||
for child in children.get_children(): | ||
child.explode() | ||
|
||
func meteorize(): | ||
send_next_platform_limits() | ||
if (global.sound_enabled): | ||
get_node("BigExplosion").play() | ||
for child in children.get_children(): | ||
child.meteorize() | ||
explode() | ||
|
||
func delete_enter ( body ): | ||
if (!body.is_in_group("camera")): | ||
body.get_parent().on_platform_passed() | ||
if (global.sound_enabled): | ||
get_node("RegularExplosion").play() | ||
explode() | ||
|