Uploading to gitea

This commit is contained in:
Cidoku 2021-05-27 01:44:39 -04:00
parent 2ad4c13afe
commit 60a360a566
94 changed files with 4335 additions and 0 deletions

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Cidoku
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/bgBlue.png-e1d230ab3d1611fb86a3fbf65fd2ede5.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/background/bgBlue.png"
dest_files=[ "res://.import/bgBlue.png-e1d230ab3d1611fb86a3fbf65fd2ede5.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/bgPaper.png-77ae5556fc7b8feab3a602e1f6637571.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/background/bgPaper.png"
dest_files=[ "res://.import/bgPaper.png-77ae5556fc7b8feab3a602e1f6637571.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/bgPurpleMountains.png-1c1f7be17a010adac722b3c8a7b3bcd6.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/background/bgPurpleMountains.png"
dest_files=[ "res://.import/bgPurpleMountains.png-1c1f7be17a010adac722b3c8a7b3bcd6.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/bgTrash.png-2034718f46c861b565400315ab38cf47.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/background/bgTrash.png"
dest_files=[ "res://.import/bgTrash.png-2034718f46c861b565400315ab38cf47.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/number.png-8186643b189d712cdefe49a5cdc1cf1a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/background/number.png"
dest_files=[ "res://.import/number.png-8186643b189d712cdefe49a5cdc1cf1a.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=1
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/title.png-270181e9eeeb805687c116ec0378697b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/background/title.png"
dest_files=[ "res://.import/title.png-270181e9eeeb805687c116ec0378697b.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

BIN
assets/art/key_yellow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 735 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/key_yellow.png-81f21a00e9d5898bd2cb155b9a39ecee.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/key_yellow.png"
dest_files=[ "res://.import/key_yellow.png-81f21a00e9d5898bd2cb155b9a39ecee.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

BIN
assets/art/lockeddoor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 941 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/lockeddoor.png-68e13279ac5204e54073b525654ccfa3.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/lockeddoor.png"
dest_files=[ "res://.import/lockeddoor.png-68e13279ac5204e54073b525654ccfa3.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 831 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/moving_platform.png-479aa8f802d1a4964b138893ada8d372.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/platforms/moving_platform.png"
dest_files=[ "res://.import/moving_platform.png-479aa8f802d1a4964b138893ada8d372.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 788 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/one_way_platform.png-aaf0179c7171228f27cb489e99e339bd.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/platforms/one_way_platform.png"
dest_files=[ "res://.import/one_way_platform.png-aaf0179c7171228f27cb489e99e339bd.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

BIN
assets/art/player/shiro.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/shiro.png-7107237621451b25b91db750ff79e425.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/player/shiro.png"
dest_files=[ "res://.import/shiro.png-7107237621451b25b91db750ff79e425.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/spring.png-7c1e294f5dc06a9611494f2760bd6687.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/spring/spring.png"
dest_files=[ "res://.import/spring.png-7c1e294f5dc06a9611494f2760bd6687.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/spring2.png-fc76700a279788238e022cf64d6de7d2.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/spring/spring2.png"
dest_files=[ "res://.import/spring2.png-fc76700a279788238e022cf64d6de7d2.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/tiles_gplexian.png-41e2a7736a2cf4ebc274467fa8ab77fb.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/tileset/tiles_gplexian.png"
dest_files=[ "res://.import/tiles_gplexian.png-41e2a7736a2cf4ebc274467fa8ab77fb.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View File

@ -0,0 +1,149 @@
[gd_resource type="TileSet" load_steps=8 format=2]
[ext_resource path="res://assets/art/tileset/tiles_gplexian.png" type="Texture" id=1]
[sub_resource type="ConvexPolygonShape2D" id=1]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=2]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[sub_resource type="ConvexPolygonShape2D" id=3]
points = PoolVector2Array( 0, 32, 32, 0, 32, 32 )
[sub_resource type="ConvexPolygonShape2D" id=4]
points = PoolVector2Array( 0, 32, 0, 0, 32, 32 )
[sub_resource type="ConvexPolygonShape2D" id=5]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32 )
[sub_resource type="ConvexPolygonShape2D" id=6]
points = PoolVector2Array( 0, 32, 0, 0, 32, 0 )
[resource]
0/name = "Solid"
0/texture = ExtResource( 1 )
0/tex_offset = Vector2( 0, 0 )
0/modulate = Color( 1, 1, 1, 1 )
0/region = Rect2( 0, 0, 32, 32 )
0/tile_mode = 0
0/occluder_offset = Vector2( 0, 0 )
0/navigation_offset = Vector2( 0, 0 )
0/shape_offset = Vector2( 0, 0 )
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
0/shape = SubResource( 1 )
0/shape_one_way = false
0/shape_one_way_margin = 1.0
0/shapes = [ {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 1 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
0/z_index = 0
1/name = "Oneway"
1/texture = ExtResource( 1 )
1/tex_offset = Vector2( 0, 0 )
1/modulate = Color( 1, 1, 1, 1 )
1/region = Rect2( 32, 0, 32, 32 )
1/tile_mode = 0
1/occluder_offset = Vector2( 0, 0 )
1/navigation_offset = Vector2( 0, 0 )
1/shape_offset = Vector2( 0, 0 )
1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
1/shape = SubResource( 2 )
1/shape_one_way = true
1/shape_one_way_margin = 1.0
1/shapes = [ {
"autotile_coord": Vector2( 0, 0 ),
"one_way": true,
"one_way_margin": 1.0,
"shape": SubResource( 2 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
1/z_index = 0
2/name = "Slope1"
2/texture = ExtResource( 1 )
2/tex_offset = Vector2( 0, 0 )
2/modulate = Color( 1, 1, 1, 1 )
2/region = Rect2( 64, 0, 32, 32 )
2/tile_mode = 0
2/occluder_offset = Vector2( 0, 0 )
2/navigation_offset = Vector2( 0, 0 )
2/shape_offset = Vector2( 0, 0 )
2/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
2/shape = SubResource( 3 )
2/shape_one_way = false
2/shape_one_way_margin = 1.0
2/shapes = [ {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 3 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
2/z_index = 0
3/name = "Slope2"
3/texture = ExtResource( 1 )
3/tex_offset = Vector2( 0, 0 )
3/modulate = Color( 1, 1, 1, 1 )
3/region = Rect2( 96, 0, 32, 32 )
3/tile_mode = 0
3/occluder_offset = Vector2( 0, 0 )
3/navigation_offset = Vector2( 0, 0 )
3/shape_offset = Vector2( 0, 0 )
3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
3/shape = SubResource( 4 )
3/shape_one_way = false
3/shape_one_way_margin = 1.0
3/shapes = [ {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 4 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
3/z_index = 0
4/name = "Slope3"
4/texture = ExtResource( 1 )
4/tex_offset = Vector2( 0, 0 )
4/modulate = Color( 1, 1, 1, 1 )
4/region = Rect2( 64, 32, 32, 32 )
4/tile_mode = 0
4/occluder_offset = Vector2( 0, 0 )
4/navigation_offset = Vector2( 0, 0 )
4/shape_offset = Vector2( 0, 0 )
4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
4/shape = SubResource( 5 )
4/shape_one_way = false
4/shape_one_way_margin = 1.0
4/shapes = [ {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 5 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
4/z_index = 0
5/name = "Slope4"
5/texture = ExtResource( 1 )
5/tex_offset = Vector2( 0, 0 )
5/modulate = Color( 1, 1, 1, 1 )
5/region = Rect2( 96, 32, 32, 32 )
5/tile_mode = 0
5/occluder_offset = Vector2( 0, 0 )
5/navigation_offset = Vector2( 0, 0 )
5/shape_offset = Vector2( 0, 0 )
5/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
5/shape = SubResource( 6 )
5/shape_one_way = false
5/shape_one_way_margin = 1.0
5/shapes = [ {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 6 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
5/z_index = 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/touch_button_fire.png-8b72c42a8cb252207ce8948d4b623690.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/ui/touch_button_fire.png"
dest_files=[ "res://.import/touch_button_fire.png-8b72c42a8cb252207ce8948d4b623690.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/touch_button_jump.png-f72afeb370538aa951853dbc52052250.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/ui/touch_button_jump.png"
dest_files=[ "res://.import/touch_button_jump.png-f72afeb370538aa951853dbc52052250.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/touch_button_left.png-e48f16cfdaae98fdc92a21f20c157c53.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/ui/touch_button_left.png"
dest_files=[ "res://.import/touch_button_left.png-e48f16cfdaae98fdc92a21f20c157c53.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/touch_button_right.png-74bf87a3a0fa663fbb3574844de31372.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/art/ui/touch_button_right.png"
dest_files=[ "res://.import/touch_button_right.png-74bf87a3a0fa663fbb3574844de31372.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

View File

@ -0,0 +1,15 @@
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/44 - Holiday.ogg-1c4418d27badd2dc7a3746daa95591d8.oggstr"
[deps]
source_file="res://assets/audio/music/44 - Holiday.ogg"
dest_files=[ "res://.import/44 - Holiday.ogg-1c4418d27badd2dc7a3746daa95591d8.oggstr" ]
[params]
loop=true
loop_offset=0

BIN
assets/audio/sfx/bounce.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/bounce.wav-116ec0c186efc1d94999a60e89d9455b.sample"
[deps]
source_file="res://assets/audio/sfx/bounce.wav"
dest_files=[ "res://.import/bounce.wav-116ec0c186efc1d94999a60e89d9455b.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=false
compress/mode=0

BIN
assets/audio/sfx/get.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/get.wav-0599a7bea953cbbb113965d577ade8c6.sample"
[deps]
source_file="res://assets/audio/sfx/get.wav"
dest_files=[ "res://.import/get.wav-0599a7bea953cbbb113965d577ade8c6.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=false
compress/mode=0

BIN
assets/audio/sfx/select.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/select.wav-af2903b06cf15cf6ef52b2f849759cb4.sample"
[deps]
source_file="res://assets/audio/sfx/select.wav"
dest_files=[ "res://.import/select.wav-af2903b06cf15cf6ef52b2f849759cb4.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=false
compress/mode=0

View File

@ -0,0 +1,9 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://assets/theme/fonts/PressStart2P-Regular.ttf" type="DynamicFontData" id=1]
[resource]
size = 8
outline_size = 1
outline_color = Color( 0, 0, 0, 1 )
font_data = ExtResource( 1 )

Binary file not shown.

View File

@ -0,0 +1,9 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://assets/theme/fonts/binary.x-chr-brk.ttf" type="DynamicFontData" id=1]
[resource]
size = 20
outline_size = 1
outline_color = Color( 0, 0, 0, 1 )
font_data = ExtResource( 1 )

Binary file not shown.

View File

@ -0,0 +1,83 @@
[gd_resource type="Theme" load_steps=8 format=2]
[ext_resource path="res://assets/theme/fonts/PressStart2P-Regular.ttf" type="DynamicFontData" id=1]
[sub_resource type="StyleBoxFlat" id=1]
content_margin_left = 6.0
content_margin_right = 6.0
content_margin_top = 4.0
content_margin_bottom = 4.0
bg_color = Color( 0.18, 0.207, 0.279, 1 )
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color( 0.14, 0.161, 0.217, 1 )
[sub_resource type="StyleBoxFlat" id=2]
content_margin_left = 6.0
content_margin_right = 6.0
content_margin_top = 4.0
content_margin_bottom = 4.0
bg_color = Color( 0.15, 0.1725, 0.2325, 1 )
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color( 0.41, 0.61, 0.91, 1 )
[sub_resource type="StyleBoxFlat" id=3]
content_margin_left = 6.0
content_margin_right = 6.0
content_margin_top = 4.0
content_margin_bottom = 4.0
bg_color = Color( 0.15, 0.1725, 0.2325, 1 )
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color( 0.4, 0.4225, 0.4825, 1 )
[sub_resource type="StyleBoxFlat" id=4]
content_margin_left = 6.0
content_margin_right = 6.0
content_margin_top = 4.0
content_margin_bottom = 4.0
bg_color = Color( 0.15, 0.1725, 0.2325, 1 )
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color( 0.125, 0.14375, 0.19375, 1 )
[sub_resource type="StyleBoxFlat" id=5]
content_margin_left = 6.0
content_margin_right = 6.0
content_margin_top = 4.0
content_margin_bottom = 4.0
bg_color = Color( 0.15, 0.1725, 0.2325, 1 )
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color( 0.41, 0.61, 0.91, 1 )
[sub_resource type="DynamicFont" id=6]
size = 8
font_data = ExtResource( 1 )
[resource]
default_font = SubResource( 6 )
Button/colors/font_color = Color( 0.8, 0.8075, 0.8275, 1 )
Button/colors/font_color_disabled = Color( 1, 1, 1, 0.3 )
Button/colors/font_color_hover = Color( 0.88, 0.8845, 0.8965, 1 )
Button/colors/font_color_pressed = Color( 0.41, 0.61, 0.91, 1 )
Button/colors/icon_color_hover = Color( 1.15, 1.15, 1.15, 1 )
Button/colors/icon_color_pressed = Color( 0.4715, 0.7015, 1.0465, 1 )
Button/constants/hseparation = 2
Button/fonts/font = null
Button/styles/disabled = SubResource( 1 )
Button/styles/focus = SubResource( 2 )
Button/styles/hover = SubResource( 3 )
Button/styles/normal = SubResource( 4 )
Button/styles/pressed = SubResource( 5 )

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

34
icon.png.import Normal file
View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

184
project.godot Normal file
View File

@ -0,0 +1,184 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
_global_script_classes=[ {
"base": "KinematicBody2D",
"class": "Actor",
"language": "GDScript",
"path": "res://src/Actors/Actor.gd"
}, {
"base": "Area2D",
"class": "Coin",
"language": "GDScript",
"path": "res://src/Objects/Coin.gd"
}, {
"base": "Actor",
"class": "Enemy",
"language": "GDScript",
"path": "res://src/Actors/Enemy.gd"
}, {
"base": "Actor",
"class": "Player",
"language": "GDScript",
"path": "res://src/Actors/Player.gd"
} ]
_global_script_class_icons={
"Actor": "",
"Coin": "",
"Enemy": "",
"Player": ""
}
[application]
config/name="Shirogami's Maze"
run/main_scene="res://src/Main/Game.tscn"
config/icon="res://icon.png"
target_fps="60"
[autoload]
global="*res://src/globals.gd"
[debug]
gdscript/warnings/enable=false
gdscript/completion/autocomplete_setters_and_getters=true
gdscript/warnings/return_value_discarded=false
[display]
window/size/width=320
window/size/height=240
window/size/test_width=640
window/size/test_height=480
window/dpi/allow_hidpi=true
window/vsync/vsync_via_compositor=true
window/stretch/mode="2d"
window/stretch/aspect="keep"
stretch/aspect="keep_height"
stretch/mode="2d"
[gdnative]
singletons=[ ]
[image_loader]
repeat=false
[importer_defaults]
texture={
"compress/bptc_ldr": 0,
"compress/hdr_mode": 0,
"compress/lossy_quality": 0.7,
"compress/mode": 0,
"compress/normal_map": 0,
"detect_3d": false,
"flags/anisotropic": false,
"flags/filter": false,
"flags/mipmaps": false,
"flags/repeat": 0,
"flags/srgb": 2,
"process/HDR_as_SRGB": false,
"process/fix_alpha_border": true,
"process/invert_color": false,
"process/premult_alpha": false,
"size_limit": 0,
"stream": false,
"svg/scale": 1.0
}
[input]
ui_cancel={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":88,"unicode":0,"echo":false,"script":null)
]
}
jump={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"unicode":0,"echo":false,"script":null)
]
}
move_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
]
}
move_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
]
}
shoot={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":2,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"unicode":0,"echo":false,"script":null)
]
}
toggle_fullscreen={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777254,"unicode":0,"echo":false,"script":null)
]
}
toggle_pause={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null)
]
}
[layer_names]
2d_physics/layer_1="player"
2d_physics/layer_2="enemies"
2d_physics/layer_3="coins"
2d_physics/layer_4="platforms"
2d_physics/layer_5="ground"
[physics]
2d/default_gravity=900
[rasterizer]
use_pixel_snap=true
[render]
mipmap_policy=1
[rendering]
quality/intended_usage/framebuffer_allocation=0
quality/intended_usage/framebuffer_allocation.mobile=1
quality/2d/use_pixel_snap=true
quality/filters/anisotropic_filter_level=2
quality/filters/use_nearest_mipmap_filter=true
quality/depth/hdr=false
[texture_import]
filter=false

18
src/Actors/Actor.gd Normal file
View File

@ -0,0 +1,18 @@
class_name Actor
extends KinematicBody2D
# Both the Player and Enemy inherit this scene as they have shared behaviours
# such as speed and are affected by gravity.
export var speed = Vector2(150.0, 350.0)
onready var gravity = ProjectSettings.get("physics/2d/default_gravity")
const FLOOR_NORMAL = Vector2.UP
var _velocity = Vector2.ZERO
# _physics_process is called after the inherited _physics_process function.
# This allows the Player and Enemy scenes to be affected by gravity.
func _physics_process(delta):
_velocity.y += gravity * delta

79
src/Actors/Enemy.gd Normal file
View File

@ -0,0 +1,79 @@
class_name Enemy
extends Actor
enum State {
WALKING,
DEAD
}
var _state = State.WALKING
onready var platform_detector = $PlatformDetector
onready var floor_detector_left = $FloorDetectorLeft
onready var floor_detector_right = $FloorDetectorRight
onready var sprite = $Sprite
onready var animation_player = $AnimationPlayer
# This function is called when the scene enters the scene tree.
# We can initialize variables here.
func _ready():
_velocity.x = speed.x
# Physics process is a built-in loop in Godot.
# If you define _physics_process on a node, Godot will call it every frame.
# At a glance, you can see that the physics process loop:
# 1. Calculates the move velocity.
# 2. Moves the character.
# 3. Updates the sprite direction.
# 4. Updates the animation.
# Splitting the physics process logic into functions not only makes it
# easier to read, it help to change or improve the code later on:
# - If you need to change a calculation, you can use Go To -> Function
# (Ctrl Alt F) to quickly jump to the corresponding function.
# - If you split the character into a state machine or more advanced pattern,
# you can easily move individual functions.
func _physics_process(_delta):
_velocity = calculate_move_velocity(_velocity)
# We only update the y value of _velocity as we want to handle the horizontal movement ourselves.
_velocity.y = move_and_slide(_velocity, FLOOR_NORMAL).y
# We flip the Sprite depending on which way the enemy is moving.
sprite.scale.x = 1 if _velocity.x > 0 else -1
var animation = get_new_animation()
if animation != animation_player.current_animation:
animation_player.play(animation)
# This function calculates a new velocity whenever you need it.
# If the enemy encounters a wall or an edge, the horizontal velocity is flipped.
func calculate_move_velocity(linear_velocity):
var velocity = linear_velocity
if not floor_detector_left.is_colliding():
velocity.x = speed.x
elif not floor_detector_right.is_colliding():
velocity.x = -speed.x
if is_on_wall():
velocity.x *= -1
return velocity
func destroy():
_state = State.DEAD
_velocity = Vector2.ZERO
func get_new_animation():
var animation_new = ""
if _state == State.WALKING:
animation_new = "walk" if abs(_velocity.x) > 0 else "idle"
else:
animation_new = "destroy"
return animation_new

259
src/Actors/Enemy.tscn Normal file
View File

@ -0,0 +1,259 @@
[gd_scene load_steps=15 format=2]
[ext_resource path="res://assets/art/player/bullet/bullet.png" type="Texture" id=1]
[ext_resource path="res://assets/audio/sfx/explode.wav" type="AudioStream" id=2]
[ext_resource path="res://assets/audio/sfx/hit.wav" type="AudioStream" id=3]
[ext_resource path="res://assets/art/enemy/enemy.png" type="Texture" id=4]
[ext_resource path="res://src/Actors/Enemy.gd" type="Script" id=5]
[sub_resource type="CanvasItemMaterial" id=1]
[sub_resource type="Animation" id=2]
resource_name = "destroy"
length = 1.5
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 7 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Sprite:rotation_degrees")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.8 ),
"transitions": PoolRealArray( 0.0796601, 1 ),
"update": 0,
"values": [ 0.0, 180.0 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Sprite:self_modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0, 0.5, 1.1 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Explosion:emitting")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 1,
"values": [ false, true ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Explosion:process_material:scale")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0.6, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ 1.0, 4.0 ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Hit:playing")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0.00999999 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/6/type = "value"
tracks/6/path = NodePath("Explode:playing")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/keys = {
"times": PoolRealArray( 0.8 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/7/type = "method"
tracks/7/path = NodePath(".")
tracks/7/interp = 1
tracks/7/loop_wrap = true
tracks/7/imported = false
tracks/7/enabled = true
tracks/7/keys = {
"times": PoolRealArray( 1.5 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "queue_free"
} ]
}
tracks/8/type = "value"
tracks/8/path = NodePath(".:collision_layer")
tracks/8/interp = 1
tracks/8/loop_wrap = true
tracks/8/imported = false
tracks/8/enabled = true
tracks/8/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 0 ]
}
tracks/9/type = "value"
tracks/9/path = NodePath("Sprite:position")
tracks/9/interp = 1
tracks/9/loop_wrap = true
tracks/9/imported = false
tracks/9/enabled = true
tracks/9/keys = {
"times": PoolRealArray( 0, 0.2, 0.4 ),
"transitions": PoolRealArray( 2.2974, 0.183011, 1 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( 0, -32 ), Vector2( 0, 0 ) ]
}
[sub_resource type="Animation" id=3]
length = 6.75
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.75, 1.5, 2.25, 3, 3.75, 4.5, 5.25, 6, 6.75 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 5, 6, 5, 6, 5, 6, 7, 6, 7, 5 ]
}
[sub_resource type="Animation" id=4]
length = 1.25
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1, 1.25 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 0, 1, 2, 3, 4, 0 ]
}
[sub_resource type="CapsuleShape2D" id=5]
radius = 11.0
height = 7.0
[sub_resource type="CanvasItemMaterial" id=6]
blend_mode = 1
[sub_resource type="Gradient" id=7]
offsets = PoolRealArray( 0.5, 1 )
colors = PoolColorArray( 1, 1, 1, 1, 0, 0, 0, 1 )
[sub_resource type="GradientTexture" id=8]
gradient = SubResource( 7 )
width = 256
[sub_resource type="ParticlesMaterial" id=9]
emission_shape = 1
emission_sphere_radius = 8.0
flag_disable_z = true
spread = 180.0
gravity = Vector3( 0, 250, 0 )
initial_velocity = 120.0
initial_velocity_random = 0.5
orbit_velocity = 0.0
orbit_velocity_random = 0.0
angle_random = 1.0
scale_random = 1.0
color_ramp = SubResource( 8 )
hue_variation = 0.05
hue_variation_random = 0.46
[node name="Enemy" type="KinematicBody2D"]
collision_layer = 2
collision_mask = 24
script = ExtResource( 5 )
speed = Vector2( 75, 250 )
[node name="PlatformDetector" type="RayCast2D" parent="."]
position = Vector2( 0, 6 )
enabled = true
cast_to = Vector2( 0, 8 )
collision_mask = 8
[node name="FloorDetectorLeft" type="RayCast2D" parent="."]
position = Vector2( -15, -4 )
enabled = true
cast_to = Vector2( 0, 35 )
collision_mask = 24
[node name="FloorDetectorRight" type="RayCast2D" parent="."]
position = Vector2( 15.5, -3 )
enabled = true
cast_to = Vector2( 0, 35 )
collision_mask = 24
[node name="Sprite" type="Sprite" parent="."]
material = SubResource( 1 )
texture = ExtResource( 4 )
flip_h = true
hframes = 8
frame = 7
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/destroy = SubResource( 2 )
anims/idle = SubResource( 3 )
anims/walk = SubResource( 4 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
rotation = -1.5708
shape = SubResource( 5 )
[node name="Explosion" type="Particles2D" parent="."]
self_modulate = Color( 1, 1, 1, 0.12 )
material = SubResource( 6 )
emitting = false
amount = 32
lifetime = 0.5
one_shot = true
speed_scale = 1.2
explosiveness = 0.76
draw_order = 215832976
process_material = SubResource( 9 )
texture = ExtResource( 1 )
[node name="Hit" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource( 3 )
[node name="Explode" type="AudioStreamPlayer2D" parent="."]
stream = ExtResource( 2 )

93
src/Actors/Player.gd Normal file
View File

@ -0,0 +1,93 @@
class_name Player
extends Actor
const FLOOR_DETECT_DISTANCE = 20.0
export(String) var action_suffix = ""
var bounce = false
var bounce_vec = Vector2(0,0)
onready var platform_detector = $PlatformDetector
onready var sprite = $Sprite
onready var animation_player = $AnimationPlayer
func _physics_process(_delta):
var direction = get_direction()
var is_jump_interrupted = (Input.is_action_just_released("jump" + action_suffix) and _velocity.y < 0.0) if !bounce else false
_velocity = calculate_move_velocity(_velocity, direction, speed, is_jump_interrupted,_delta)
if _velocity.y > 0.0:
bounce = false
if is_on_floor():
if bounce_vec != Vector2(0,0) and !bounce:
#print("OK")
bounce_vec = Vector2(0,0)
if Input.is_action_just_pressed("jump"):
$jump.play()
if is_on_ceiling():
if bounce_vec != Vector2(0,0):
bounce_vec = Vector2(bounce_vec.x,0)
var snap_vector = Vector2.DOWN * FLOOR_DETECT_DISTANCE if direction.y == 0.0 and !bounce else Vector2.ZERO
var is_on_platform = platform_detector.is_colliding()
_velocity = move_and_slide_with_snap(
_velocity, snap_vector, FLOOR_NORMAL, not is_on_platform, 4, 0.9, false
)
if direction.x != 0:
sprite.scale.x = 1 if direction.x > 0 else -1
#
var animation = get_new_animation()
if animation != animation_player.current_animation:
animation_player.play(animation)
func get_direction():
return Vector2(
Input.get_action_strength("move_right" + action_suffix) - Input.get_action_strength("move_left" + action_suffix),
-1 if is_on_floor() and Input.is_action_just_pressed("jump" + action_suffix) else 0
)
# This function calculates a new velocity whenever you need it.
# It allows you to interrupt jumps.
func calculate_move_velocity(
linear_velocity,
direction,
speed,
is_jump_interrupted,
delta
):
var velocity
if bounce_vec.x != 0:
velocity = bounce_vec
bounce_vec.y += gravity * delta
else:
velocity = linear_velocity
velocity.x = speed.x * direction.x
if direction.y != 0.0:
velocity.y = speed.y * direction.y
if is_jump_interrupted:
velocity.y = 0.0
return velocity
func get_new_animation():
var animation_new = ""
if is_on_floor():
animation_new = "run" if abs(_velocity.x) > 0.1 else "idle"
else:
animation_new = "falling" if _velocity.y > 0 else "jumping"
return animation_new
func bounce_off_glove(strength,angle):
bounce = true
var rangle = round(angle)
bounce_vec = Vector2(0,0)
if rangle == 90:
_velocity = Vector2(0,-strength)
elif rangle == 270:
_velocity = Vector2(0,strength)
else:
sprite.scale.x = -1 if (angle >= 0 and angle <= 90) or angle > 270 else 1
var ang_rad = deg2rad(angle)
bounce_vec = Vector2(-cos(ang_rad),-sin(ang_rad))*strength

153
src/Actors/Player.tscn Normal file
View File

@ -0,0 +1,153 @@
[gd_scene load_steps=13 format=2]
[ext_resource path="res://src/Actors/Player.gd" type="Script" id=1]
[ext_resource path="res://assets/art/player/shiro.png" type="Texture" id=2]
[ext_resource path="res://assets/audio/sfx/select.wav" type="AudioStream" id=3]
[ext_resource path="res://assets/art/ui/touch_button_left.png" type="Texture" id=5]
[ext_resource path="res://assets/art/ui/touch_button_right.png" type="Texture" id=6]
[ext_resource path="res://assets/art/ui/touch_button_jump.png" type="Texture" id=7]
[ext_resource path="res://assets/art/ui/touch_button_fire.png" type="Texture" id=8]
[sub_resource type="Animation" id=1]
resource_name = "falling"
length = 0.5
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.25, 0.5 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 1,
"values": [ 3, 4, 3 ]
}
[sub_resource type="Animation" id=2]
length = 0.001
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 4.5, 4.75, 5, 5.25 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 1, 19, 20, 19, 16 ]
}
[sub_resource type="Animation" id=3]
length = 0.5
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.25, 0.5 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 1,
"values": [ 5, 6, 5 ]
}
[sub_resource type="Animation" id=4]
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.25, 0.5, 0.75 ),
"transitions": PoolRealArray( 1, 1, 1, 1 ),
"update": 1,
"values": [ 0, 1, 2, 1 ]
}
[sub_resource type="RectangleShape2D" id=5]
extents = Vector2( 6, 7 )
[node name="Player" type="KinematicBody2D"]
collision_mask = 30
script = ExtResource( 1 )
[node name="PlatformDetector" type="RayCast2D" parent="."]
enabled = true
cast_to = Vector2( 0, 6 )
collision_mask = 8
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -15 )
texture = ExtResource( 2 )
hframes = 7
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
playback_speed = 2.6
anims/falling = SubResource( 1 )
anims/idle = SubResource( 2 )
anims/jumping = SubResource( 3 )
anims/run = SubResource( 4 )
[node name="Camera" type="Camera2D" parent="."]
position = Vector2( 0, -28 )
rotating = true
current = true
process_mode = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 0, -7 )
shape = SubResource( 5 )
[node name="UI" type="CanvasLayer" parent="."]
layer = 0
[node name="Left" type="TouchScreenButton" parent="UI"]
visible = false
position = Vector2( 27.7593, 360.87 )
scale = Vector2( 1.49157, 1.46265 )
normal = ExtResource( 5 )
passby_press = true
action = "move_left"
visibility_mode = 1
[node name="Right" type="TouchScreenButton" parent="UI"]
visible = false
position = Vector2( 121.542, 361.415 )
scale = Vector2( 1.49157, 1.46265 )
normal = ExtResource( 6 )
passby_press = true
action = "move_right"
visibility_mode = 1
[node name="Jump" type="TouchScreenButton" parent="UI"]
visible = false
position = Vector2( 666.224, 359.02 )
scale = Vector2( 1.49157, 1.46265 )
normal = ExtResource( 7 )
action = "jump"
visibility_mode = 1
[node name="Fire" type="TouchScreenButton" parent="UI"]
visible = false
position = Vector2( 668.073, 262.788 )
scale = Vector2( 1.49157, 1.46265 )
normal = ExtResource( 8 )
action = "shoot"
visibility_mode = 1
[node name="jump" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 3 )
volume_db = -3.714
pitch_scale = 1.48

View File

@ -0,0 +1,17 @@
extends Node2D
const LIMIT_LEFT = 0
const LIMIT_TOP = -96
const LIMIT_RIGHT = 3328
const LIMIT_BOTTOM = 1984
func _ready():
global.hud.run_clock()
$Music.play()
for child in get_children():
if child is Player:
var camera = child.get_node("Camera")
camera.limit_left = LIMIT_LEFT
camera.limit_top = LIMIT_TOP
camera.limit_right = LIMIT_RIGHT
camera.limit_bottom = LIMIT_BOTTOM

File diff suppressed because one or more lines are too long

18
src/Level/Level.gd Normal file
View File

@ -0,0 +1,18 @@
extends Node2D
const LIMIT_LEFT = 0
const LIMIT_TOP = 0
const LIMIT_RIGHT = 1376
const LIMIT_BOTTOM = 416
func _ready():
global.hud.run_clock()
$Music.play()
for child in get_children():
if child is Player:
var camera = child.get_node("Camera")
camera.limit_left = LIMIT_LEFT
camera.limit_top = LIMIT_TOP
camera.limit_right = LIMIT_RIGHT
camera.limit_bottom = LIMIT_BOTTOM
$Springs/AnimationPlayer.play("Nueva Animación")

230
src/Level/Level.tscn Normal file
View File

@ -0,0 +1,230 @@
[gd_scene load_steps=11 format=2]
[ext_resource path="res://assets/art/tileset/tiles_gplexian.tres" type="TileSet" id=1]
[ext_resource path="res://src/Objects/SpringWeak.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/art/background/number.png" type="Texture" id=3]
[ext_resource path="res://src/Objects/Spring.tscn" type="PackedScene" id=4]
[ext_resource path="res://src/Level/Level.gd" type="Script" id=5]
[ext_resource path="res://src/Objects/LockedDoor.tscn" type="PackedScene" id=7]
[ext_resource path="res://assets/audio/music/44 - Holiday.ogg" type="AudioStream" id=8]
[ext_resource path="res://src/Level/Music.gd" type="Script" id=9]
[ext_resource path="res://src/Actors/Player.tscn" type="PackedScene" id=10]
[sub_resource type="Animation" id=1]
resource_name = "Nueva Animación"
length = 2.0
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Spring:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( 156.235, 354.42 ), Vector2( 262.747, 382.15 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Spring:rotation_degrees")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ 65.4156, 0.0 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("SpringWeak5:rotation_degrees")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ -360.0, 0.0 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("SpringWeak5:scale")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0, 2 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( 1.96, 1.96 ), Vector2( 1, 1 ) ]
}
[node name="Test" type="Node2D"]
pause_mode = 1
script = ExtResource( 5 )
[node name="LockedDoor" parent="." instance=ExtResource( 7 )]
position = Vector2( 3296, 1888 )
[node name="TileMap2" type="TileMap" parent="."]
modulate = Color( 0.482353, 0.407843, 0.560784, 1 )
tile_set = ExtResource( 1 )
cell_size = Vector2( 32, 32 )
format = 1
[node name="TileMap" type="TileMap" parent="."]
tile_set = ExtResource( 1 )
cell_size = Vector2( 32, 32 )
collision_layer = 16
collision_mask = 0
format = 1
tile_data = PoolIntArray( 0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 4, 0, 0, 5, 0, 0, 6, 0, 0, 7, 0, 0, 8, 0, 0, 9, 0, 0, 10, 0, 0, 11, 0, 0, 12, 0, 0, 13, 0, 0, 14, 0, 0, 15, 0, 0, 16, 0, 0, 17, 0, 0, 18, 0, 0, 19, 0, 0, 20, 0, 0, 21, 0, 0, 22, 0, 0, 23, 0, 0, 24, 0, 0, 25, 0, 0, 26, 0, 0, 27, 0, 0, 28, 0, 0, 29, 0, 0, 30, 0, 0, 31, 0, 0, 32, 0, 0, 33, 0, 0, 34, 0, 0, 35, 0, 0, 36, 0, 0, 37, 0, 0, 38, 0, 0, 39, 0, 0, 40, 0, 0, 41, 0, 0, 42, 0, 0, 65536, 0, 0, 65578, 0, 0, 131072, 0, 0, 131114, 0, 0, 196608, 0, 0, 196650, 0, 0, 262144, 0, 0, 262186, 0, 0, 327680, 0, 0, 327722, 0, 0, 393216, 0, 0, 393258, 0, 0, 458752, 0, 0, 458794, 0, 0, 524288, 0, 0, 524330, 0, 0, 589824, 0, 0, 589866, 0, 0, 655360, 0, 0, 655402, 0, 0, 720896, 0, 0, 720938, 0, 0, 786432, 0, 0, 786433, 0, 0, 786434, 0, 0, 786435, 0, 0, 786436, 0, 0, 786437, 0, 0, 786438, 0, 0, 786439, 0, 0, 786440, 0, 0, 786441, 0, 0, 786442, 0, 0, 786443, 0, 0, 786444, 0, 0, 786445, 0, 0, 786446, 0, 0, 786447, 0, 0, 786448, 0, 0, 786449, 0, 0, 786450, 0, 0, 786451, 0, 0, 786452, 0, 0, 786453, 0, 0, 786454, 0, 0, 786455, 0, 0, 786456, 0, 0, 786457, 0, 0, 786458, 0, 0, 786459, 0, 0, 786460, 0, 0, 786461, 0, 0, 786462, 0, 0, 786463, 0, 0, 786464, 0, 0, 786465, 0, 0, 786466, 0, 0, 786467, 0, 0, 786468, 0, 0, 786469, 0, 0, 786470, 0, 0, 786471, 0, 0, 786472, 0, 0, 786473, 0, 0, 786474, 0, 0 )
[node name="ParallaxBackground" type="ParallaxBackground" parent="."]
scroll_ignore_camera_zoom = true
[node name="ParallaxLayer" type="ParallaxLayer" parent="ParallaxBackground"]
motion_scale = Vector2( 0.1, 0.1 )
motion_offset = Vector2( -100, -50 )
motion_mirroring = Vector2( 320, 320 )
__meta__ = {
"_edit_group_": true
}
[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer"]
texture = ExtResource( 3 )
centered = false
region_enabled = true
region_rect = Rect2( 0, 0, 320, 320 )
__meta__ = {
"_edit_group_": true
}
[node name="ParallaxLayer2" type="ParallaxLayer" parent="ParallaxBackground"]
motion_scale = Vector2( 0.2, 0.2 )
motion_mirroring = Vector2( 320, 320 )
__meta__ = {
"_edit_group_": true
}
[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer2"]
modulate = Color( 0.741176, 0.6, 0.972549, 0.713726 )
texture = ExtResource( 3 )
centered = false
region_enabled = true
region_rect = Rect2( 0, 0, 320, 320 )
__meta__ = {
"_edit_group_": true
}
[node name="ParallaxLayer3" type="ParallaxLayer" parent="ParallaxBackground"]
motion_scale = Vector2( 0.4, 0.4 )
motion_offset = Vector2( 256, -24 )
motion_mirroring = Vector2( 320, 320 )
__meta__ = {
"_edit_group_": true
}
[node name="Sprite" type="Sprite" parent="ParallaxBackground/ParallaxLayer3"]
modulate = Color( 0.741176, 0.6, 0.972549, 0.329412 )
texture = ExtResource( 3 )
centered = false
region_enabled = true
region_rect = Rect2( 0, 0, 320, 320 )
__meta__ = {
"_edit_group_": true
}
[node name="Springs" type="Node" parent="."]
[node name="Spring" parent="Springs" instance=ExtResource( 4 )]
position = Vector2( 156.235, 354.42 )
rotation = 1.14172
[node name="Spring2" parent="Springs" instance=ExtResource( 4 )]
position = Vector2( 502.458, 385.315 )
scale = Vector2( 2.07638, 2.07638 )
[node name="Spring7" parent="Springs" instance=ExtResource( 4 )]
position = Vector2( 1.76728, 342.24 )
rotation = 1.32545
scale = Vector2( 3.32238, 3.20387 )
[node name="Spring9" parent="Springs" instance=ExtResource( 4 )]
position = Vector2( 1318.61, 37.5164 )
rotation = 3.14159
scale = Vector2( 3.32238, 3.20387 )
[node name="Spring5" parent="Springs" instance=ExtResource( 4 )]
position = Vector2( 415.589, 382.881 )
scale = Vector2( 0.497401, 0.497401 )
[node name="Spring8" parent="Springs" instance=ExtResource( 4 )]
position = Vector2( 354.931, 384.023 )
scale = Vector2( 0.186014, 0.186014 )
[node name="Spring6" parent="Springs" instance=ExtResource( 4 )]
position = Vector2( 449.801, 383.856 )
scale = Vector2( 0.815439, 0.815439 )
[node name="Spring3" parent="Springs" instance=ExtResource( 4 )]
position = Vector2( 303.535, 381.986 )
rotation = 5.2487
[node name="Spring4" parent="Springs" instance=ExtResource( 4 )]
position = Vector2( 374.265, 84.4751 )
rotation = 3.25579
[node name="SpringWeak" parent="Springs" instance=ExtResource( 2 )]
position = Vector2( 393.729, 384.39 )
[node name="SpringWeak5" parent="Springs" instance=ExtResource( 2 )]
position = Vector2( 774.063, 305.446 )
rotation = -6.28319
scale = Vector2( 1.96, 1.96 )
[node name="SpringWeak6" parent="Springs" instance=ExtResource( 2 )]
position = Vector2( 36.0806, 382.88 )
rotation = 1.30903
scale = Vector2( 3.12, 3.12 )
[node name="SpringWeak8" parent="Springs" instance=ExtResource( 2 )]
position = Vector2( 723.597, 386.502 )
rotation = 0.567022
scale = Vector2( 2.4635, 2.4635 )
[node name="SpringWeak7" parent="Springs" instance=ExtResource( 2 )]
position = Vector2( 1346.12, 377.438 )
rotation = -1.10788
scale = Vector2( 1.5, 1.5 )
[node name="SpringWeak2" parent="Springs" instance=ExtResource( 2 )]
position = Vector2( 469.222, 383.778 )
scale = Vector2( 0.800015, 0.800015 )
[node name="SpringWeak3" parent="Springs" instance=ExtResource( 2 )]
position = Vector2( 432.571, 384.126 )
scale = Vector2( 0.520015, 0.520015 )
[node name="SpringWeak4" parent="Springs" instance=ExtResource( 2 )]
position = Vector2( 373.578, 383.984 )
scale = Vector2( 0.187345, 0.187345 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="Springs"]
playback_speed = 0.5
"anims/Nueva Animación" = SubResource( 1 )
[node name="Secret" type="Node" parent="."]
[node name="Music" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 8 )
volume_db = -80.0
pitch_scale = 0.94
script = ExtResource( 9 )
[node name="Player" parent="." instance=ExtResource( 10 )]
position = Vector2( 684.897, 365.981 )

4
src/Level/Music.gd Normal file
View File

@ -0,0 +1,4 @@
extends AudioStreamPlayer
func _on_TriggerResults_touched():
stop()

432
src/Level/Test2.tscn Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,16 @@
[gd_scene format=2]
[node name="Borders" type="Control"]
margin_right = 320.0
margin_bottom = 240.0
[node name="ColorRect2" type="ColorRect" parent="."]
margin_right = 320.0
margin_bottom = 32.0
color = Color( 0, 0, 0, 1 )
[node name="ColorRect3" type="ColorRect" parent="."]
margin_top = 208.0
margin_right = 320.0
margin_bottom = 240.0
color = Color( 0, 0, 0, 1 )

70
src/Main/Game.gd Normal file
View File

@ -0,0 +1,70 @@
extends Node
# This class contains controls that should always be accessible, like pausing
# the game or toggling the window full-screen.
var map_name = null
var map_path = null
var player = null
# The "_" prefix is a convention to indicate that variables are private,
# that is to say, another node or script should not access them.
onready var _pause_menu = load("res://src/Main/PauseMenu.tscn")
func _init():
OS.min_window_size = OS.window_size
OS.max_window_size = OS.get_screen_size()
func _ready():
change_scene("res://src/Main/MainMenu.tscn",true,"fade_in",global.STATE.MENU)
func _input(event):
if event.is_action_pressed("toggle_fullscreen"):
OS.window_fullscreen = not OS.window_fullscreen
get_tree().set_input_as_handled()
# The GlobalControls node, in the Stage scene, is set to process even
# when the game is paused, so this code keeps running.
# To see that, select GlobalControls, and scroll down to the Pause category
# in the inspector.
elif event.is_action_pressed("toggle_pause") and global.game_state == global.STATE.INGAME:
if !get_tree().paused:
pause()
get_tree().set_input_as_handled()
func pause():
var pause_menu = _pause_menu.instance()
add_child(pause_menu)
get_tree().paused = true
func change_scene(path_to_scene : String, reset_stats : bool = false,
transition = "fade_out", set_game_mode = global.STATE.INGAME):
global.show_message("")
if transition != "none":
if find_node("Player"):
player.can_move = false
var transition_effect = load("res://src/Main/SceneTransition.tscn").instance()
add_child(transition_effect)
var anim = transition_effect.get_node("AnimationPlayer")
transition_effect.start(transition)
yield(anim,"animation_finished")
global.game_state = set_game_mode
if map_name != null:
var map = get_node(map_name)
remove_child(map)
map.call_deferred("free")
var next_map_path = load(path_to_scene)
var next_map = next_map_path.instance()
add_child(next_map)
map_name = next_map.name
map_path = next_map.get_path()
global.game_state = set_game_mode
# if set_game_mode == global.STATE.INGAME:
# player = get_node(map_name + "/Entities/Player")
set_process(true)

13
src/Main/Game.tscn Normal file
View File

@ -0,0 +1,13 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://src/Main/Game.gd" type="Script" id=2]
[ext_resource path="res://src/Main/HUD.tscn" type="PackedScene" id=5]
[node name="Game" type="Node"]
pause_mode = 2
script = ExtResource( 2 )
[node name="InterfaceLayer" type="CanvasLayer" parent="."]
layer = 100
[node name="HUD" parent="." instance=ExtResource( 5 )]

37
src/Main/GetReady.gd Normal file
View File

@ -0,0 +1,37 @@
extends Control
var label_number = 0
var zone
var level
onready var small_label = $ZoneNumber
onready var title_label = $LevelName
func _ready():
$MonoBackground/Back.color = Color(randf(),randf(),randf())
small_label.text = "Stage "+str(global.current_level+1)
title_label.text = global.level_names[global.current_level]
func _process(delta):
if Input.is_action_just_pressed("shoot") or Input.is_action_just_pressed("special") :
go()
func _on_Timer_timeout():
if label_number != 2:
$MonoBackground/Back.color = Color(randf(),randf(),randf())
match label_number:
0:
title_label.visible = true
small_label.visible = false
1:
small_label.text = "GET READY"
title_label.visible = false
small_label.visible = true
2:
small_label.text = "GO"
$Timer.stop()
go()
label_number += 1
func go():
set_process(false)
global.game_root.change_scene("res://src/Level/"+global.level_list[global.current_level]+".tscn",true)

40
src/Main/GetReady.tscn Normal file
View File

@ -0,0 +1,40 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://src/Main/GetReady.gd" type="Script" id=1]
[ext_resource path="res://src/Main/MonoBackground.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/theme/fonts/TitleCardFont.tres" type="DynamicFont" id=3]
[ext_resource path="res://assets/theme/fonts/NormalFont.tres" type="DynamicFont" id=4]
[ext_resource path="res://src/Main/BlackBorders.tscn" type="PackedScene" id=6]
[node name="GetReady" type="Control"]
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MonoBackground" parent="." instance=ExtResource( 2 )]
[node name="ZoneNumber" type="Label" parent="."]
margin_right = 320.0
margin_bottom = 240.0
custom_fonts/font = ExtResource( 4 )
text = "ZONE 1"
align = 1
valign = 1
uppercase = true
[node name="LevelName" type="Label" parent="."]
visible = false
margin_top = -4.0
margin_right = 320.0
margin_bottom = 240.0
custom_fonts/font = ExtResource( 3 )
text = "Glorious Perseverance"
align = 1
valign = 1
[node name="Borders" parent="." instance=ExtResource( 6 )]
[node name="Timer" type="Timer" parent="."]
autostart = true
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]

91
src/Main/HUD.gd Normal file
View File

@ -0,0 +1,91 @@
extends CanvasLayer
var text
var length = 0
var scroll_effect = 0
var important = 0
var seconds = 0
var minutes = 0
onready var inventory = $Inventory.get_children()
onready var text_label = $DownPanel/Message
onready var scroll = text_label.get_v_scroll()
onready var clock = $UpPanel/CenterContainer/Timer
func _process(delta):
$DownPanel.visible = (global.game_state == global.STATE.INGAME)
$UpPanel.visible = (global.game_state == global.STATE.INGAME)
$Inventory.visible = (global.game_state == global.STATE.INGAME)
func show_message(display_text,_important):
$TypeTimer.stop()
#$ScrollTimer.stop()
#$ScrollWaitTimer.stop()
$ClearTimer.stop()
scroll_effect = 0
scroll.value = 0
text_label.visible_characters = 0
text = display_text
var regex
regex = RegEx.new()
regex.compile("\\[.*?]")
var stripped = text
for j in regex.search_all(text):
stripped = stripped.replace(j.get_string(),"")
length = stripped.length()
#$ScrollWaitTimer.wait_time = 2
$TypeTimer.start()
$ClearTimer.start()
#$ScrollWaitTimer.start()
text_label.bbcode_text = text
func _on_TypeTimer_timeout():
if scroll_effect == 0:
if text_label.visible_characters < length:
text_label.visible_characters += 1
$TypeTimer.start()
elif scroll_effect == -1 and text_label.visible_characters > 0:
text_label.visible_characters -= 1
$TypeTimer.start()
func _on_ScrollTimer_timeout():
if scroll.value == scroll.max_value-9:
$ScrollTimer.stop()
$ScrollWaitTimer.stop()
$ClearTimer.start()
else:
if scroll_effect < 9:
scroll.value += 1
scroll_effect +=1
else:
scroll_effect = 0
$ScrollWaitTimer.start()
$ScrollTimer.stop()
func _on_ScrollWaitTimer_timeout():
text_label.visible_characters = length
$ScrollWaitTimer.wait_time = 1
$ScrollTimer.start()
func _on_ClearTimer_timeout():
$TypeTimer.start()
scroll_effect = -1
func update_items():
for item in inventory:
item.visible = global.has_item(item.name)
func run_clock():
seconds = 0
minutes = 0
$ClockTick.start()
func stop_clock():
$ClockTick.stop()
func update_clock():
seconds += 1
if seconds == 60:
seconds = 0
minutes += 1
clock.text = ("%02d" % minutes) + ":" +("%02d" % seconds)

121
src/Main/HUD.tscn Normal file
View File

@ -0,0 +1,121 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://assets/art/key_yellow.png" type="Texture" id=1]
[ext_resource path="res://assets/theme/fonts/NormalFont.tres" type="DynamicFont" id=2]
[ext_resource path="res://src/Main/HUD.gd" type="Script" id=3]
[node name="HUD" type="CanvasLayer"]
pause_mode = 1
script = ExtResource( 3 )
[node name="UpPanel" type="ColorRect" parent="."]
visible = false
anchor_right = 1.0
margin_bottom = 16.0
color = Color( 0, 0, 0, 0 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="CenterContainer" type="CenterContainer" parent="UpPanel"]
margin_left = 2.0
margin_right = 318.0
margin_bottom = 16.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Timer" type="Label" parent="UpPanel/CenterContainer"]
margin_left = 138.0
margin_top = 4.0
margin_right = 178.0
margin_bottom = 12.0
size_flags_horizontal = 7
custom_fonts/font = ExtResource( 2 )
text = "00:00"
align = 2
[node name="Margin" type="MarginContainer" parent="UpPanel"]
anchor_right = 1.0
margin_left = 2.0
margin_right = -2.0
margin_bottom = 16.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="DownPanel" type="ColorRect" parent="."]
visible = false
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = -16.0
color = Color( 0, 0, 0, 0 )
[node name="Message" type="RichTextLabel" parent="DownPanel"]
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.63
anchor_bottom = 1.0
margin_left = -156.0
margin_top = -12.0
margin_right = 114.4
margin_bottom = -3.0
rect_clip_content = false
custom_fonts/normal_font = ExtResource( 2 )
bbcode_enabled = true
visible_characters = 0
scroll_active = false
[node name="Inventory" type="GridContainer" parent="."]
margin_left = 318.0
margin_top = -2.0
margin_right = 374.0
margin_bottom = 14.0
rect_scale = Vector2( -1, 1 )
columns = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="KeyYellow" type="TextureRect" parent="Inventory"]
visible = false
margin_right = 16.0
margin_bottom = 16.0
texture = ExtResource( 1 )
[node name="KeyBlue" type="TextureRect" parent="Inventory"]
visible = false
margin_left = 20.0
margin_right = 36.0
margin_bottom = 16.0
texture = ExtResource( 1 )
[node name="KeyRed" type="TextureRect" parent="Inventory"]
visible = false
margin_left = 40.0
margin_right = 56.0
margin_bottom = 16.0
texture = ExtResource( 1 )
[node name="TypeTimer" type="Timer" parent="."]
wait_time = 0.05
one_shot = true
[node name="ScrollTimer" type="Timer" parent="."]
wait_time = 0.1
[node name="ScrollWaitTimer" type="Timer" parent="."]
wait_time = 2.0
one_shot = true
[node name="ClearTimer" type="Timer" parent="."]
wait_time = 4.0
one_shot = true
[node name="ClockTick" type="Timer" parent="."]
[connection signal="timeout" from="TypeTimer" to="." method="_on_TypeTimer_timeout"]
[connection signal="timeout" from="ScrollTimer" to="." method="_on_ScrollTimer_timeout"]
[connection signal="timeout" from="ScrollWaitTimer" to="." method="_on_ScrollWaitTimer_timeout"]
[connection signal="timeout" from="ClearTimer" to="." method="_on_ClearTimer_timeout"]
[connection signal="timeout" from="ClockTick" to="." method="update_clock"]

83
src/Main/MainMenu.gd Normal file
View File

@ -0,0 +1,83 @@
extends CanvasLayer
var menu_selected = 0
var item_selected = 0
var item_no = []
var item_labels = []
var level_no = global.level_list.size()
func _ready():
global.current_level = 0
global.score = 0
global.hud.clock.text = "00:00"
var menus = [$MainMenu]
for i in menus:
item_labels.append(i.get_children())
item_no.append(i.get_child_count()-1)
upd_level_sel()
color_option()
func _process(delta):
var RIGHT = Input.is_action_just_pressed("ui_right")
var UP = Input.is_action_just_pressed("ui_up")
var LEFT = Input.is_action_just_pressed("ui_left")
var DOWN = Input.is_action_just_pressed("ui_down")
var SELECT = Input.is_action_just_pressed("shoot")
var BACK = Input.is_action_just_pressed("ui_cancel")
if UP:
decolor_option()
if item_selected > 0:
item_selected -= 1
else:
item_selected = item_no[menu_selected]
color_option()
elif DOWN:
decolor_option()
if item_selected < item_no[menu_selected]:
item_selected += 1
else:
item_selected = 0
color_option()
if RIGHT:
if menu_selected == 0:
if item_selected == 0:
if global.current_level < level_no-1:
global.current_level += 1
else:
global.current_level = 0
upd_level_sel()
elif LEFT:
if menu_selected == 0:
if item_selected == 0:
if global.current_level == 0:
global.current_level = level_no-1
else:
global.current_level -=1
upd_level_sel()
if SELECT:
decolor_option()
match menu_selected:
0:
#Main menu
match item_selected:
0:
set_process(false)
global.game_root.change_scene("res://src/Main/GetReady.tscn",true,"fade_out",global.STATE.MENU)
1:
$AnimationPlayer.play("credits")
pass
color_option()
if BACK:
decolor_option()
color_option()
func decolor_option():
item_labels[menu_selected][item_selected].modulate = Color.white
func color_option():
item_labels[menu_selected][item_selected].modulate = Color.plum
func upd_level_sel():
item_labels[0][0].text = "<PLAY STAGE "+str(global.current_level+1)+": "+global.level_names[global.current_level]+">"

110
src/Main/MainMenu.tscn Normal file
View File

@ -0,0 +1,110 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://src/Main/MainMenu.gd" type="Script" id=1]
[ext_resource path="res://assets/art/background/title.png" type="Texture" id=2]
[ext_resource path="res://assets/theme/fonts/NormalFont.tres" type="DynamicFont" id=4]
[sub_resource type="Animation" id=1]
resource_name = "credits"
length = 15.0
step = 1.0
tracks/0/type = "value"
tracks/0/path = NodePath("RichTextLabel:rect_position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 15 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( 322, 188 ), Vector2( -1464, 188 ) ]
}
[node name="MainMenu" type="CanvasLayer"]
script = ExtResource( 1 )
[node name="Background" type="TextureRect" parent="."]
margin_right = 426.0
margin_bottom = 240.0
texture = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MainMenu" type="VBoxContainer" parent="."]
anchor_left = 0.296875
anchor_top = 0.766667
anchor_right = 0.296875
anchor_bottom = 0.766667
margin_left = -93.0
margin_top = 15.9999
margin_right = 226.0
margin_bottom = 37.9999
size_flags_horizontal = 4
size_flags_vertical = 2
size_flags_stretch_ratio = 0.6
__meta__ = {
"_edit_use_anchors_": false
}
[node name="StoryMode" type="Label" parent="MainMenu"]
margin_right = 319.0
margin_bottom = 8.0
rect_pivot_offset = Vector2( 42, 4 )
custom_fonts/font = ExtResource( 4 )
text = "START GAME"
align = 1
uppercase = true
[node name="Quit" type="Label" parent="MainMenu"]
margin_top = 12.0
margin_right = 319.0
margin_bottom = 20.0
rect_pivot_offset = Vector2( 42, 4 )
custom_fonts/font = ExtResource( 4 )
text = "CREDITS"
align = 1
uppercase = true
[node name="MainVbox" type="VBoxContainer" parent="."]
margin_left = -94.0
margin_top = 18.0
margin_right = 226.0
margin_bottom = 258.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="RichTextLabel" type="RichTextLabel" parent="."]
margin_left = 322.0
margin_top = 188.0
margin_right = 1826.0
margin_bottom = 210.0
rect_clip_content = false
custom_fonts/normal_font = ExtResource( 4 )
bbcode_enabled = true
bbcode_text = "[wave amp=20 freq=5]Shirogami's Maze by Cidoku - Character and music by me - Game made in Godot using the 2D platformer demo by the Godot Engine team (I can't even code) - Tileset by rubberduck and bart[/wave]"
meta_underlined = false
text = "Shirogami's Maze by Cidoku - Character and music by me - Game made in Godot using the 2D platformer demo by the Godot Engine team (I can't even code) - Tileset by rubberduck and bart"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
playback_speed = 0.7
anims/credits = SubResource( 1 )
[node name="StoryMode2" type="Label" parent="."]
margin_left = 112.0
margin_top = 232.0
margin_right = 320.0
margin_bottom = 240.0
rect_pivot_offset = Vector2( 42, 4 )
custom_fonts/font = ExtResource( 4 )
text = "V1.1-2020"
align = 2
uppercase = true
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -0,0 +1,24 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://assets/art/background/bgPaper.png" type="Texture" id=1]
[node name="MonoBackground" type="Control"]
margin_right = 320.0
margin_bottom = 240.0
[node name="Back" type="ColorRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 32.0
margin_bottom = -28.0
color = Color( 0.192157, 0.0509804, 0.227451, 1 )
[node name="TextureRect" type="TextureRect" parent="."]
modulate = Color( 1, 1, 1, 0.262745 )
margin_top = 32.0
margin_right = 320.0
margin_bottom = 212.0
texture = ExtResource( 1 )
__meta__ = {
"_edit_lock_": true
}

28
src/Main/PauseMenu.gd Normal file
View File

@ -0,0 +1,28 @@
extends CanvasLayer
var active = false
func _ready():
$AnimationPlayer.play("MoveIn")
func _process(delta):
if active:
var UP = Input.is_action_just_pressed("ui_up")
var DOWN = Input.is_action_just_pressed("ui_down")
var SELECT = Input.is_action_just_pressed("shoot")
var PAUSE = Input.is_action_just_pressed("toggle_pause")
var BACK = Input.is_action_just_pressed("ui_cancel")
if PAUSE or SELECT or BACK:
unpause()
func _on_AnimationPlayer_animation_finished(anim_name):
if anim_name == "MoveIn":
active = true
if anim_name == "MoveOut":
get_tree().paused = false
queue_free()
func unpause():
set_process(false)
$AnimationPlayer.play("MoveOut")

138
src/Main/PauseMenu.tscn Normal file
View File

@ -0,0 +1,138 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://src/Main/PauseMenu.gd" type="Script" id=1]
[ext_resource path="res://assets/theme/fonts/TitleCardFont.tres" type="DynamicFont" id=3]
[ext_resource path="res://src/Main/BlackBorders.tscn" type="PackedScene" id=5]
[sub_resource type="Animation" id=1]
resource_name = "MoveIn"
length = 0.4
step = 0.2
tracks/0/type = "value"
tracks/0/path = NodePath("BordersLeftHalf:rect_position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.4 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( -160, 0 ), Vector2( 0, 0 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("BordersRight:rect_position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.4 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( 160, 0 ), Vector2( 0, 0 ) ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("VBoxContainer:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0, 0.4 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
}
[sub_resource type="Animation" id=2]
resource_name = "MoveOut"
length = 0.4
step = 0.2
tracks/0/type = "value"
tracks/0/path = NodePath("BordersLeftHalf:rect_position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.4 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( -160, 0 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("BordersRight:rect_position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.4 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( 160, 0 ) ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("VBoxContainer:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0, 0.4 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
}
[node name="PauseMenu" type="CanvasLayer"]
pause_mode = 2
script = ExtResource( 1 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
playback_speed = 2.0
anims/MoveIn = SubResource( 1 )
anims/MoveOut = SubResource( 2 )
[node name="VBoxContainer" type="VBoxContainer" parent="."]
modulate = Color( 1, 1, 1, 0 )
margin_right = 320.0
margin_bottom = 240.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="GamePaused" type="Label" parent="VBoxContainer"]
margin_top = 111.0
margin_right = 320.0
margin_bottom = 128.0
size_flags_vertical = 6
custom_fonts/font = ExtResource( 3 )
text = "Game paused"
align = 1
[node name="BordersLeftHalf" parent="." instance=ExtResource( 5 )]
margin_left = -160.0
margin_right = 160.0
[node name="ColorRect2" parent="BordersLeftHalf" index="0"]
margin_right = 160.0
[node name="ColorRect3" parent="BordersLeftHalf" index="1"]
margin_right = 160.0
[node name="BordersRight" parent="." instance=ExtResource( 5 )]
margin_left = 160.0
margin_right = 480.0
[node name="ColorRect2" parent="BordersRight" index="0"]
margin_left = 160.0
[node name="ColorRect3" parent="BordersRight" index="1"]
margin_left = 160.0
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"]
[editable path="BordersLeftHalf"]
[editable path="BordersRight"]

79
src/Main/ResultsScreen.gd Normal file
View File

@ -0,0 +1,79 @@
extends Control
var time_bonus = 50000
var secret_bonus = 0
var final_score = 0
var time = 0
var label_number = 0
onready var main_label = $Center/Results/Label
onready var score_label = $Center/Results/Score
func _ready():
set_process(false)
$MonoBackground/Back.color = Color(randf(),randf(),randf())
time = global.hud.seconds + global.hud.minutes*60
if global.secrets_found == 0:
secret_bonus = 0
elif global.secrets_found > 0 and global.secrets_found <= 6:
secret_bonus = pow(22,global.secrets_found)
else:
secret_bonus = 113379904 + pow(11,global.secrets_found)
match global.current_level:
0:
if time <= 60:
time_bonus = 99999999900
elif time <= 70:
time_bonus = 7500000000
elif time <= 80:
time_bonus = 250000000
elif time <= 90: #Doable by exploiting quirks in the design (Sandro, 01:24)
time_bonus = 50000000
elif time <= 100: #My record (01:35)
time_bonus = 1000000
elif time <= 120:
time_bonus = 50000
else:
time_bonus = 100
final_score = (time_bonus + secret_bonus)
$Timer.start()
func _process(delta):
if Input.is_action_just_pressed("shoot") or Input.is_action_just_pressed("special") :
if label_number != -1:
$MonoBackground/Back.color = Color(randf(),randf(),randf())
show_results()
else:
set_process(false)
#global.score += final_score
global.reset_everything()
global.game_root.change_scene("res://src/Main/MainMenu.tscn",true,"fade_out",global.STATE.CUTSCENE)
func _on_Timer_timeout():
if label_number != -1:
$MonoBackground/Back.color = Color(randf(),randf(),randf())
match label_number:
0:
set_process(true)
$AudioStreamPlayer.play()
score_label.visible = true
score_label.text = str(time_bonus)+"\n("+("%02d" % global.hud.minutes) + ":" +("%02d" % global.hud.seconds)+ ")"
main_label.text = "Time bonus"
label_number += 1
1:
$AudioStreamPlayer.play()
score_label.text = str(secret_bonus)
main_label.text = str(global.secrets_found)+" secret"+ ("s" if global.secrets_found > 1 else "") + " found" if global.secrets_found > 0 else "No secrets found"
label_number += 1
2:
show_results()
func _on_BlinkTimer_timeout():
$PressShoot.visible = !$PressShoot.visible
func show_results():
$AudioStreamPlayer.play()
label_number = -1
main_label.text = "Final score"
score_label.text = str(global.score + final_score)+"\n("+("%02d" % global.hud.minutes) + ":" +("%02d" % global.hud.seconds)+ ")"
$BlinkTimer.start()

View File

@ -0,0 +1,69 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://src/Main/ResultsScreen.gd" type="Script" id=1]
[ext_resource path="res://src/Main/MonoBackground.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/theme/fonts/TitleCardFont.tres" type="DynamicFont" id=3]
[ext_resource path="res://assets/theme/fonts/NormalFont.tres" type="DynamicFont" id=4]
[ext_resource path="res://assets/audio/sfx/get.wav" type="AudioStream" id=5]
[ext_resource path="res://src/Main/BlackBorders.tscn" type="PackedScene" id=6]
[node name="LevelResults" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 3.8147e-06
script = ExtResource( 1 )
__meta__ = {
"_edit_horizontal_guides_": [ 0.0 ],
"_edit_use_anchors_": false
}
[node name="MonoBackground" parent="." instance=ExtResource( 2 )]
[node name="Center" type="CenterContainer" parent="."]
margin_left = 16.0
margin_top = 33.0
margin_right = 304.0
margin_bottom = 209.0
[node name="Results" type="VBoxContainer" parent="Center"]
margin_left = 73.0
margin_top = 79.0
margin_right = 215.0
margin_bottom = 96.0
[node name="Label" type="Label" parent="Center/Results"]
margin_right = 142.0
margin_bottom = 17.0
custom_fonts/font = ExtResource( 3 )
text = "Level complete"
[node name="Score" type="Label" parent="Center/Results"]
visible = false
margin_top = 20.0
margin_right = 137.0
margin_bottom = 28.0
custom_fonts/font = ExtResource( 4 )
text = "200000"
align = 1
[node name="PressShoot" type="Label" parent="."]
visible = false
margin_top = 192.0
margin_right = 320.0
margin_bottom = 200.0
custom_fonts/font = ExtResource( 4 )
text = "PRESS <JUMP> TO RETURN TO THE MENU"
align = 1
[node name="Timer" type="Timer" parent="."]
wait_time = 1.5
[node name="BlinkTimer" type="Timer" parent="."]
wait_time = 0.5
[node name="Borders" parent="." instance=ExtResource( 6 )]
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 5 )
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]
[connection signal="timeout" from="BlinkTimer" to="." method="_on_BlinkTimer_timeout"]

View File

@ -0,0 +1,16 @@
extends CanvasLayer
# This features only fade in and fade out for now but adding more transitions shouldn't be too hard
func start(anim):
global.in_transition = true
$AnimationPlayer.play(anim)
$AnimationPlayer.connect("animation_finished",self,"on_animation_finished")
func on_animation_finished(anim):
global.in_transition = false
match anim:
"fade_out":
$AnimationPlayer.play("fade_in")
"fade_in":
queue_free()

View File

@ -0,0 +1,49 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://src/Main/SceneTransition.gd" type="Script" id=1]
[sub_resource type="Animation" id=1]
resource_name = "fade_in"
length = 0.3
tracks/0/type = "value"
tracks/0/path = NodePath("Black:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.3 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 0, 0, 0, 1 ), Color( 0, 0, 0, 0 ) ]
}
[sub_resource type="Animation" id=2]
resource_name = "fade_out"
length = 0.3
tracks/0/type = "value"
tracks/0/path = NodePath("Black:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.3 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 0, 0, 0, 0 ), Color( 0, 0, 0, 1 ) ]
}
[node name="SceneChanger" type="CanvasLayer"]
script = ExtResource( 1 )
[node name="Black" type="ColorRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( -64, 48 )
color = Color( 0, 0, 0, 0 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
playback_speed = 2.0
anims/fade_in = SubResource( 1 )
anims/fade_out = SubResource( 2 )

17
src/Objects/Coin.gd Normal file
View File

@ -0,0 +1,17 @@
class_name Coin
extends Area2D
# Collectible that disappears when the player touches it.
onready var animation_player = $AnimationPlayer
# The Coins only detects collisions with the Player thanks to its collision mask.
# This prevents other characters such as enemies from picking up coins.
# When the player collides with a coin, the coin plays its 'picked' animation.
# The animation takes cares of making the coin disappear, but also deactivates its
# collisions and frees it from memory, saving us from writing more complex code.
# Click the AnimationPlayer node to see the animation timeline.
func _on_body_entered(_body):
global.show_message("You found a secret spot!")
global.secrets_found += 1
animation_player.play("picked")

70
src/Objects/Coin.tscn Normal file
View File

@ -0,0 +1,70 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://src/Objects/Coin.gd" type="Script" id=4]
[sub_resource type="Animation" id=1]
resource_name = "picked"
length = 1.5
step = 0.25
tracks/0/type = "method"
tracks/0/path = NodePath(".")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 1 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "queue_free"
} ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:monitoring")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
[sub_resource type="Animation" id=2]
length = 1.5
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath(".:monitoring")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 2,
"values": [ true ]
}
[sub_resource type="CircleShape2D" id=3]
radius = 9.41741
[node name="Coin" type="Area2D"]
monitoring = false
monitorable = false
collision_layer = 0
script = ExtResource( 4 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "spinning"
playback_speed = 1.5
anims/picked = SubResource( 1 )
anims/spinning = SubResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 3 )
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@ -0,0 +1,29 @@
extends Area2D
export var item = ""
func _ready():
set_correct_sprite()
$AnimationPlayer.play("wave")
# warning-ignore:return_value_discarded
connect("body_entered",self,"body_entered")
func body_entered(_body):
if $Sprite.visible:
global.add_item(item)
global.update_item_hud()
global.show_message("You found the key to exit the level.")
var snd = $AudioStreamPlayer
$Sprite.visible = false
snd.play()
yield(snd,"finished")
queue_free()
func init(_item):
item = _item
set_correct_sprite()
func set_correct_sprite():
match item:
"KeyYellow":
$Sprite.set_texture(preload("res://assets/art/key_yellow.png"))

View File

@ -0,0 +1,44 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://src/Objects/InventoryItemPickup.gd" type="Script" id=1]
[ext_resource path="res://assets/art/key_yellow.png" type="Texture" id=2]
[ext_resource path="res://assets/audio/sfx/get.wav" type="AudioStream" id=3]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 6.13601, 6.05597 )
[sub_resource type="Animation" id=2]
resource_name = "wave"
length = 2.0
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1, 2 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( 0, -7 ), Vector2( 0, 0 ) ]
}
[node name="InventoryItemPickup" type="Area2D"]
script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )
offset = Vector2( 1, 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
position = Vector2( 0.497204, -0.0994396 )
shape = SubResource( 1 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
playback_speed = 0.5
anims/wave = SubResource( 2 )
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 3 )

15
src/Objects/LockedDoor.gd Normal file
View File

@ -0,0 +1,15 @@
extends StaticBody2D
var done = false
export var item = "KeyYellow"
func _on_Area2D_body_entered(_body):
if !done and _body.name == "Player":
if global.has_item(item):
global.remove_item(item)
global.update_item_hud()
$AnimationPlayer.play("open")
done = true
else:
if global.hud.text_label.visible_characters == 0:
global.show_message("This gate needs a key.")

View File

@ -0,0 +1,90 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://assets/art/lockeddoor.png" type="Texture" id=1]
[ext_resource path="res://src/Objects/LockedDoor.gd" type="Script" id=2]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 16, 32 )
[sub_resource type="Animation" id=2]
resource_name = "open"
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( 0, 0 ), Vector2( 0, -32 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Sprite2:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( 0, 32 ), Vector2( 0, 64 ) ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("CollisionShape2D:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0.3 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Area2D:monitoring")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0.3 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 39, 32 )
[node name="LockedDoor" type="StaticBody2D"]
modulate = Color( 1, 0.866667, 0, 1 )
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )
centered = false
[node name="Sprite2" type="Sprite" parent="."]
position = Vector2( 0, 32 )
texture = ExtResource( 1 )
centered = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
position = Vector2( 16, 32 )
shape = SubResource( 1 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
playback_speed = 5.0
anims/open = SubResource( 2 )
[node name="Area2D" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
position = Vector2( 16, 32 )
shape = SubResource( 3 )
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]

17
src/Objects/Spring.gd Normal file
View File

@ -0,0 +1,17 @@
extends Area2D
export var strength = 500
onready var animation_player = $AnimationPlayer
onready var sound = $"CollisionShape2D/Bounce"
func _ready():
sound.pitch_scale = 1/scale.x
func _on_Spring_body_entered(body):
if !sound.playing:
sound.playing = true
if scale.x != 1:
sound.pitch_scale = 1/scale.x
body.bounce_off_glove(strength*scale.x,rotation_degrees+90)
animation_player.play("spring")

49
src/Objects/Spring.tscn Normal file
View File

@ -0,0 +1,49 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://src/Objects/Spring.gd" type="Script" id=1]
[ext_resource path="res://assets/audio/sfx/bounce.wav" type="AudioStream" id=2]
[ext_resource path="res://assets/art/spring/spring.png" type="Texture" id=3]
[sub_resource type="Animation" id=1]
resource_name = "spring"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ 2, 2, 2, 1, 0 ]
}
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 7.45267, 9.94172 )
[node name="Spring" type="Area2D"]
monitorable = false
collision_layer = 0
script = ExtResource( 1 )
strength = 800
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -24 )
texture = ExtResource( 3 )
hframes = 3
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
playback_speed = 2.0
anims/spring = SubResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
position = Vector2( -0.405827, -9.24662 )
shape = SubResource( 2 )
[node name="Bounce" type="AudioStreamPlayer" parent="CollisionShape2D"]
stream = ExtResource( 2 )
volume_db = -15.0
[connection signal="body_entered" from="." to="." method="_on_Spring_body_entered"]

View File

@ -0,0 +1,10 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://assets/art/spring/spring2.png" type="Texture" id=1]
[ext_resource path="res://src/Objects/Spring.tscn" type="PackedScene" id=2]
[node name="SpringWeak" instance=ExtResource( 2 )]
strength = 550
[node name="Sprite" parent="." index="0"]
texture = ExtResource( 1 )

View File

@ -0,0 +1,10 @@
extends Area2D
signal touched
func _on_TriggerResults_body_entered(body):
if body.name == "Player":
emit_signal("touched")
set_deferred("monitoring",false)
global.hud.stop_clock()
global.game_root.change_scene("res://src/Main/ResultsScreen.tscn",true,"fade_out",global.STATE.MENU)

View File

@ -0,0 +1,13 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://src/Objects/TriggerResults.gd" type="Script" id=1]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 10, 19.3091 )
[node name="TriggerResults" type="Area2D"]
script = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
[connection signal="body_entered" from="." to="." method="_on_TriggerResults_body_entered"]

View File

@ -0,0 +1,21 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://assets/art/platforms/moving_platform.png" type="Texture" id=2]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 47, 6 )
[node name="Platform" type="KinematicBody2D"]
z_index = -1
collision_layer = 8
collision_mask = 0
collision/safe_margin = 0.12
motion/sync_to_physics = true
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 0, -4 )
shape = SubResource( 1 )
one_way_collision = true

46
src/globals.gd Normal file
View File

@ -0,0 +1,46 @@
extends Node
enum STATE {SPLASH, MENU, CUTSCENE, INGAME, GAMEOVER, CREDITS, OPTIONS}
var in_transition = false
var game_state = STATE.MENU
var inventory : Array
var score = 0
var secrets_found = 0
var arcade_mode = false
var level_list = ["Googolplexian","Level"]
var level_names = ["Googolplexian","Test Level"]
var current_level = 0
onready var game_root = get_node("/root/Game")
onready var hud = get_node("/root/Game/HUD")
func show_message(msg):
hud.show_message(msg,false)
func reset_everything():
secrets_found = 0
score = 0
hud.seconds = 0
hud.minutes = 0
hud.clock.text = "00:00"
clear_inventory()
show_message("")
func has_item(item):
return inventory.has(item)
func add_item(item):
if !has_item(item):
inventory.append(item)
func remove_item(item):
inventory.erase(item)
func clear_inventory():
inventory.clear()
func update_item_hud():
hud.update_items()