Add windows and outer space

This commit is contained in:
Hamcha 2020-07-06 19:23:42 +02:00
parent f65ef4b8f9
commit 3c813d98e4
Signed by: hamcha
GPG key ID: 41467804B19A3315
13 changed files with 315 additions and 10 deletions

View file

@ -10,12 +10,10 @@ func set_open(open: bool):
func _animation_finished():
if $Sprite.animation == "open":
print("Door opened")
# Disable collider
collision_layer = 2
collision_mask = 2
collision_layer = 16
collision_mask = 16
else:
print("Door closed")
# Enable collider
collision_mask = 1
collision_layer = 1

BIN
Graphics/space.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

34
Graphics/space.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/space.png-892d3a0f9c50c1abbcaa3013abc92b4f.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/space.png"
dest_files=[ "res://.import/space.png-892d3a0f9c50c1abbcaa3013abc92b4f.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=true
svg/scale=1.0

View file

@ -1,6 +1,7 @@
[gd_resource type="TileSet" load_steps=36 format=2]
[gd_resource type="TileSet" load_steps=52 format=2]
[ext_resource path="res://Graphics/tgstation/walls.png" type="Texture" id=1]
[ext_resource path="res://Graphics/tgstation/windows.png" type="Texture" id=2]
[sub_resource type="OccluderPolygon2D" id=1]
polygon = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
@ -104,6 +105,51 @@ points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=34]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=35]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=36]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=37]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=38]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=39]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=40]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=41]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=42]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=43]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=44]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=45]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=46]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=47]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=48]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=49]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[resource]
0/name = "Wall"
0/texture = ExtResource( 1 )
@ -231,3 +277,117 @@ points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
0/z_index = 0
1/name = "Window"
1/texture = ExtResource( 2 )
1/tex_offset = Vector2( 0, 0 )
1/modulate = Color( 1, 1, 1, 1 )
1/region = Rect2( 0, 0, 64, 64 )
1/tile_mode = 1
1/autotile/bitmask_mode = 0
1/autotile/bitmask_flags = [ Vector2( 0, 0 ), 324, Vector2( 0, 1 ), 260, Vector2( 0, 2 ), 256, Vector2( 0, 3 ), 325, Vector2( 1, 0 ), 69, Vector2( 1, 1 ), 65, Vector2( 1, 2 ), 1, Vector2( 1, 3 ), 320, Vector2( 2, 0 ), 261, Vector2( 2, 1 ), 260, Vector2( 2, 2 ), 4, Vector2( 2, 3 ), 321, Vector2( 3, 0 ), 65, Vector2( 3, 1 ), 64, Vector2( 3, 2 ), 5 ]
1/autotile/icon_coordinate = Vector2( 0, 0 )
1/autotile/tile_size = Vector2( 16, 16 )
1/autotile/spacing = 0
1/autotile/occluder_map = [ ]
1/autotile/navpoly_map = [ ]
1/autotile/priority_map = [ ]
1/autotile/z_index_map = [ ]
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( 35 )
1/shape_one_way = false
1/shape_one_way_margin = 1.0
1/shapes = [ {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 35 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 1, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 36 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 2, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 37 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 3, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 38 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 3, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 39 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 2, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 40 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 1, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 41 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 42 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 43 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 1, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 44 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 2, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 45 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 3, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 46 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 2, 3 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 47 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 1, 3 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 48 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 3 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 49 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
1/z_index = 0

View file

@ -1,7 +1,8 @@
[gd_resource type="TileSet" load_steps=5 format=2]
[gd_resource type="TileSet" load_steps=7 format=2]
[ext_resource path="res://Graphics/tgstation/floor.png" type="Texture" id=1]
[ext_resource path="res://Graphics/tgstation/wall.png" type="Texture" id=2]
[ext_resource path="res://Graphics/tgstation/window.png" type="Texture" id=3]
[sub_resource type="OccluderPolygon2D" id=1]
polygon = PoolVector2Array( 32, 32, 0, 32, 0, 0, 32, 0 )
@ -9,6 +10,9 @@ polygon = PoolVector2Array( 32, 32, 0, 32, 0, 0, 32, 0 )
[sub_resource type="ConvexPolygonShape2D" id=2]
points = PoolVector2Array( 32, 32, 0, 32, 0, 0, 32, 0 )
[sub_resource type="ConvexPolygonShape2D" id=3]
points = PoolVector2Array( 0, 0, 32, 0, 32, 32, 0, 32 )
[resource]
1/name = "Floor"
1/texture = ExtResource( 1 )
@ -46,3 +50,24 @@ points = PoolVector2Array( 32, 32, 0, 32, 0, 0, 32, 0 )
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
2/z_index = 0
3/name = "Window"
3/texture = ExtResource( 3 )
3/tex_offset = Vector2( 0, 0 )
3/modulate = Color( 1, 1, 1, 1 )
3/region = Rect2( 0, 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( 3 )
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( 3 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
3/z_index = 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/window.png-51d84bd3bbfd6da21752c4226e376ebf.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/tgstation/window.png"
dest_files=[ "res://.import/window.png-51d84bd3bbfd6da21752c4226e376ebf.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=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/windows.png-08dd2d703ba4676d18e3c52ccb7fc1cc.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Graphics/tgstation/windows.png"
dest_files=[ "res://.import/windows.png-08dd2d703ba4676d18e3c52ccb7fc1cc.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=true
svg/scale=1.0

View file

@ -20,7 +20,7 @@ compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2

View file

@ -2,5 +2,11 @@ extends Node2D
class_name Map
var ship_direction = Vector2.RIGHT
var ship_speed = 1000
export(NodePath) var tilemap_path
onready var tilemap = get_node(tilemap_path) as MapTiles
func _process(delta):
$deepspace.region_rect.position += ship_direction * ship_speed * delta

File diff suppressed because one or more lines are too long

View file

@ -5,6 +5,10 @@ class_name MapTiles
export(NodePath) var extended_tilemap_node
export var occluders = ["Wall"]
export var replace_with = {
"Window": "Floor"
}
export var shadow_intensity = 0.2
onready var extended_tilemap = get_node(extended_tilemap_node) as TileMap
@ -24,6 +28,10 @@ func convert_extended():
if extended_id < 0:
# Not found, skip it
continue
# Check if a replacement exists (for flooring)
var replacement = -1
if replace_with.has(name):
replacement = tile_set.find_tile_by_name(replace_with[name])
# Find all uses of this tile
for cell in get_used_cells_by_id(id):
var x = cell.x * 2
@ -32,7 +40,7 @@ func convert_extended():
extended_tilemap.set_cell(x+1, y, extended_id)
extended_tilemap.set_cell(x, y+1, extended_id)
extended_tilemap.set_cell(x+1, y+1, extended_id)
set_cellv(cell, -1)
set_cellv(cell, replacement)
extended_tilemap.update_bitmask_region()
extended_tilemap.update_dirty_quadrants()