Skip to content

Commit 8d16784

Browse files
committed
Successfully built a prototype
1 parent 182f431 commit 8d16784

19 files changed

+1026
-1
lines changed

Executable.pck

60.7 KB
Binary file not shown.

Executable.x86_64

40.4 MB
Binary file not shown.

Executable_WIN.exe

35.1 MB
Binary file not shown.

Executable_WIN.pck

60.7 KB
Binary file not shown.

GodotSrc/Dragable.gd

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
extends Area2D
2+
3+
4+
# Declare member variables here. Examples:
5+
# var a = 2
6+
# var b = "text"
7+
8+
onready var dragMouse = false
9+
# Called when the node enters the scene tree for the first time.
10+
func _ready():
11+
pass # Replace with function body.
12+
13+
func _on_Dragable_input_event(_viewport, event, _shape_idx):
14+
if event is InputEventMouseButton:
15+
if event.is_pressed():
16+
dragMouse = true
17+
else:
18+
dragMouse = false
19+
20+
# Called every frame. 'delta' is the elapsed time since the previous frame.
21+
func _process(_delta):
22+
if(dragMouse):
23+
set_position(get_viewport().get_mouse_position())
24+
25+
var bodies = get_overlapping_bodies()
26+
for body in bodies:
27+
if body.name == "Player":
28+
free()
29+
30+
31+
func _on_Dragable_area_exited():
32+
hide()

GodotSrc/Dragable.tscn

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[gd_scene load_steps=4 format=2]
2+
3+
[ext_resource path="res://assets/sprites/background/wooden_crate.png" type="Texture" id=1]
4+
[ext_resource path="res://Dragable.gd" type="Script" id=2]
5+
6+
[sub_resource type="RectangleShape2D" id=1]
7+
8+
[node name="Dragable" type="Area2D"]
9+
script = ExtResource( 2 )
10+
11+
[node name="Sprite" type="Sprite" parent="."]
12+
texture = ExtResource( 1 )
13+
14+
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
15+
shape = SubResource( 1 )
16+
[connection signal="area_exited" from="." to="." method="_on_Dragable_area_exited"]
17+
[connection signal="input_event" from="." to="." method="_on_Dragable_input_event"]

GodotSrc/Level1.tscn

+29-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1-
[gd_scene format=2]
1+
[gd_scene load_steps=6 format=2]
2+
3+
[ext_resource path="res://Player.tscn" type="PackedScene" id=1]
4+
[ext_resource path="res://TileMaps/Platforms TileMap.tscn" type="PackedScene" id=2]
5+
[ext_resource path="res://NextLevel.tscn" type="PackedScene" id=3]
6+
[ext_resource path="res://TileMaps/Pipes TileMap.tscn" type="PackedScene" id=4]
7+
[ext_resource path="res://Dragable.tscn" type="PackedScene" id=5]
28

39
[node name="Level1" type="Node2D"]
10+
__meta__ = {
11+
"_edit_vertical_guides_": [ ]
12+
}
13+
14+
[node name="Player" parent="." instance=ExtResource( 1 )]
15+
position = Vector2( 9.31046, -7.9474 )
16+
17+
[node name="Platforms TileMap" parent="." instance=ExtResource( 2 )]
18+
tile_data = PoolIntArray( 65535, 0, 196611, 131071, 0, 196612, 65536, 0, 327685, 65537, 0, 393218, 196607, 0, 65536, 131072, 0, 65538, 262143, 0, 65536, 196608, 0, 65538, 327679, 0, 65536, 262144, 0, 65538, 262162, 0, 393216, 262163, 0, 5, 393215, 0, 65536, 327680, 0, 65538, 327699, 0, 262147, 458751, 0, 65536, 393216, 0, 65538, 393235, 0, 262147, 524287, 0, 65536, 458752, 0, 65538, 458771, 0, 262147, 589823, 0, 65536, 524288, 0, 65538, 524307, 0, 262147, 655359, 0, 65536, 589824, 0, 65538, 589843, 0, 262147, 720895, 0, 65536, 655360, 0, 65538, 655379, 0, 262147, 786431, 0, 65536, 720896, 0, 65538, 720915, 0, 262147, 851966, 0, 393216, 851967, 0, 393220, 786432, 0, 131074, 786451, 0, 327683 )
19+
20+
[node name="Pipes TileMap" parent="." instance=ExtResource( 4 )]
21+
22+
[node name="Dragable" parent="." instance=ExtResource( 5 )]
23+
position = Vector2( 179.321, 101.81 )
24+
25+
[node name="Dragable2" parent="." instance=ExtResource( 5 )]
26+
position = Vector2( 263.504, 65.4066 )
27+
28+
[node name="NextLevel" parent="." instance=ExtResource( 3 )]
29+
next_scene = "res://Level2.tscn"
30+
[connection signal="body_entered" from="Dragable" to="Player" method="_on_Dragable_body_entered"]
31+
[connection signal="body_entered" from="Dragable2" to="Player" method="_on_Dragable_body_entered"]

GodotSrc/Level2.tscn

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[gd_scene load_steps=5 format=2]
2+
3+
[ext_resource path="res://Player.tscn" type="PackedScene" id=1]
4+
[ext_resource path="res://TileMaps/Platforms TileMap.tscn" type="PackedScene" id=2]
5+
[ext_resource path="res://NextLevel.tscn" type="PackedScene" id=3]
6+
[ext_resource path="res://Dragable.tscn" type="PackedScene" id=4]
7+
8+
[node name="Level2" type="Node2D"]
9+
10+
[node name="Player" parent="." instance=ExtResource( 1 )]
11+
position = Vector2( 8, 16 )
12+
13+
[node name="NextLevel" parent="." instance=ExtResource( 3 )]
14+
position = Vector2( 312, 104 )
15+
next_scene = "res://Level1.tscn"
16+
17+
[node name="Dragable" parent="." instance=ExtResource( 4 )]
18+
position = Vector2( 184, 120 )
19+
20+
[node name="Dragable2" parent="." instance=ExtResource( 4 )]
21+
position = Vector2( 72, 88 )
22+
23+
[node name="Platforms TileMap" parent="." instance=ExtResource( 2 )]
24+
tile_data = PoolIntArray( 196607, 0, 3, 131072, 0, 393218, 262143, 0, 262147, 327679, 0, 262147, 393215, 0, 262147, 458751, 0, 196612, 393216, 0, 327685, 393217, 0, 393217, 393218, 0, 393217, 393219, 0, 393217, 393220, 0, 393218, 524287, 0, 65536, 458752, 0, 65538, 458769, 0, 393216, 458770, 0, 393217, 458771, 0, 393217, 458772, 0, 5, 589823, 0, 65536, 524288, 0, 65538, 524299, 0, 196611, 524308, 0, 262147, 655359, 0, 65536, 589824, 0, 65538, 589835, 0, 262147, 589840, 0, 196611, 589844, 0, 262147, 720895, 0, 65536, 655360, 0, 327680, 655361, 0, 1, 655362, 0, 1, 655363, 0, 1, 655364, 0, 1, 655365, 0, 1, 655366, 0, 1, 655367, 0, 1, 655368, 0, 1, 655369, 0, 1, 655370, 0, 1, 655371, 0, 327681, 655372, 0, 1, 655373, 0, 1, 655374, 0, 1, 655375, 0, 1, 655376, 0, 327681, 655377, 0, 1, 655378, 0, 1, 655379, 0, 1, 655380, 0, 196613, 786431, 0, 131072, 720896, 0, 131073, 720897, 0, 131073, 720898, 0, 131073, 720899, 0, 131073, 720900, 0, 131073, 720901, 0, 131073, 720902, 0, 131073, 720903, 0, 131073, 720904, 0, 131073, 720905, 0, 131073, 720906, 0, 131073, 720907, 0, 131073, 720908, 0, 131073, 720909, 0, 131073, 720910, 0, 131073, 720911, 0, 131073, 720912, 0, 131073, 720913, 0, 131073, 720914, 0, 131073, 720915, 0, 131073, 720916, 0, 131074 )
25+
[connection signal="body_entered" from="Dragable" to="Player" method="_on_Dragable_body_entered"]
26+
[connection signal="body_entered" from="Dragable2" to="Player" method="_on_Dragable_body_entered"]

GodotSrc/NextLevel.gd

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
extends Area2D
2+
3+
export(String, FILE, "*.tscn") var next_scene
4+
5+
func _physics_process(delta):
6+
var bodies = get_overlapping_bodies()
7+
8+
for body in bodies:
9+
if body.name == "Player":
10+
get_tree().change_scene(next_scene)

GodotSrc/NextLevel.tscn

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[gd_scene load_steps=4 format=2]
2+
3+
[ext_resource path="res://NextLevel.gd" type="Script" id=1]
4+
[ext_resource path="res://assets/sprites/background/NextLevel.png" type="Texture" id=2]
5+
6+
[sub_resource type="RectangleShape2D" id=1]
7+
extents = Vector2( 10, 32.06 )
8+
9+
[node name="NextLevel" type="Area2D"]
10+
position = Vector2( 311.198, 56.3896 )
11+
script = ExtResource( 1 )
12+
__meta__ = {
13+
"_edit_group_": true
14+
}
15+
16+
[node name="Sprite" type="Sprite" parent="."]
17+
texture = ExtResource( 2 )
18+
19+
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
20+
position = Vector2( -1.16229, -24.2139 )
21+
shape = SubResource( 1 )

GodotSrc/Player.gd

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
extends KinematicBody2D
2+
3+
const ACCELERATION = 10
4+
const GRAVITY = 100
5+
const MAX_SPEED = 60
6+
const FRICTION = 0.25
7+
const JUMP_FORCE = 120
8+
9+
var motion = Vector2.ZERO
10+
11+
onready var animationPlayer = $AnimationPlayer
12+
13+
func _physics_process(delta):
14+
15+
motion.x += ACCELERATION * delta
16+
17+
motion.y += GRAVITY * delta
18+
19+
if is_on_floor():
20+
animationPlayer.play("Walk")
21+
22+
motion = move_and_slide(motion, Vector2.UP)
23+
24+
func _on_Dragable_body_entered(node):
25+
26+
if(node.name == "Player"):
27+
node.motion.y = -120
28+
node.animationPlayer.play("Jump")
29+
30+

GodotSrc/Player.tscn

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
[gd_scene load_steps=7 format=2]
2+
3+
[ext_resource path="res://assets/sprites/player/sprite sheets/PlayerSpriteSheet.png" type="Texture" id=1]
4+
[ext_resource path="res://Player.gd" type="Script" id=2]
5+
6+
[sub_resource type="CapsuleShape2D" id=1]
7+
radius = 4.80831
8+
height = 7.53655
9+
10+
[sub_resource type="Animation" id=2]
11+
resource_name = "Idle"
12+
length = 0.4
13+
loop = true
14+
tracks/0/type = "value"
15+
tracks/0/path = NodePath("Sprite:frame")
16+
tracks/0/interp = 1
17+
tracks/0/loop_wrap = true
18+
tracks/0/imported = false
19+
tracks/0/enabled = true
20+
tracks/0/keys = {
21+
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4 ),
22+
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
23+
"update": 1,
24+
"values": [ 0, 1, 2, 3, 0 ]
25+
}
26+
27+
[sub_resource type="Animation" id=3]
28+
resource_name = "Jump"
29+
length = 0.4
30+
tracks/0/type = "value"
31+
tracks/0/path = NodePath("Sprite:frame")
32+
tracks/0/interp = 1
33+
tracks/0/loop_wrap = true
34+
tracks/0/imported = false
35+
tracks/0/enabled = true
36+
tracks/0/keys = {
37+
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4 ),
38+
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
39+
"update": 1,
40+
"values": [ 8, 9, 10, 11, 7 ]
41+
}
42+
43+
[sub_resource type="Animation" id=4]
44+
resource_name = "Walk"
45+
length = 0.4
46+
loop = true
47+
tracks/0/type = "value"
48+
tracks/0/path = NodePath("Sprite:frame")
49+
tracks/0/interp = 1
50+
tracks/0/loop_wrap = true
51+
tracks/0/imported = false
52+
tracks/0/enabled = true
53+
tracks/0/keys = {
54+
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4 ),
55+
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
56+
"update": 1,
57+
"values": [ 4, 5, 6, 7, 4 ]
58+
}
59+
60+
[node name="Player" type="KinematicBody2D"]
61+
position = Vector2( -0.269234, 0.35898 )
62+
script = ExtResource( 2 )
63+
64+
[node name="Sprite" type="Sprite" parent="."]
65+
texture = ExtResource( 1 )
66+
hframes = 12
67+
68+
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
69+
position = Vector2( 0.987194, 6.37189 )
70+
shape = SubResource( 1 )
71+
72+
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
73+
anims/Idle = SubResource( 2 )
74+
anims/Jump = SubResource( 3 )
75+
anims/Walk = SubResource( 4 )

GodotSrc/TileMaps/Pipes TileMap.tscn

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
[gd_scene load_steps=14 format=2]
2+
3+
[ext_resource path="res://assets/sprites/background/prop pack.png" type="Texture" id=1]
4+
5+
[sub_resource type="ConvexPolygonShape2D" id=67]
6+
points = PoolVector2Array( 0, 4, 16, 4, 16, 12, 0, 12 )
7+
8+
[sub_resource type="ConvexPolygonShape2D" id=68]
9+
points = PoolVector2Array( 4, 16, 4, 4, 16, 4, 16, 12, 12, 12, 12, 16 )
10+
11+
[sub_resource type="ConvexPolygonShape2D" id=69]
12+
points = PoolVector2Array( 12, 0, 12, 16, 4, 16, 4, 0 )
13+
14+
[sub_resource type="ConvexPolygonShape2D" id=70]
15+
points = PoolVector2Array( 12, 0, 12, 0, 12, 4, 16, 4, 16, 12, 4, 12, 4, 0 )
16+
17+
[sub_resource type="ConvexPolygonShape2D" id=71]
18+
points = PoolVector2Array( 0, 4, 12, 4, 12, 16, 4, 16, 4, 16, 4, 16, 4, 12, 0, 12 )
19+
20+
[sub_resource type="ConvexPolygonShape2D" id=72]
21+
points = PoolVector2Array( 0, 4, 4, 4, 4, 0, 12, 0, 12, 12, 0, 12 )
22+
23+
[sub_resource type="ConvexPolygonShape2D" id=73]
24+
points = PoolVector2Array( 0, 4, 16, 4, 16, 12, 12, 12, 12, 16, 4, 16, 4, 12, 0, 12 )
25+
26+
[sub_resource type="ConvexPolygonShape2D" id=74]
27+
points = PoolVector2Array( 12, 0, 12, 4, 16, 4, 16, 12, 12, 12, 12, 16, 4, 16, 4, 12, 0, 12, 0, 4, 4, 4, 4, 0 )
28+
29+
[sub_resource type="ConvexPolygonShape2D" id=75]
30+
points = PoolVector2Array( 12, 0, 12, 4, 16, 4, 16, 4, 16, 12, 0, 12, 0, 4, 4, 4, 4, 0 )
31+
32+
[sub_resource type="ConvexPolygonShape2D" id=76]
33+
points = PoolVector2Array( 12, 0, 12, 4, 16, 4, 16, 12, 12, 12, 12, 12, 12, 16, 4, 16, 4, 0 )
34+
35+
[sub_resource type="ConvexPolygonShape2D" id=77]
36+
points = PoolVector2Array( 4, 0, 12, 0, 12, 16, 4, 16, 4, 12, 0, 12, 0, 4, 4, 4 )
37+
38+
[sub_resource type="TileSet" id=78]
39+
0/name = "pipes"
40+
0/texture = ExtResource( 1 )
41+
0/tex_offset = Vector2( 0, 0 )
42+
0/modulate = Color( 1, 1, 1, 1 )
43+
0/region = Rect2( 48, 32, 96, 32 )
44+
0/tile_mode = 1
45+
0/autotile/bitmask_mode = 1
46+
0/autotile/bitmask_flags = [ Vector2( 0, 0 ), 56, Vector2( 0, 1 ), 146, Vector2( 1, 0 ), 176, Vector2( 1, 1 ), 50, Vector2( 2, 0 ), 152, Vector2( 2, 1 ), 26, Vector2( 3, 0 ), 184, Vector2( 3, 1 ), 186, Vector2( 4, 0 ), 58, Vector2( 4, 1 ), 154, Vector2( 5, 0 ), 178 ]
47+
0/autotile/icon_coordinate = Vector2( 0, 0 )
48+
0/autotile/tile_size = Vector2( 16, 16 )
49+
0/autotile/spacing = 0
50+
0/autotile/occluder_map = [ ]
51+
0/autotile/navpoly_map = [ ]
52+
0/autotile/priority_map = [ ]
53+
0/autotile/z_index_map = [ ]
54+
0/occluder_offset = Vector2( 0, 0 )
55+
0/navigation_offset = Vector2( 0, 0 )
56+
0/shape_offset = Vector2( 0, 0 )
57+
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
58+
0/shape = SubResource( 67 )
59+
0/shape_one_way = false
60+
0/shape_one_way_margin = 1.0
61+
0/shapes = [ {
62+
"autotile_coord": Vector2( 0, 0 ),
63+
"one_way": false,
64+
"one_way_margin": 1.0,
65+
"shape": SubResource( 67 ),
66+
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
67+
}, {
68+
"autotile_coord": Vector2( 1, 0 ),
69+
"one_way": false,
70+
"one_way_margin": 1.0,
71+
"shape": SubResource( 68 ),
72+
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
73+
}, {
74+
"autotile_coord": Vector2( 0, 1 ),
75+
"one_way": false,
76+
"one_way_margin": 1.0,
77+
"shape": SubResource( 69 ),
78+
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
79+
}, {
80+
"autotile_coord": Vector2( 1, 1 ),
81+
"one_way": false,
82+
"one_way_margin": 1.0,
83+
"shape": SubResource( 70 ),
84+
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
85+
}, {
86+
"autotile_coord": Vector2( 2, 0 ),
87+
"one_way": false,
88+
"one_way_margin": 1.0,
89+
"shape": SubResource( 71 ),
90+
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
91+
}, {
92+
"autotile_coord": Vector2( 2, 1 ),
93+
"one_way": false,
94+
"one_way_margin": 1.0,
95+
"shape": SubResource( 72 ),
96+
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
97+
}, {
98+
"autotile_coord": Vector2( 3, 0 ),
99+
"one_way": false,
100+
"one_way_margin": 1.0,
101+
"shape": SubResource( 73 ),
102+
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
103+
}, {
104+
"autotile_coord": Vector2( 3, 1 ),
105+
"one_way": false,
106+
"one_way_margin": 1.0,
107+
"shape": SubResource( 74 ),
108+
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
109+
}, {
110+
"autotile_coord": Vector2( 4, 0 ),
111+
"one_way": false,
112+
"one_way_margin": 1.0,
113+
"shape": SubResource( 75 ),
114+
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
115+
}, {
116+
"autotile_coord": Vector2( 5, 0 ),
117+
"one_way": false,
118+
"one_way_margin": 1.0,
119+
"shape": SubResource( 76 ),
120+
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
121+
}, {
122+
"autotile_coord": Vector2( 4, 1 ),
123+
"one_way": false,
124+
"one_way_margin": 1.0,
125+
"shape": SubResource( 77 ),
126+
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
127+
} ]
128+
0/z_index = 0
129+
130+
[node name="Pipes TileMap" type="TileMap"]
131+
tile_set = SubResource( 78 )
132+
cell_size = Vector2( 16, 16 )
133+
format = 1

0 commit comments

Comments
 (0)