mirror of
https://github.com/Escada-Games/diver-down.git
synced 2026-01-23 18:04:44 +00:00
93 lines
5.2 KiB
Text
93 lines
5.2 KiB
Text
[gd_scene load_steps=8 format=2]
|
|
|
|
[ext_resource path="res://Scenes/pause_manager/pause_manager.tscn" type="PackedScene" id=1]
|
|
[ext_resource path="res://Scenes/player_default/player.tscn" type="PackedScene" id=2]
|
|
[ext_resource path="res://Resources/tilemap.tres" type="TileSet" id=3]
|
|
[ext_resource path="res://Scenes/spotlight_on_timer.tscn" type="PackedScene" id=4]
|
|
[ext_resource path="res://Scenes/next_level.tscn" type="PackedScene" id=5]
|
|
[ext_resource path="res://Scenes/stages/1.tscn" type="PackedScene" id=6]
|
|
|
|
[sub_resource type="GDScript" id=1]
|
|
|
|
script/source = "extends TileMap
|
|
#I don't really know how to use Godot's autotile the right away, so I'm using this code!
|
|
var grid_size = Vector2(25,16)
|
|
var North = 1; var West = 2; var East = 4; var South = 8
|
|
var directions = [North, South, East, West]
|
|
var dictionary_paths = {
|
|
North: Vector2(0, -1),
|
|
South: Vector2(0, +1),
|
|
East: Vector2(+1, 0),
|
|
West: Vector2(-1, 0)}
|
|
|
|
func _ready():
|
|
print('Tilemap: Beginning autotile...')
|
|
for x in range(grid_size.x - 1):
|
|
for y in range(grid_size.y - 1):
|
|
if get_cell(x,y)!=-1:
|
|
var north_tile = 1 if get_cell(x,y-1) != -1 else 0
|
|
var west_tile = 1 if get_cell(x-1,y) != -1 else 0
|
|
var east_tile = 1 if get_cell(x+1,y) != -1 else 0
|
|
var south_tile = 1 if get_cell(x,y+1) != -1 else 0
|
|
var tile_index = 0 + North * north_tile + West * west_tile + East * east_tile + South * south_tile
|
|
if tile_index==15:
|
|
if(randf()<0.2): tile_index+=randi()%12
|
|
pass
|
|
set_cell(x, y, tile_index)
|
|
print('Tilemap: Autotiling done!')"
|
|
|
|
[node name="debug" type="Node2D"]
|
|
|
|
[node name="pause_manager" parent="." index="0" instance=ExtResource( 1 )]
|
|
|
|
[node name="stage" type="Control" parent="." index="1"]
|
|
|
|
anchor_left = 0.0
|
|
anchor_top = 0.0
|
|
anchor_right = 0.0
|
|
anchor_bottom = 0.0
|
|
margin_right = 40.0
|
|
margin_bottom = 40.0
|
|
rect_pivot_offset = Vector2( 0, 0 )
|
|
rect_clip_content = false
|
|
mouse_filter = 0
|
|
mouse_default_cursor_shape = 0
|
|
size_flags_horizontal = 1
|
|
size_flags_vertical = 1
|
|
|
|
[node name="player" parent="stage" index="0" instance=ExtResource( 2 )]
|
|
|
|
position = Vector2( 284, 166 )
|
|
|
|
[node name="solid" type="TileMap" parent="stage" index="1"]
|
|
|
|
mode = 0
|
|
tile_set = ExtResource( 3 )
|
|
cell_size = Vector2( 16, 16 )
|
|
cell_quadrant_size = 16
|
|
cell_custom_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
|
|
cell_half_offset = 2
|
|
cell_tile_origin = 0
|
|
cell_y_sort = false
|
|
cell_clip_uv = false
|
|
collision_use_kinematic = false
|
|
collision_friction = 1.0
|
|
collision_bounce = 0.0
|
|
collision_layer = 5
|
|
collision_mask = 5
|
|
occluder_light_mask = 1
|
|
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, 65536, 0, 0, 65542, 0, 0, 65544, 0, 0, 65547, 0, 0, 65549, 0, 0, 65553, 0, 0, 65559, 0, 0, 131072, 0, 0, 131078, 0, 0, 131079, 0, 0, 131080, 0, 0, 131081, 0, 0, 131084, 0, 0, 131087, 0, 0, 131088, 0, 0, 131089, 0, 0, 131090, 0, 0, 131091, 0, 0, 131092, 0, 0, 131095, 0, 0, 196608, 0, 0, 196610, 0, 0, 196617, 0, 0, 196620, 0, 0, 196623, 0, 0, 196625, 0, 0, 196631, 0, 0, 262144, 0, 0, 262153, 0, 0, 262156, 0, 0, 262159, 0, 0, 262160, 0, 0, 262161, 0, 0, 262167, 0, 0, 327680, 0, 0, 327687, 0, 0, 327688, 0, 0, 327689, 0, 0, 327690, 0, 0, 327691, 0, 0, 327692, 0, 0, 327702, 0, 0, 327703, 0, 0, 393216, 0, 0, 393218, 0, 0, 393219, 0, 0, 393225, 0, 0, 393228, 0, 0, 393236, 0, 0, 393238, 0, 0, 393239, 0, 0, 458752, 0, 0, 458754, 0, 0, 458761, 0, 0, 458764, 0, 0, 458772, 0, 0, 458774, 0, 0, 458775, 0, 0, 524288, 0, 0, 524290, 0, 0, 524291, 0, 0, 524292, 0, 0, 524293, 0, 0, 524294, 0, 0, 524295, 0, 0, 524298, 0, 0, 524299, 0, 0, 524300, 0, 0, 524308, 0, 0, 524310, 0, 0, 524311, 0, 0, 589824, 0, 0, 589831, 0, 0, 589832, 0, 0, 589833, 0, 0, 589834, 0, 0, 589835, 0, 0, 589836, 0, 0, 589844, 0, 0, 589846, 0, 0, 589847, 0, 0, 655360, 0, 0, 655365, 0, 0, 655366, 0, 0, 655367, 0, 0, 655368, 0, 0, 655369, 0, 0, 655370, 0, 0, 655371, 0, 0, 655372, 0, 0, 655373, 0, 0, 655374, 0, 0, 655380, 0, 0, 655382, 0, 0, 655383, 0, 0, 720896, 0, 0, 720900, 0, 0, 720901, 0, 0, 720902, 0, 0, 720903, 0, 0, 720904, 0, 0, 720905, 0, 0, 720906, 0, 0, 720907, 0, 0, 720908, 0, 0, 720909, 0, 0, 720910, 0, 0, 720911, 0, 0, 720918, 0, 0, 720919, 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, 786454, 0, 0, 786455, 0, 0, 851968, 0, 0, 851969, 0, 0, 851970, 0, 0, 851971, 0, 0, 851972, 0, 0, 851973, 0, 0, 851974, 0, 0, 851975, 0, 0, 851976, 0, 0, 851977, 0, 0, 851978, 0, 0, 851979, 0, 0, 851980, 0, 0, 851981, 0, 0, 851982, 0, 0, 851983, 0, 0, 851984, 0, 0, 851985, 0, 0, 851986, 0, 0, 851987, 0, 0, 851988, 0, 0, 851989, 0, 0, 851990, 0, 0, 851991, 0, 0 )
|
|
script = SubResource( 1 )
|
|
_sections_unfolded = [ "Cell", "Collision", "Material", "Transform" ]
|
|
|
|
[node name="spotlight_on_timer" parent="stage" index="2" instance=ExtResource( 4 )]
|
|
|
|
delay = 0
|
|
|
|
[node name="next_level" parent="stage" index="3" instance=ExtResource( 5 )]
|
|
|
|
position = Vector2( 252, 130 )
|
|
next_level = ExtResource( 6 )
|
|
|
|
|