Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.

Commit

Permalink
Add a log to get out from the teleport
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed Jan 25, 2021
1 parent fdd1a92 commit ced4bde
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 36 deletions.
10 changes: 10 additions & 0 deletions Enteties/Teleporter/HollowLog.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extends StaticBody2D

export var flipped = true

func _ready():
$Background.flip_h = flipped
$Foreground.flip_h = flipped

if !flipped:
$Wall.position.x = -62
35 changes: 35 additions & 0 deletions Enteties/Teleporter/HollowLog.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[gd_scene load_steps=6 format=2]

[ext_resource path="res://Enteties/Teleporter/Sprites/tree-trunk-1-background.png" type="Texture" id=1]
[ext_resource path="res://Enteties/Teleporter/Sprites/tree-trunk-1-foreground.png" type="Texture" id=2]
[ext_resource path="res://Enteties/Teleporter/HollowLog.gd" type="Script" id=3]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 65, 3 )

[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 3, 135 )

[node name="HollowLog" type="StaticBody2D"]
collision_layer = 8
collision_mask = 3
script = ExtResource( 3 )

[node name="Background" type="Sprite" parent="."]
position = Vector2( 0, 2 )
z_index = -10
texture = ExtResource( 1 )
flip_h = true

[node name="Foreground" type="Sprite" parent="."]
z_index = 10
texture = ExtResource( 2 )
flip_h = true

[node name="Roof" type="CollisionShape2D" parent="."]
position = Vector2( 0, -35 )
shape = SubResource( 1 )

[node name="Wall" type="CollisionShape2D" parent="."]
position = Vector2( 62, -94 )
shape = SubResource( 2 )
34 changes: 4 additions & 30 deletions Enteties/Teleporter/Teleporter.tscn
Original file line number Diff line number Diff line change
@@ -1,47 +1,21 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=4 format=2]

[ext_resource path="res://Enteties/Teleporter/Sprites/tree-trunk-1-foreground.png" type="Texture" id=1]
[ext_resource path="res://Enteties/Teleporter/HollowLog.tscn" type="PackedScene" id=1]
[ext_resource path="res://Enteties/Teleporter/teleporter.gd" type="Script" id=2]
[ext_resource path="res://Enteties/Teleporter/Sprites/tree-trunk-1-background.png" type="Texture" id=3]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 5, 35 )

[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 64, 3 )

[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 3, 100 )

[node name="Teleporter" type="Area2D"]
script = ExtResource( 2 )

[node name="Background" type="Sprite" parent="."]
position = Vector2( 0, 2 )
z_index = -10
texture = ExtResource( 3 )
flip_h = true

[node name="Foreground" type="Sprite" parent="."]
z_index = 10
texture = ExtResource( 1 )
flip_h = true

[node name="Detector" type="CollisionShape2D" parent="."]
position = Vector2( 60, 5 )
position = Vector2( 52, 5 )
shape = SubResource( 1 )

[node name="VisibilityEnabler2D" type="VisibilityEnabler2D" parent="."]
process_parent = true
physics_process_parent = true

[node name="StaticBody2D" type="StaticBody2D" parent="."]

[node name="Floor" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2( 0, -35 )
shape = SubResource( 2 )

[node name="Wall" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2( 60, -138 )
shape = SubResource( 3 )
[node name="HollowLog" parent="." instance=ExtResource( 1 )]
[connection signal="body_entered" from="." to="." method="_on_Teleporter_body_entered"]
9 changes: 7 additions & 2 deletions Levels/Desert/Desert2.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=10 format=2]

[ext_resource path="res://Enteties/Chameleon/Chameleon.tscn" type="PackedScene" id=1]
[ext_resource path="res://Levels/ParallaxBackground.tscn" type="PackedScene" id=2]
Expand All @@ -7,12 +7,13 @@
[ext_resource path="res://Enteties/Enemies/Lizard/lizard.tscn" type="PackedScene" id=5]
[ext_resource path="res://Enteties/Enemies/Scorpion/Scorpion.tscn" type="PackedScene" id=6]
[ext_resource path="res://Enteties/EvolveBerry/EvolveBerry.tscn" type="PackedScene" id=7]
[ext_resource path="res://Enteties/Teleporter/HollowLog.tscn" type="PackedScene" id=8]
[ext_resource path="res://Enteties/Teleporter/Teleporter.tscn" type="PackedScene" id=18]

[node name="Desert2" type="Node2D"]

[node name="Chameleon" parent="." instance=ExtResource( 1 )]
position = Vector2( -77.9669, 145.376 )
position = Vector2( 3.67821, 160.006 )

[node name="TileMap" type="TileMap" parent="."]
tile_set = ExtResource( 3 )
Expand Down Expand Up @@ -64,3 +65,7 @@ position = Vector2( 3395.67, 84.5677 )

[node name="Lizard3" parent="Enemies" instance=ExtResource( 5 )]
position = Vector2( 3342.79, -222.954 )

[node name="HollowLog" parent="." instance=ExtResource( 8 )]
position = Vector2( -128.367, 158.571 )
flipped = false
13 changes: 9 additions & 4 deletions Levels/Desert/Desert3.tscn
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
[gd_scene load_steps=5 format=2]
[gd_scene load_steps=6 format=2]

[ext_resource path="res://Enteties/Chameleon/Chameleon.tscn" type="PackedScene" id=1]
[ext_resource path="res://Levels/ParallaxBackground.tscn" type="PackedScene" id=2]
[ext_resource path="res://Levels/Desert/Tiles/Desert.tres" type="TileSet" id=3]
[ext_resource path="res://Enteties/Teleporter/HollowLog.tscn" type="PackedScene" id=4]
[ext_resource path="res://Enteties/Teleporter/Teleporter.tscn" type="PackedScene" id=18]

[node name="Desert2" type="Node2D"]

[node name="Chameleon" parent="." instance=ExtResource( 1 )]
position = Vector2( 62.2957, 33.9795 )
position = Vector2( 202.933, 31.1479 )

[node name="TileMap" type="TileMap" parent="."]
tile_set = ExtResource( 3 )
collision_layer = 8
collision_mask = 0
format = 1
tile_data = PoolIntArray( 65536, 1, 0, 65537, 1, 0, 65538, 1, 0, 65539, 1, 0, 65540, 1, 0 )
tile_data = PoolIntArray( 65536, 1, 0, 65537, 1, 0, 65538, 1, 0, 65539, 1, 0, 65540, 1, 0, 65541, 1, 0, 65542, 1, 0, 65543, 1, 0, 65544, 1, 0, 65545, 1, 0, 65546, 1, 0 )
__meta__ = {
"_edit_lock_": true
}

[node name="ParallaxBackground" parent="." instance=ExtResource( 2 )]

[node name="Teleporter" parent="." instance=ExtResource( 18 )]
position = Vector2( 255.281, 27.6006 )
position = Vector2( 639.439, 31.3761 )
scene_to_load = "res://TitleScreen/TitleScreen.tscn"

[node name="Berries" type="Node" parent="."]

[node name="Enemies" type="Node" parent="."]

[node name="HollowLog" parent="." instance=ExtResource( 4 )]
position = Vector2( 64.1836, 28.3163 )
flipped = false

0 comments on commit ced4bde

Please sign in to comment.