Skip to content

Commit

Permalink
Add 12 new levels (and update level select screen), make level groupi…
Browse files Browse the repository at this point in the history
…ng work, and other changes

Other changes
- Remove win screen
- Fix error where set_move_dir_index didnt propagate when can_move was already true
- Make domino tint and shades more noticeable
- Fix some inconsistencies with using name or filename of level scenes (everything is filename now hopefully)

Notes:
- Some weird stuff happening with tilesets and scene inheritance? (I think its inheriting properly now)
  • Loading branch information
cosmicgenius committed Oct 6, 2020
1 parent 9315c4d commit 2f555e9
Show file tree
Hide file tree
Showing 32 changed files with 177 additions and 1,434 deletions.
Binary file modified Trains/assets/Tilemap.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions Trains/src/Mechanics.gd
Expand Up @@ -9,7 +9,6 @@ var max_levels = 12
const LEVEL_PREFIX: String = "res://src/levels/%s/Level_"

const LEVEL_SELECT: String = "res://src/ui/LevelSelect.tscn"
const WIN_SCREEN: String = "res://src/ui/WinScreen.tscn"

signal on_win

Expand Down Expand Up @@ -37,4 +36,4 @@ func _go_to_next_level() -> void:
if current_level != max_levels:
tree.change_scene(LEVEL_PREFIX % tree.current_scene.filename.split("/")[4] + str(current_level + 1) + ".tscn")
else:
tree.change_scene(WIN_SCREEN)
tree.change_scene(LEVEL_SELECT)
5 changes: 4 additions & 1 deletion Trains/src/blocks/Block.gd
Expand Up @@ -36,7 +36,10 @@ func set_move_dir_index(new_index: int) -> bool:

var can_move: bool = true
for block in _targets:
can_move = can_move and block.set_move_dir_index(new_index)
# we want set_move_dir_index to propagate down no matter if can_move is
# true or not
var next_works = block.set_move_dir_index(new_index)
can_move = can_move and next_works

return can_move

Expand Down
2 changes: 1 addition & 1 deletion Trains/src/levels/LevelNumber.gd
@@ -1,4 +1,4 @@
extends Label

func _ready() -> void:
text = text % int(get_tree().current_scene.name)
text = text % int(get_tree().current_scene.filename)
119 changes: 1 addition & 118 deletions Trains/src/levels/beginnings/Level_1.tscn
@@ -1,122 +1,6 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=2 format=2]

[ext_resource path="res://src/levels/LevelTemplate.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/Tilemap.png" type="Texture" id=2]

[sub_resource type="TileSet" id=1]
resource_local_to_scene = true
0/name = "Tilemap.png 0"
0/texture = ExtResource( 2 )
0/tex_offset = Vector2( 0, 0 )
0/modulate = Color( 1, 1, 1, 1 )
0/region = Rect2( 0, 0, 8, 8 )
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_one_way = false
0/shape_one_way_margin = 0.0
0/shapes = [ ]
0/z_index = 0
1/name = "Tilemap.png 1"
1/texture = ExtResource( 2 )
1/tex_offset = Vector2( 0, 0 )
1/modulate = Color( 1, 1, 1, 1 )
1/region = Rect2( 0, 8, 8, 8 )
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_one_way = false
1/shape_one_way_margin = 0.0
1/shapes = [ ]
1/z_index = 0
2/name = "Tilemap.png 2"
2/texture = ExtResource( 2 )
2/tex_offset = Vector2( 0, 0 )
2/modulate = Color( 1, 1, 1, 1 )
2/region = Rect2( 0, 16, 8, 8 )
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_one_way = false
2/shape_one_way_margin = 0.0
2/shapes = [ ]
2/z_index = 0
3/name = "Tilemap.png 3"
3/texture = ExtResource( 2 )
3/tex_offset = Vector2( 0, 0 )
3/modulate = Color( 1, 1, 1, 1 )
3/region = Rect2( 8, 0, 8, 8 )
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_one_way = false
3/shape_one_way_margin = 0.0
3/shapes = [ ]
3/z_index = 0
4/name = "Tilemap.png 4"
4/texture = ExtResource( 2 )
4/tex_offset = Vector2( 0, 0 )
4/modulate = Color( 1, 1, 1, 1 )
4/region = Rect2( 16, 0, 8, 8 )
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_one_way = false
4/shape_one_way_margin = 0.0
4/shapes = [ ]
4/z_index = 0
5/name = "Tilemap.png 5"
5/texture = ExtResource( 2 )
5/tex_offset = Vector2( 0, 0 )
5/modulate = Color( 1, 1, 1, 1 )
5/region = Rect2( 8, 8, 8, 8 )
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_one_way = false
5/shape_one_way_margin = 0.0
5/shapes = [ ]
5/z_index = 0
6/name = "Tilemap.png 6"
6/texture = ExtResource( 2 )
6/tex_offset = Vector2( 0, 0 )
6/modulate = Color( 1, 1, 1, 1 )
6/region = Rect2( 16, 8, 8, 8 )
6/tile_mode = 0
6/occluder_offset = Vector2( 0, 0 )
6/navigation_offset = Vector2( 0, 0 )
6/shape_offset = Vector2( 0, 0 )
6/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
6/shape_one_way = false
6/shape_one_way_margin = 0.0
6/shapes = [ ]
6/z_index = 0
7/name = "Tilemap.png 7"
7/texture = ExtResource( 2 )
7/tex_offset = Vector2( 0, 0 )
7/modulate = Color( 1, 1, 1, 1 )
7/region = Rect2( 0, 24, 8, 8 )
7/tile_mode = 0
7/occluder_offset = Vector2( 0, 0 )
7/navigation_offset = Vector2( 0, 0 )
7/shape_offset = Vector2( 0, 0 )
7/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
7/shape_one_way = false
7/shape_one_way_margin = 0.0
7/shapes = [ ]
7/z_index = 0

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

Expand All @@ -132,7 +16,6 @@ __meta__ = {
}

[node name="TileMap" parent="Game/Control" index="0"]
tile_set = SubResource( 1 )
tile_data = PoolIntArray( 131069, 1, 0, 131070, 1, 0, 131071, 1, 0, 65536, 1, 0, 65537, 1, 0, 65538, 1, 0, 196605, 1, 0, 196606, 3, 0, 196607, 0, 0, 131072, 2, 0, 131074, 1, 0, 262141, 1, 0, 262142, 1, 0, 262143, 1, 0, 196608, 1, 0, 196609, 1, 0, 196610, 1, 0 )

[node name="Label" type="Label" parent="Game/Control" index="1"]
Expand Down
119 changes: 1 addition & 118 deletions Trains/src/levels/beginnings/Level_10.tscn
@@ -1,125 +1,8 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=2 format=2]

[ext_resource path="res://src/levels/LevelTemplate.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/Tilemap.png" type="Texture" id=2]

[sub_resource type="TileSet" id=1]
resource_local_to_scene = true
0/name = "Tilemap.png 0"
0/texture = ExtResource( 2 )
0/tex_offset = Vector2( 0, 0 )
0/modulate = Color( 1, 1, 1, 1 )
0/region = Rect2( 0, 0, 8, 8 )
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_one_way = false
0/shape_one_way_margin = 0.0
0/shapes = [ ]
0/z_index = 0
1/name = "Tilemap.png 1"
1/texture = ExtResource( 2 )
1/tex_offset = Vector2( 0, 0 )
1/modulate = Color( 1, 1, 1, 1 )
1/region = Rect2( 0, 8, 8, 8 )
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_one_way = false
1/shape_one_way_margin = 0.0
1/shapes = [ ]
1/z_index = 0
2/name = "Tilemap.png 2"
2/texture = ExtResource( 2 )
2/tex_offset = Vector2( 0, 0 )
2/modulate = Color( 1, 1, 1, 1 )
2/region = Rect2( 0, 16, 8, 8 )
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_one_way = false
2/shape_one_way_margin = 0.0
2/shapes = [ ]
2/z_index = 0
3/name = "Tilemap.png 3"
3/texture = ExtResource( 2 )
3/tex_offset = Vector2( 0, 0 )
3/modulate = Color( 1, 1, 1, 1 )
3/region = Rect2( 8, 0, 8, 8 )
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_one_way = false
3/shape_one_way_margin = 0.0
3/shapes = [ ]
3/z_index = 0
4/name = "Tilemap.png 4"
4/texture = ExtResource( 2 )
4/tex_offset = Vector2( 0, 0 )
4/modulate = Color( 1, 1, 1, 1 )
4/region = Rect2( 16, 0, 8, 8 )
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_one_way = false
4/shape_one_way_margin = 0.0
4/shapes = [ ]
4/z_index = 0
5/name = "Tilemap.png 5"
5/texture = ExtResource( 2 )
5/tex_offset = Vector2( 0, 0 )
5/modulate = Color( 1, 1, 1, 1 )
5/region = Rect2( 8, 8, 8, 8 )
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_one_way = false
5/shape_one_way_margin = 0.0
5/shapes = [ ]
5/z_index = 0
6/name = "Tilemap.png 6"
6/texture = ExtResource( 2 )
6/tex_offset = Vector2( 0, 0 )
6/modulate = Color( 1, 1, 1, 1 )
6/region = Rect2( 16, 8, 8, 8 )
6/tile_mode = 0
6/occluder_offset = Vector2( 0, 0 )
6/navigation_offset = Vector2( 0, 0 )
6/shape_offset = Vector2( 0, 0 )
6/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
6/shape_one_way = false
6/shape_one_way_margin = 0.0
6/shapes = [ ]
6/z_index = 0
7/name = "Tilemap.png 7"
7/texture = ExtResource( 2 )
7/tex_offset = Vector2( 0, 0 )
7/modulate = Color( 1, 1, 1, 1 )
7/region = Rect2( 0, 24, 8, 8 )
7/tile_mode = 0
7/occluder_offset = Vector2( 0, 0 )
7/navigation_offset = Vector2( 0, 0 )
7/shape_offset = Vector2( 0, 0 )
7/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
7/shape_one_way = false
7/shape_one_way_margin = 0.0
7/shapes = [ ]
7/z_index = 0

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

[node name="TileMap" parent="Game/Control" index="0"]
tile_set = SubResource( 1 )
tile_data = PoolIntArray( 131069, 1, 0, 131070, 1, 0, 131071, 1, 0, 65536, 1, 0, 65537, 1, 0, 65538, 1, 0, 196605, 1, 0, 196606, 0, 0, 196607, 6, 0, 131072, 0, 0, 131073, 0, 0, 131074, 1, 0, 262141, 1, 0, 262142, 3, 0, 262143, 7, 0, 196608, 0, 0, 196609, 5, 0, 196610, 1, 0, 327677, 1, 0, 327678, 0, 0, 327679, 6, 0, 262144, 7, 0, 262145, 0, 0, 262146, 1, 0, 393213, 1, 0, 393215, 0, 0, 327680, 5, 0, 327681, 2, 0, 327682, 1, 0, 458749, 1, 0, 458750, 7, 0, 458751, 0, 0, 393216, 2, 0, 393217, 4, 0, 393218, 1, 0, 524285, 1, 0, 524286, 1, 0, 524287, 1, 0, 458752, 1, 0, 458753, 1, 0, 458754, 1, 0 )

1 comment on commit 2f555e9

@cosmicgenius
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More notes:

Doubling Up level 9 is courtesy of William Yue

Please sign in to comment.