Skip to content

Commit

Permalink
Finished Part 15
Browse files Browse the repository at this point in the history
  • Loading branch information
uheartbeast committed Aug 25, 2022
1 parent b6a3ee8 commit e17ad3d
Show file tree
Hide file tree
Showing 30 changed files with 180 additions and 110 deletions.
File renamed without changes.
5 changes: 3 additions & 2 deletions MovingSpikeEnemy.tscn → Enemies/MovingSpikeEnemy.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=9 format=2]

[ext_resource path="res://characters_packed.png" type="Texture" id=1]
[ext_resource path="res://Hitbox.tscn" type="PackedScene" id=2]
[ext_resource path="res://MovingSpikeEnemy.gd" type="Script" id=3]
[ext_resource path="res://Hitboxes/Hitbox.tscn" type="PackedScene" id=2]
[ext_resource path="res://Enemies/MovingSpikeEnemy.gd" type="Script" id=3]


[sub_resource type="Curve2D" id=7]
_data = {
Expand Down
2 changes: 1 addition & 1 deletion Spikes.tscn → Enemies/Spikes.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://tiles_packed.png" type="Texture" id=1]
[ext_resource path="res://Hitbox.tscn" type="PackedScene" id=2]
[ext_resource path="res://Hitboxes/Hitbox.tscn" type="PackedScene" id=2]

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

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions StompEnemy.tscn → Enemies/StompEnemy.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[gd_scene load_steps=11 format=2]

[ext_resource path="res://characters_packed.png" type="Texture" id=1]
[ext_resource path="res://Hitbox.tscn" type="PackedScene" id=2]
[ext_resource path="res://StompEnemy.gd" type="Script" id=3]
[ext_resource path="res://Hitboxes/Hitbox.tscn" type="PackedScene" id=2]
[ext_resource path="res://Enemies/StompEnemy.gd" type="Script" id=3]

[sub_resource type="AtlasTexture" id=1]
atlas = ExtResource( 1 )
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions WalkingEnemy.tscn → Enemies/WalkingEnemy.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[gd_scene load_steps=8 format=2]

[ext_resource path="res://characters_packed.png" type="Texture" id=1]
[ext_resource path="res://WalkingEnemy.gd" type="Script" id=2]
[ext_resource path="res://Hitbox.tscn" type="PackedScene" id=3]
[ext_resource path="res://Enemies/WalkingEnemy.gd" type="Script" id=2]
[ext_resource path="res://Hitboxes/Hitbox.tscn" type="PackedScene" id=3]

[sub_resource type="AtlasTexture" id=1]
atlas = ExtResource( 1 )
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion Hitbox.tscn → Hitboxes/Hitbox.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=2]

[ext_resource path="res://Hitbox.gd" type="Script" id=1]
[ext_resource path="res://Hitboxes/Hitbox.gd" type="Script" id=1]

[node name="Hitbox" type="Area2D"]
collision_layer = 0
Expand Down
2 changes: 1 addition & 1 deletion World.gd → Levels/Level.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extends Node2D

const PlayerScene = preload("res://Player.tscn")
const PlayerScene = preload("res://Player/Player.tscn")

var player_spawn_location = Vector2.ZERO

Expand Down
14 changes: 14 additions & 0 deletions Levels/Level.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://Player/Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://Levels/Level.gd" type="Script" id=2]

[node name="Level" type="Node2D"]
script = ExtResource( 2 )

[node name="Player" parent="." instance=ExtResource( 1 )]

[node name="Camera2D" type="Camera2D" parent="."]
current = true

[node name="Timer" type="Timer" parent="."]
83 changes: 83 additions & 0 deletions Levels/Level1.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
[gd_scene load_steps=12 format=2]

[ext_resource path="res://Levels/Level.tscn" type="PackedScene" id=1]
[ext_resource path="res://World/Checkpoint.tscn" type="PackedScene" id=2]
[ext_resource path="res://Enemies/WalkingEnemy.tscn" type="PackedScene" id=3]
[ext_resource path="res://World/Ladder.tscn" type="PackedScene" id=4]
[ext_resource path="res://Enemies/StompEnemy.tscn" type="PackedScene" id=5]
[ext_resource path="res://World/TileMap.tscn" type="PackedScene" id=6]
[ext_resource path="res://Enemies/Spikes.tscn" type="PackedScene" id=7]
[ext_resource path="res://Enemies/MovingSpikeEnemy.tscn" type="PackedScene" id=8]
[ext_resource path="res://World/Door.tscn" type="PackedScene" id=9]

[sub_resource type="Curve2D" id=1]
_data = {
"points": PoolVector2Array( 0, 0, 0, 0, -5, -9, 0, 0, 0, 0, 35, -9, 0, 0, 0, 0, 35, -72, 0, 0, 0, 0, -45, -72, 0, 0, 0, 0, -45, -9, 0, 0, 0, 0, -5, -9 )
}

[sub_resource type="Curve2D" id=2]
_data = {
"points": PoolVector2Array( 0, 0, 0, 0, 0, -18, 0, 0, 0, 0, 0, 45 )
}

[node name="Level1" instance=ExtResource( 1 )]

[node name="Player" parent="." index="0"]
position = Vector2( 306, 108 )

[node name="TileMap" parent="." index="3" instance=ExtResource( 6 )]
tile_data = PoolIntArray( 0, 0, 0, 1, 0, 0, 2, 0, 0, 8, 0, 0, 9, 0, 0, 10, 0, 0, 11, 0, 0, 12, 0, 0, 65536, 0, 0, 65537, 0, 0, 65538, 0, 0, 65544, 0, 0, 65545, 0, 0, 65546, 0, 0, 65547, 0, 0, 65548, 0, 0, 262145, 1, 65537, 262146, 1, 65539, 327680, 1, 65537, 327681, 1, 65541, 327682, 1, 65540, 327683, 1, 65539, 327693, 1, 65537, 327694, 1, 65539, 327699, 1, 65537, 327700, 1, 65538, 327701, 1, 65538, 327702, 1, 65539, 393216, 1, 393217, 393217, 1, 393218, 393218, 1, 393218, 393219, 1, 65540, 393220, 1, 65538, 393221, 1, 65538, 393222, 1, 65538, 393223, 1, 65538, 393224, 1, 65539, 393228, 1, 65537, 393229, 1, 65541, 393230, 1, 65540, 393231, 1, 65538, 393232, 1, 65538, 393233, 1, 65538, 393234, 1, 65538, 393235, 1, 65541, 393236, 1, 393218, 393237, 1, 393218, 393238, 1, 65540, 393239, 1, 65538, 393240, 1, 65538, 393241, 1, 65538, 393242, 1, 65538, 393243, 1, 65539, 458752, 1, 393217, 458753, 1, 393218, 458754, 1, 393218, 458755, 1, 393218, 458756, 1, 393218, 458757, 1, 393218, 458758, 1, 393218, 458759, 1, 393218, 458760, 1, 65540, 458761, 1, 65538, 458762, 1, 65538, 458763, 1, 65538, 458764, 1, 65541, 458765, 1, 393218, 458766, 1, 393218, 458767, 1, 393218, 458768, 1, 393218, 458769, 1, 393218, 458770, 1, 393218, 458771, 1, 393218, 458772, 1, 393218, 458773, 1, 393218, 458774, 1, 393218, 458775, 1, 393218, 458776, 1, 393218, 458777, 1, 393218, 458778, 1, 393218, 458779, 1, 393219, 524288, 1, 458753, 524289, 1, 458754, 524290, 1, 458754, 524291, 1, 458754, 524292, 1, 458754, 524293, 1, 458754, 524294, 1, 458754, 524295, 1, 458754, 524296, 1, 458754, 524297, 1, 458754, 524298, 1, 458754, 524299, 1, 458754, 524300, 1, 458754, 524301, 1, 458754, 524302, 1, 458754, 524303, 1, 458754, 524304, 1, 458754, 524305, 1, 458754, 524306, 1, 458754, 524307, 1, 458754, 524308, 1, 458754, 524309, 1, 458754, 524310, 1, 458754, 524311, 1, 458754, 524312, 1, 458754, 524313, 1, 458754, 524314, 1, 458754, 524315, 1, 458755 )

[node name="Spikes" parent="." index="4" instance=ExtResource( 7 )]
position = Vector2( 171, 126 )

[node name="Spikes2" parent="." index="5" instance=ExtResource( 7 )]
position = Vector2( 189, 126 )

[node name="Spikes3" parent="." index="6" instance=ExtResource( 7 )]
position = Vector2( 207, 126 )

[node name="WalkingEnemy" parent="." index="7" instance=ExtResource( 3 )]
position = Vector2( 378, 90 )

[node name="Ladder" parent="." index="8" instance=ExtResource( 4 )]
position = Vector2( 126, 0 )

[node name="Ladder2" parent="." index="9" instance=ExtResource( 4 )]
position = Vector2( 126, 18 )

[node name="Ladder3" parent="." index="10" instance=ExtResource( 4 )]
position = Vector2( 126, 36 )

[node name="Ladder4" parent="." index="11" instance=ExtResource( 4 )]
position = Vector2( 126, 54 )

[node name="Ladder5" parent="." index="12" instance=ExtResource( 4 )]
position = Vector2( 126, 72 )

[node name="Ladder6" parent="." index="13" instance=ExtResource( 4 )]
position = Vector2( 126, 90 )

[node name="MovingSpikeEnemy" parent="." index="14" instance=ExtResource( 8 )]
position = Vector2( 31.5, 52.7143 )
scale = Vector2( 0.9, 0.857143 )
curve = SubResource( 1 )

[node name="MovingSpikeEnemy2" parent="." index="15" instance=ExtResource( 8 )]
position = Vector2( 189, 63 )
curve = SubResource( 2 )
animation_type = 1
speed = 2

[node name="Checkpoint" parent="." index="16" instance=ExtResource( 2 )]
position = Vector2( 207, 0 )

[node name="Checkpoint2" parent="." index="17" instance=ExtResource( 2 )]
position = Vector2( 99, 108 )

[node name="StompEnemy" parent="." index="18" instance=ExtResource( 5 )]
position = Vector2( 252, 27 )

[node name="Door" parent="." index="19" instance=ExtResource( 9 )]
position = Vector2( 486, 108 )
target_level_path = "res://Levels/Level2.tscn"
24 changes: 24 additions & 0 deletions Levels/Level2.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[gd_scene load_steps=6 format=2]

[ext_resource path="res://Levels/Level.tscn" type="PackedScene" id=1]
[ext_resource path="res://World/TileMap.tscn" type="PackedScene" id=2]
[ext_resource path="res://Enemies/WalkingEnemy.tscn" type="PackedScene" id=3]
[ext_resource path="res://World/Checkpoint.tscn" type="PackedScene" id=4]
[ext_resource path="res://World/Door.tscn" type="PackedScene" id=5]

[node name="Level2" instance=ExtResource( 1 )]

[node name="Player" parent="." index="0"]
position = Vector2( 36, 126 )

[node name="TileMap" parent="." index="3" instance=ExtResource( 2 )]
tile_data = PoolIntArray( 393220, 1, 65537, 393221, 1, 65538, 393222, 1, 65538, 393223, 1, 65538, 393224, 1, 65539, 393227, 1, 65537, 393228, 1, 65538, 393229, 1, 65538, 393230, 1, 65538, 393231, 1, 65538, 393232, 1, 65539, 458752, 1, 65537, 458753, 1, 65538, 458754, 1, 65538, 458755, 1, 65538, 458756, 1, 65541, 458757, 1, 4, 458758, 1, 458754, 458759, 1, 458754, 458760, 1, 458755, 458763, 1, 458753, 458764, 1, 458754, 458765, 1, 458754, 458766, 1, 458754, 458767, 1, 458754, 458768, 1, 458755, 524288, 1, 458753, 524289, 1, 458754, 524290, 1, 458754, 524291, 1, 458754, 524292, 1, 458754, 524293, 1, 458755 )

[node name="WalkingEnemy" parent="." index="4" instance=ExtResource( 3 )]
position = Vector2( 117, 108 )

[node name="Checkpoint" parent="." index="5" instance=ExtResource( 4 )]
position = Vector2( 207, 108 )

[node name="Door" parent="." index="6" instance=ExtResource( 5 )]
position = Vector2( 297, 108 )
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_resource type="Resource" load_steps=2 format=2]

[ext_resource path="res://PlayerMovementData.gd" type="Script" id=1]
[ext_resource path="res://Player/PlayerMovementData.gd" type="Script" id=1]

[resource]
script = ExtResource( 1 )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_resource type="Resource" load_steps=2 format=2]

[ext_resource path="res://PlayerMovementData.gd" type="Script" id=1]
[ext_resource path="res://Player/PlayerMovementData.gd" type="Script" id=1]

[resource]
script = ExtResource( 1 )
Expand Down
2 changes: 1 addition & 1 deletion Player.gd → Player/Player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class_name Player

enum { MOVE, CLIMB }

export(Resource) var moveData = preload("res://DefaultPlayerMovementData.tres") as PlayerMovementData
export(Resource) var moveData = preload("res://Player/DefaultPlayerMovementData.tres") as PlayerMovementData

var velocity = Vector2.ZERO
var state = MOVE
Expand Down
13 changes: 7 additions & 6 deletions Player.tscn → Player/Player.tscn
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
[gd_scene load_steps=5 format=2]

[ext_resource path="res://PlayerBlueSkin.tres" type="SpriteFrames" id=1]
[ext_resource path="res://Player.gd" type="Script" id=2]
[ext_resource path="res://FastPlayerMovementData.tres" type="Resource" id=3]
[ext_resource path="res://Player/FastPlayerMovementData.tres" type="Resource" id=1]
[ext_resource path="res://Player/PlayerBlueSkin.tres" type="SpriteFrames" id=2]
[ext_resource path="res://Player/Player.gd" type="Script" id=3]

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

[node name="Player" type="KinematicBody2D"]
z_index = 10
collision_layer = 2
script = ExtResource( 2 )
moveData = ExtResource( 3 )
script = ExtResource( 3 )
moveData = ExtResource( 1 )

[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
position = Vector2( 0, -12 )
frames = ExtResource( 1 )
frames = ExtResource( 2 )
animation = "Jump"
playing = true
flip_h = true
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
86 changes: 0 additions & 86 deletions World.tscn

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Checkpoint.tscn → World/Checkpoint.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[gd_scene load_steps=8 format=2]

[ext_resource path="res://tiles_packed.png" type="Texture" id=1]
[ext_resource path="res://Checkpoint.gd" type="Script" id=2]
[ext_resource path="res://World/Checkpoint.gd" type="Script" id=2]

[sub_resource type="AtlasTexture" id=1]
atlas = ExtResource( 1 )
Expand Down
9 changes: 9 additions & 0 deletions World/Door.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends Area2D

export(String, FILE, "*.tscn") var target_level_path = ""


func _on_Door_body_entered(body):
if not body is Player: return
if target_level_path.empty(): return
get_tree().change_scene(target_level_path)
24 changes: 24 additions & 0 deletions World/Door.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[gd_scene load_steps=4 format=2]

[ext_resource path="res://World/Door.gd" type="Script" id=1]
[ext_resource path="res://tiles_packed.png" type="Texture" id=2]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 7, 10.5 )

[node name="Door" type="Area2D"]
collision_layer = 0
collision_mask = 2
script = ExtResource( 1 )

[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -11 )
texture = ExtResource( 2 )
region_enabled = true
region_rect = Rect2( 180, 103, 18, 23 )

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

[connection signal="body_entered" from="." to="." method="_on_Door_body_entered"]
File renamed without changes.
2 changes: 1 addition & 1 deletion Ladder.tscn → World/Ladder.tscn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[gd_scene load_steps=4 format=2]

[ext_resource path="res://tiles_packed.png" type="Texture" id=1]
[ext_resource path="res://Ladder.gd" type="Script" id=2]
[ext_resource path="res://World/Ladder.gd" type="Script" id=2]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 9, 9 )
Expand Down
File renamed without changes.
Loading

0 comments on commit e17ad3d

Please sign in to comment.