forked from team-sg/hero-mark-2
tube transport! also 3-block jump marginally easier
This commit is contained in:
parent
4d13d2932c
commit
8c60bbf293
6 changed files with 101 additions and 123 deletions
10
objects/environment/tube/tube_entrance.gd
Normal file
10
objects/environment/tube/tube_entrance.gd
Normal file
|
@ -0,0 +1,10 @@
|
|||
extends Area2D
|
||||
|
||||
export var speed = 120.0
|
||||
export var direction = Vector2.RIGHT
|
||||
|
||||
func _on_TubeEntrance_area_entered(area):
|
||||
if area.is_in_group("player"):
|
||||
var player = area.get_parent()
|
||||
player.global_position = global_position + Vector2(4.0, 4.0)
|
||||
player.enter_transport(speed, direction)
|
16
objects/environment/tube/tube_entrance.tscn
Normal file
16
objects/environment/tube/tube_entrance.tscn
Normal file
|
@ -0,0 +1,16 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://objects/environment/tube/tube_entrance.gd" type="Script" id=1]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 4, 4 )
|
||||
|
||||
[node name="TubeEntrance" type="Area2D"]
|
||||
monitorable = false
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 4, 4 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[connection signal="area_entered" from="." to="." method="_on_TubeEntrance_area_entered"]
|
5
objects/environment/tube/tube_exit.gd
Normal file
5
objects/environment/tube/tube_exit.gd
Normal file
|
@ -0,0 +1,5 @@
|
|||
extends Area2D
|
||||
|
||||
func _on_TubeExit_area_entered(area):
|
||||
if area.is_in_group("player"):
|
||||
area.get_parent().exit_transport()
|
16
objects/environment/tube/tube_exit.tscn
Normal file
16
objects/environment/tube/tube_exit.tscn
Normal file
|
@ -0,0 +1,16 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://objects/environment/tube/tube_exit.gd" type="Script" id=1]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 4, 4 )
|
||||
|
||||
[node name="TubeExit" type="Area2D"]
|
||||
monitorable = false
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 4, 4 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[connection signal="area_entered" from="." to="." method="_on_TubeExit_area_entered"]
|
Loading…
Add table
Add a link
Reference in a new issue