commit ba89ea8b4900fc881a5ea2adb9f7895151709732 Author: Hamcha Date: Mon Jul 6 14:38:05 2020 +0200 First commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8e694a3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.import +export \ No newline at end of file diff --git a/Actors/Player/Player.gd b/Actors/Player/Player.gd new file mode 100755 index 0000000..d20db1f --- /dev/null +++ b/Actors/Player/Player.gd @@ -0,0 +1,21 @@ +extends KinematicBody2D + +const SPEED = 320.0 +const EPSILON = 0.1 + +export var is_controlled = false setget set_is_controlled + +func _ready(): + $Camera.current = is_controlled + +func _physics_process(_delta): + var motion = Vector2( + Input.get_action_strength("ui_right")-Input.get_action_strength("ui_left"), + Input.get_action_strength("ui_down")-Input.get_action_strength("ui_up")) + if motion.length() > EPSILON: + $Sprite/AnimationTree.set("parameters/direction/blend_position", motion) + move_and_slide(motion.clamped(1.0) * SPEED) + +func set_is_controlled(val): + is_controlled = val + $Camera.current = val diff --git a/Actors/Player/Player.tscn b/Actors/Player/Player.tscn new file mode 100755 index 0000000..d046691 --- /dev/null +++ b/Actors/Player/Player.tscn @@ -0,0 +1,19 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://Graphics/tgstation/sprites/Player.tscn" type="PackedScene" id=1] +[ext_resource path="res://Actors/Player/Player.gd" type="Script" id=2] + +[sub_resource type="CapsuleShape2D" id=1] +radius = 10.4436 +height = 5.44386 + +[node name="Player" type="KinematicBody2D"] +script = ExtResource( 2 ) + +[node name="Camera" type="Camera2D" parent="."] + +[node name="Sprite" parent="." instance=ExtResource( 1 )] +position = Vector2( 0, -3 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource( 1 ) diff --git a/Graphics/tgstation/1x1.tres b/Graphics/tgstation/1x1.tres new file mode 100644 index 0000000..e6ed898 --- /dev/null +++ b/Graphics/tgstation/1x1.tres @@ -0,0 +1,233 @@ +[gd_resource type="TileSet" load_steps=36 format=2] + +[ext_resource path="res://Graphics/tgstation/walls.png" type="Texture" id=1] + +[sub_resource type="OccluderPolygon2D" id=1] +polygon = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="OccluderPolygon2D" id=2] +polygon = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="OccluderPolygon2D" id=3] +polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="OccluderPolygon2D" id=4] +polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="OccluderPolygon2D" id=5] +polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="OccluderPolygon2D" id=6] +polygon = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="OccluderPolygon2D" id=7] +polygon = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="OccluderPolygon2D" id=8] +polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="OccluderPolygon2D" id=9] +polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="OccluderPolygon2D" id=10] +polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="OccluderPolygon2D" id=11] +polygon = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="OccluderPolygon2D" id=12] +polygon = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="OccluderPolygon2D" id=13] +polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="OccluderPolygon2D" id=14] +polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="OccluderPolygon2D" id=15] +polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="OccluderPolygon2D" id=16] +polygon = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="OccluderPolygon2D" id=17] +polygon = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=18] +points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=19] +points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=20] +points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=21] +points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=22] +points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=23] +points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=24] +points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=25] +points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=26] +points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 ) + +[sub_resource type="ConvexPolygonShape2D" id=27] +points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=28] +points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=29] +points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=30] +points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=31] +points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=32] +points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=33] +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 ) + +[resource] +0/name = "Wall" +0/texture = ExtResource( 1 ) +0/tex_offset = Vector2( 0, 0 ) +0/modulate = Color( 1, 1, 1, 1 ) +0/region = Rect2( 0, 0, 64, 80 ) +0/tile_mode = 1 +0/autotile/bitmask_mode = 0 +0/autotile/bitmask_flags = [ Vector2( 0, 0 ), 69, Vector2( 0, 1 ), 65, Vector2( 0, 2 ), 1, Vector2( 0, 3 ), 5, Vector2( 0, 4 ), 5, Vector2( 1, 0 ), 261, Vector2( 1, 1 ), 260, Vector2( 1, 2 ), 4, Vector2( 1, 3 ), 325, Vector2( 1, 4 ), 65, Vector2( 2, 0 ), 64, Vector2( 2, 1 ), 320, Vector2( 2, 2 ), 320, Vector2( 2, 3 ), 324, Vector2( 2, 4 ), 260, Vector2( 3, 0 ), 256, Vector2( 3, 1 ), 321 ] +0/autotile/icon_coordinate = Vector2( 0, 0 ) +0/autotile/tile_size = Vector2( 16, 16 ) +0/autotile/spacing = 0 +0/autotile/occluder_map = [ Vector2( 0, 0 ), SubResource( 1 ), Vector2( 0, 1 ), SubResource( 2 ), Vector2( 0, 2 ), SubResource( 3 ), Vector2( 0, 3 ), SubResource( 4 ), Vector2( 0, 4 ), SubResource( 5 ), Vector2( 1, 0 ), SubResource( 6 ), Vector2( 1, 1 ), SubResource( 7 ), Vector2( 1, 2 ), SubResource( 8 ), Vector2( 1, 3 ), SubResource( 9 ), Vector2( 1, 4 ), SubResource( 10 ), Vector2( 2, 0 ), SubResource( 11 ), Vector2( 2, 1 ), SubResource( 12 ), Vector2( 2, 2 ), SubResource( 13 ), Vector2( 2, 3 ), SubResource( 14 ), Vector2( 2, 4 ), SubResource( 15 ), Vector2( 3, 0 ), SubResource( 16 ), Vector2( 3, 1 ), SubResource( 17 ) ] +0/autotile/navpoly_map = [ ] +0/autotile/priority_map = [ ] +0/autotile/z_index_map = [ ] +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( 18 ) +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( 18 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 1, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 19 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 2, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 20 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 3, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 21 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 3, 1 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 22 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 2, 1 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 23 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 2, 2 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 24 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 2, 3 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 25 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 2, 4 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 26 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 1, 4 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 27 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 0, 4 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 28 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 0, 3 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 29 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 1, 3 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 30 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 1, 2 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 31 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 0, 2 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 32 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 0, 1 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 33 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +}, { +"autotile_coord": Vector2( 1, 1 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 34 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +0/z_index = 0 diff --git a/Graphics/tgstation/2x2.tres b/Graphics/tgstation/2x2.tres new file mode 100644 index 0000000..67c7803 --- /dev/null +++ b/Graphics/tgstation/2x2.tres @@ -0,0 +1,48 @@ +[gd_resource type="TileSet" load_steps=5 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] + +[sub_resource type="OccluderPolygon2D" id=1] +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 ) + +[resource] +1/name = "Floor" +1/texture = ExtResource( 1 ) +1/tex_offset = Vector2( 0, 0 ) +1/modulate = Color( 1, 1, 1, 1 ) +1/region = Rect2( 0, 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_one_way = false +1/shape_one_way_margin = 0.0 +1/shapes = [ ] +1/z_index = 0 +2/name = "Wall" +2/texture = ExtResource( 2 ) +2/tex_offset = Vector2( 0, 0 ) +2/modulate = Color( 1, 1, 1, 1 ) +2/region = Rect2( 0, 0, 32, 32 ) +2/tile_mode = 0 +2/occluder_offset = Vector2( 0, 0 ) +2/occluder = SubResource( 1 ) +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( 2 ) +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( 2 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +2/z_index = 0 diff --git a/Graphics/tgstation/floor.png b/Graphics/tgstation/floor.png new file mode 100755 index 0000000..87e1969 Binary files /dev/null and b/Graphics/tgstation/floor.png differ diff --git a/Graphics/tgstation/floor.png.import b/Graphics/tgstation/floor.png.import new file mode 100755 index 0000000..3139dc1 --- /dev/null +++ b/Graphics/tgstation/floor.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/floor.png-3bcc52916d51a4ca8cbe3f63cd3f1ef7.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Graphics/tgstation/floor.png" +dest_files=[ "res://.import/floor.png-3bcc52916d51a4ca8cbe3f63cd3f1ef7.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 diff --git a/Graphics/tgstation/player.png b/Graphics/tgstation/player.png new file mode 100755 index 0000000..4ac17d4 Binary files /dev/null and b/Graphics/tgstation/player.png differ diff --git a/Graphics/tgstation/player.png.import b/Graphics/tgstation/player.png.import new file mode 100755 index 0000000..aff8804 --- /dev/null +++ b/Graphics/tgstation/player.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/player.png-2bc4dbaa0a130ff55afac0b8708317d4.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Graphics/tgstation/player.png" +dest_files=[ "res://.import/player.png-2bc4dbaa0a130ff55afac0b8708317d4.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 diff --git a/Graphics/tgstation/sprites/Player.tscn b/Graphics/tgstation/sprites/Player.tscn new file mode 100755 index 0000000..798f76a --- /dev/null +++ b/Graphics/tgstation/sprites/Player.tscn @@ -0,0 +1,106 @@ +[gd_scene load_steps=12 format=2] + +[ext_resource path="res://Graphics/tgstation/player.png" type="Texture" id=1] + +[sub_resource type="AnimationNodeAnimation" id=11] +animation = "left" + +[sub_resource type="AnimationNodeAnimation" id=12] +animation = "right" + +[sub_resource type="AnimationNodeAnimation" id=13] +animation = "up" + +[sub_resource type="AnimationNodeAnimation" id=14] +animation = "down" + +[sub_resource type="AnimationNodeBlendSpace2D" id=15] +blend_point_0/node = SubResource( 11 ) +blend_point_0/pos = Vector2( -1, 0 ) +blend_point_1/node = SubResource( 12 ) +blend_point_1/pos = Vector2( 1, 0 ) +blend_point_2/node = SubResource( 13 ) +blend_point_2/pos = Vector2( 0, -1 ) +blend_point_3/node = SubResource( 14 ) +blend_point_3/pos = Vector2( 0, 1 ) +blend_mode = 1 + +[sub_resource type="AnimationNodeBlendTree" id=16] +graph_offset = Vector2( -794.59, 0 ) +nodes/direction/node = SubResource( 15 ) +nodes/direction/position = Vector2( -160, 140 ) +nodes/output/position = Vector2( 200, 140 ) +node_connections = [ "output", 0, "direction" ] + +[sub_resource type="Animation" id=7] +tracks/0/type = "value" +tracks/0/path = NodePath(".:region_rect") +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": [ Rect2( 0, 32, 32, 32 ) ] +} + +[sub_resource type="Animation" id=8] +tracks/0/type = "value" +tracks/0/path = NodePath(".:region_rect") +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": [ Rect2( 0, 0, 32, 32 ) ] +} + +[sub_resource type="Animation" id=9] +tracks/0/type = "value" +tracks/0/path = NodePath(".:region_rect") +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": [ Rect2( 32, 32, 32, 32 ) ] +} + +[sub_resource type="Animation" id=10] +tracks/0/type = "value" +tracks/0/path = NodePath(".:region_rect") +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": [ Rect2( 32, 0, 32, 32 ) ] +} + +[node name="Sprite" type="Sprite"] +texture = ExtResource( 1 ) +region_enabled = true +region_rect = Rect2( 0, 32, 32, 32 ) + +[node name="AnimationTree" type="AnimationTree" parent="."] +tree_root = SubResource( 16 ) +anim_player = NodePath("../AnimationPlayer") +active = true +parameters/direction/blend_position = Vector2( -0.00416231, 0.751938 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/down = SubResource( 7 ) +anims/left = SubResource( 8 ) +anims/right = SubResource( 9 ) +anims/up = SubResource( 10 ) diff --git a/Graphics/tgstation/wall.png b/Graphics/tgstation/wall.png new file mode 100755 index 0000000..90a1dd5 Binary files /dev/null and b/Graphics/tgstation/wall.png differ diff --git a/Graphics/tgstation/wall.png.import b/Graphics/tgstation/wall.png.import new file mode 100755 index 0000000..7596577 --- /dev/null +++ b/Graphics/tgstation/wall.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/wall.png-e5c95676f513fa835a32b4600b4c3523.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Graphics/tgstation/wall.png" +dest_files=[ "res://.import/wall.png-e5c95676f513fa835a32b4600b4c3523.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 diff --git a/Graphics/tgstation/walls.png b/Graphics/tgstation/walls.png new file mode 100755 index 0000000..fe673b5 Binary files /dev/null and b/Graphics/tgstation/walls.png differ diff --git a/Graphics/tgstation/walls.png.import b/Graphics/tgstation/walls.png.import new file mode 100755 index 0000000..be868ad --- /dev/null +++ b/Graphics/tgstation/walls.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/walls.png-e453136f1b46942ddc6ca86403dc6223.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Graphics/tgstation/walls.png" +dest_files=[ "res://.import/walls.png-e453136f1b46942ddc6ca86403dc6223.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 diff --git a/Graphics/transparent.png b/Graphics/transparent.png new file mode 100755 index 0000000..a4ea801 Binary files /dev/null and b/Graphics/transparent.png differ diff --git a/Graphics/transparent.png.import b/Graphics/transparent.png.import new file mode 100755 index 0000000..3b5ab00 --- /dev/null +++ b/Graphics/transparent.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/transparent.png-1fa4de1c3f689a5fec6b3c5d5ff27197.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Graphics/transparent.png" +dest_files=[ "res://.import/transparent.png-1fa4de1c3f689a5fec6b3c5d5ff27197.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=true +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 diff --git a/Graphics/white.png b/Graphics/white.png new file mode 100755 index 0000000..7e085ef Binary files /dev/null and b/Graphics/white.png differ diff --git a/Graphics/white.png.import b/Graphics/white.png.import new file mode 100755 index 0000000..7dca528 --- /dev/null +++ b/Graphics/white.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/white.png-2a69117bc9fb59df3ae112ae8fa17105.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Graphics/white.png" +dest_files=[ "res://.import/white.png-2a69117bc9fb59df3ae112ae8fa17105.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 diff --git a/Scenes/Map.gd b/Scenes/Map.gd new file mode 100755 index 0000000..7604237 --- /dev/null +++ b/Scenes/Map.gd @@ -0,0 +1,6 @@ +extends Node2D + +class_name Map + +export(NodePath) var tilemap_path +onready var tilemap = get_node(tilemap_path) as MapTiles diff --git a/Scenes/Maps/odyssey.tscn b/Scenes/Maps/odyssey.tscn new file mode 100644 index 0000000..59f554a --- /dev/null +++ b/Scenes/Maps/odyssey.tscn @@ -0,0 +1,31 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://Graphics/tgstation/2x2.tres" type="TileSet" id=1] +[ext_resource path="res://Graphics/tgstation/1x1.tres" type="TileSet" id=2] +[ext_resource path="res://Scenes/Rendering/MapTiles.gd" type="Script" id=3] +[ext_resource path="res://Scenes/clown-dir1.png" type="Texture" id=4] +[ext_resource path="res://Scenes/Map.gd" type="Script" id=5] + +[node name="map" type="Node2D"] +script = ExtResource( 5 ) +tilemap_path = NodePath("2x2") + +[node name="2x2" type="TileMap" parent="."] +tile_set = ExtResource( 1 ) +cell_size = Vector2( 32, 32 ) +cell_quadrant_size = 32 +occluder_light_mask = -2147483647 +format = 1 +tile_data = PoolIntArray( -393226, 1, 0, -393225, 1, 0, -393224, 1, 0, -393223, 1, 0, -393222, 1, 0, -393221, 1, 0, -393220, 1, 0, -393219, 1, 0, -393218, 1, 0, -393217, 1, 0, -458752, 1, 0, -458751, 1, 0, -458750, 1, 0, -458749, 1, 0, -458748, 1, 0, -458747, 1, 0, -458746, 1, 0, -458745, 1, 0, -458744, 1, 0, -458743, 1, 0, -458742, 1, 0, -458741, 1, 0, -458740, 1, 0, -458739, 1, 0, -458738, 1, 0, -458737, 1, 0, -458736, 1, 0, -458735, 1, 0, -458734, 1, 0, -458733, 1, 0, -458732, 1, 0, -458731, 1, 0, -458730, 1, 0, -458729, 1, 0, -458728, 1, 0, -327690, 1, 0, -327689, 1, 0, -327688, 1, 0, -327687, 1, 0, -327686, 1, 0, -327685, 1, 0, -327684, 1, 0, -327683, 1, 0, -327682, 1, 0, -327681, 1, 0, -393216, 1, 0, -393215, 1, 0, -393214, 1, 0, -393213, 1, 0, -393212, 1, 0, -393211, 1, 0, -393210, 1, 0, -393209, 1, 0, -393208, 1, 0, -393207, 1, 0, -393206, 1, 0, -393205, 1, 0, -393204, 1, 0, -393203, 1, 0, -393202, 1, 0, -393201, 1, 0, -393200, 1, 0, -393199, 1, 0, -393198, 1, 0, -393197, 1, 0, -393196, 1, 0, -393195, 1, 0, -393194, 1, 0, -393193, 1, 0, -393192, 1, 0, -262154, 1, 0, -262153, 1, 0, -262152, 1, 0, -262151, 1, 0, -262150, 1, 0, -262149, 1, 0, -262148, 1, 0, -262147, 1, 0, -262146, 1, 0, -262145, 1, 0, -327680, 1, 0, -327679, 1, 0, -327678, 1, 0, -327677, 1, 0, -327676, 1, 0, -327675, 1, 0, -327674, 1, 0, -327673, 1, 0, -327672, 1, 0, -327671, 1, 0, -327670, 1, 0, -327669, 1, 0, -327668, 1, 0, -327667, 1, 0, -327666, 1, 0, -327665, 1, 0, -327664, 1, 0, -327663, 1, 0, -327662, 1, 0, -327661, 1, 0, -327660, 1, 0, -327659, 1, 0, -327658, 1, 0, -327657, 1, 0, -327656, 1, 0, -196618, 1, 0, -196617, 1, 0, -196616, 1, 0, -196615, 1, 0, -196614, 1, 0, -196613, 1, 0, -196612, 1, 0, -196611, 1, 0, -196610, 1, 0, -196609, 1, 0, -262144, 1, 0, -262143, 1, 0, -262142, 1, 0, -262141, 1, 0, -262140, 1, 0, -262139, 1, 0, -262138, 1, 0, -262137, 1, 0, -262136, 1, 0, -262135, 1, 0, -262134, 1, 0, -262133, 1, 0, -262132, 1, 0, -262131, 1, 0, -262130, 1, 0, -262129, 1, 0, -262128, 1, 0, -262127, 1, 0, -262126, 1, 0, -262125, 1, 0, -262124, 1, 0, -262123, 1, 0, -262122, 1, 0, -262121, 1, 0, -262120, 1, 0, -131082, 1, 0, -131081, 1, 0, -131080, 1, 0, -131079, 1, 0, -131078, 1, 0, -131077, 1, 0, -131076, 1, 0, -131075, 1, 0, -131074, 1, 0, -131073, 1, 0, -196608, 1, 0, -196607, 1, 0, -196606, 1, 0, -196605, 1, 0, -196604, 1, 0, -196603, 1, 0, -196602, 1, 0, -196601, 1, 0, -196600, 1, 0, -196599, 1, 0, -196598, 1, 0, -196597, 1, 0, -196596, 1, 0, -196595, 1, 0, -196594, 1, 0, -196593, 1, 0, -196592, 1, 0, -196591, 1, 0, -196590, 1, 0, -196589, 1, 0, -196588, 1, 0, -196587, 1, 0, -196586, 1, 0, -196585, 1, 0, -196584, 1, 0, -65546, 1, 0, -65545, 1, 0, -65544, 1, 0, -65543, 1, 0, -65542, 1, 0, -65541, 1, 0, -65540, 1, 0, -65539, 1, 0, -65538, 1, 0, -65537, 1, 0, -131072, 1, 0, -131071, 1, 0, -131070, 1, 0, -131069, 1, 0, -131068, 1, 0, -131067, 1, 0, -131066, 1, 0, -131065, 1, 0, -131064, 1, 0, -131063, 1, 0, -131062, 1, 0, -131061, 1, 0, -131060, 1, 0, -131059, 1, 0, -131058, 1, 0, -131057, 1, 0, -131056, 1, 0, -131055, 1, 0, -131054, 1, 0, -131053, 1, 0, -131052, 1, 0, -131051, 1, 0, -131050, 1, 0, -131049, 1, 0, -131048, 1, 0, -10, 1, 0, -9, 1, 0, -8, 1, 0, -7, 1, 0, -6, 1, 0, -5, 1, 0, -4, 1, 0, -3, 1, 0, -2, 1, 0, -1, 1, 0, -65536, 1, 0, -65535, 1, 0, -65534, 1, 0, -65533, 1, 0, -65532, 1, 0, -65531, 1, 0, -65530, 1, 0, -65529, 1, 0, -65528, 1, 0, -65527, 1, 0, -65526, 1, 0, -65525, 1, 0, -65524, 1, 0, -65523, 1, 0, -65522, 1, 0, -65521, 1, 0, -65520, 1, 0, -65519, 1, 0, -65518, 1, 0, -65517, 1, 0, -65516, 1, 0, -65515, 1, 0, -65514, 1, 0, -65513, 1, 0, -65512, 1, 0, 65526, 1, 0, 65527, 1, 0, 65528, 1, 0, 65529, 1, 0, 65530, 1, 0, 65531, 1, 0, 65532, 1, 0, 65533, 1, 0, 65534, 1, 0, 65535, 1, 0, 0, 2, 0, 1, 2, 0, 2, 2, 0, 3, 2, 0, 4, 2, 0, 5, 2, 0, 6, 2, 0, 7, 2, 0, 8, 2, 0, 9, 2, 0, 10, 2, 0, 11, 2, 0, 12, 2, 0, 13, 2, 0, 14, 2, 0, 15, 1, 0, 16, 1, 0, 17, 1, 0, 18, 1, 0, 19, 1, 0, 20, 1, 0, 21, 1, 0, 22, 1, 0, 23, 1, 0, 24, 1, 0, 131062, 1, 0, 131063, 1, 0, 131064, 1, 0, 131065, 1, 0, 131066, 1, 0, 131067, 1, 0, 131068, 1, 0, 131069, 1, 0, 131070, 1, 0, 131071, 1, 0, 65536, 2, 0, 65537, 1, 0, 65538, 1, 0, 65539, 1, 0, 65540, 1, 0, 65541, 1, 0, 65542, 1, 0, 65543, 1, 0, 65544, 1, 0, 65545, 1, 0, 65546, 1, 0, 65547, 1, 0, 65548, 1, 0, 65549, 1, 0, 65550, 2, 0, 65551, 1, 0, 65552, 1, 0, 65553, 1, 0, 65554, 1, 0, 65555, 1, 0, 65556, 1, 0, 65557, 1, 0, 65558, 1, 0, 65559, 1, 0, 65560, 1, 0, 196598, 1, 0, 196599, 1, 0, 196600, 1, 0, 196601, 1, 0, 196602, 1, 0, 196603, 1, 0, 196604, 1, 0, 196605, 1, 0, 196606, 1, 0, 196607, 1, 0, 131072, 2, 0, 131073, 1, 0, 131074, 1, 0, 131075, 1, 0, 131076, 1, 0, 131077, 1, 0, 131078, 1, 0, 131079, 1, 0, 131080, 1, 0, 131081, 1, 0, 131082, 1, 0, 131083, 1, 0, 131084, 1, 0, 131085, 1, 0, 131086, 2, 0, 131087, 1, 0, 131088, 1, 0, 131089, 1, 0, 131090, 1, 0, 131091, 1, 0, 131092, 1, 0, 131093, 1, 0, 131094, 1, 0, 131095, 1, 0, 131096, 1, 0, 262134, 1, 0, 262135, 1, 0, 262136, 1, 0, 262137, 1, 0, 262138, 1, 0, 262139, 1, 0, 262140, 1, 0, 262141, 1, 0, 262142, 1, 0, 262143, 1, 0, 196608, 2, 0, 196609, 1, 0, 196610, 1, 0, 196611, 1, 0, 196612, 1, 0, 196613, 1, 0, 196614, 1, 0, 196615, 1, 0, 196616, 1, 0, 196617, 1, 0, 196618, 1, 0, 196619, 1, 0, 196620, 1, 0, 196621, 1, 0, 196622, 2, 0, 196623, 1, 0, 196624, 1, 0, 196625, 1, 0, 196626, 1, 0, 196627, 1, 0, 196628, 1, 0, 196629, 1, 0, 196630, 1, 0, 196631, 1, 0, 196632, 1, 0, 327670, 1, 0, 327671, 1, 0, 327672, 1, 0, 327673, 1, 0, 327674, 1, 0, 327675, 1, 0, 327676, 1, 0, 327677, 1, 0, 327678, 1, 0, 327679, 1, 0, 262144, 2, 0, 262145, 1, 0, 262146, 1, 0, 262147, 1, 0, 262148, 1, 0, 262149, 1, 0, 262150, 1, 0, 262151, 1, 0, 262152, 1, 0, 262153, 1, 0, 262154, 1, 0, 262155, 1, 0, 262156, 1, 0, 262157, 1, 0, 262158, 2, 0, 262159, 1, 0, 262160, 1, 0, 262161, 1, 0, 262162, 1, 0, 262163, 1, 0, 262164, 1, 0, 262165, 1, 0, 262166, 1, 0, 262167, 1, 0, 262168, 1, 0, 393206, 1, 0, 393207, 1, 0, 393208, 1, 0, 393209, 1, 0, 393210, 1, 0, 393211, 1, 0, 393212, 1, 0, 393213, 1, 0, 393214, 1, 0, 393215, 1, 0, 327680, 2, 0, 327681, 1, 0, 327682, 1, 0, 327683, 1, 0, 327684, 1, 0, 327685, 1, 0, 327686, 1, 0, 327687, 1, 0, 327688, 1, 0, 327689, 1, 0, 327690, 1, 0, 327691, 1, 0, 327692, 1, 0, 327693, 1, 0, 327694, 2, 0, 327695, 1, 0, 327696, 1, 0, 327697, 1, 0, 327698, 1, 0, 327699, 1, 0, 327700, 1, 0, 327701, 1, 0, 327702, 1, 0, 327703, 1, 0, 327704, 1, 0, 458742, 1, 0, 458743, 1, 0, 458744, 1, 0, 458745, 1, 0, 458746, 1, 0, 458747, 1, 0, 458748, 1, 0, 458749, 1, 0, 458750, 1, 0, 458751, 1, 0, 393216, 2, 0, 393217, 1, 0, 393218, 1, 0, 393219, 1, 0, 393220, 1, 0, 393221, 1, 0, 393222, 1, 0, 393223, 1, 0, 393224, 1, 0, 393225, 1, 0, 393226, 1, 0, 393227, 1, 0, 393228, 1, 0, 393229, 1, 0, 393230, 2, 0, 393231, 1, 0, 393232, 1, 0, 393233, 1, 0, 393234, 1, 0, 393235, 1, 0, 393236, 1, 0, 393237, 1, 0, 393238, 1, 0, 393239, 1, 0, 393240, 1, 0, 524278, 1, 0, 524279, 1, 0, 524280, 1, 0, 524281, 2, 0, 524282, 1, 0, 524283, 1, 0, 524284, 1, 0, 524285, 1, 0, 524286, 1, 0, 524287, 1, 0, 458752, 2, 0, 458753, 1, 0, 458754, 1, 0, 458755, 1, 0, 458756, 1, 0, 458757, 1, 0, 458758, 1, 0, 458759, 1, 0, 458760, 1, 0, 458761, 1, 0, 458762, 1, 0, 458763, 1, 0, 458764, 1, 0, 458765, 1, 0, 458766, 2, 0, 458767, 1, 0, 458768, 1, 0, 458769, 1, 0, 458770, 1, 0, 458771, 1, 0, 458772, 1, 0, 458773, 1, 0, 458774, 1, 0, 458775, 1, 0, 458776, 1, 0, 589814, 1, 0, 589815, 1, 0, 589816, 1, 0, 589817, 2, 0, 589818, 1, 0, 589819, 1, 0, 589820, 1, 0, 589821, 1, 0, 589822, 1, 0, 589823, 1, 0, 524288, 1, 0, 524289, 1, 0, 524290, 1, 0, 524291, 1, 0, 524292, 1, 0, 524293, 1, 0, 524294, 1, 0, 524295, 1, 0, 524296, 1, 0, 524297, 1, 0, 524298, 1, 0, 524299, 1, 0, 524300, 1, 0, 524301, 1, 0, 524302, 1, 0, 524303, 1, 0, 524304, 1, 0, 524305, 1, 0, 524306, 1, 0, 524307, 1, 0, 524308, 1, 0, 524309, 1, 0, 524310, 1, 0, 524311, 1, 0, 524312, 1, 0, 655350, 1, 0, 655351, 1, 0, 655352, 1, 0, 655353, 1, 0, 655354, 1, 0, 655355, 1, 0, 655356, 1, 0, 655357, 1, 0, 655358, 1, 0, 655359, 1, 0, 589824, 1, 0, 589825, 1, 0, 589826, 1, 0, 589827, 1, 0, 589828, 1, 0, 589829, 1, 0, 589830, 1, 0, 589831, 1, 0, 589832, 1, 0, 589833, 1, 0, 589834, 1, 0, 589835, 1, 0, 589836, 1, 0, 589837, 1, 0, 589838, 1, 0, 589839, 1, 0, 589840, 1, 0, 589841, 1, 0, 589842, 1, 0, 589843, 1, 0, 589844, 1, 0, 589845, 1, 0, 589846, 1, 0, 589847, 1, 0, 589848, 1, 0, 720886, 1, 0, 720887, 1, 0, 720888, 1, 0, 720889, 1, 0, 720890, 1, 0, 720891, 1, 0, 720892, 1, 0, 720893, 1, 0, 720894, 1, 0, 720895, 1, 0, 655360, 1, 0, 655361, 1, 0, 655362, 1, 0, 655363, 1, 0, 655364, 1, 0, 655365, 1, 0, 655366, 1, 0, 655367, 1, 0, 655368, 1, 0, 655369, 1, 0, 655370, 1, 0, 655371, 1, 0, 655372, 1, 0, 655373, 1, 0, 655374, 1, 0, 655375, 1, 0, 655376, 1, 0, 655377, 1, 0, 655378, 1, 0, 655379, 1, 0, 655380, 1, 0, 655381, 1, 0, 655382, 1, 0, 655383, 1, 0, 655384, 1, 0, 786422, 1, 0, 786423, 1, 0, 786424, 1, 0, 786425, 1, 0, 786426, 1, 0, 786427, 1, 0, 786428, 1, 0, 786429, 1, 0, 786430, 1, 0, 786431, 1, 0, 720896, 1, 0, 720897, 1, 0, 720898, 1, 0, 720899, 1, 0, 720900, 1, 0, 720901, 1, 0, 720902, 2, 0, 720903, 1, 0, 720904, 1, 0, 720905, 1, 0, 720906, 1, 0, 720907, 1, 0, 720908, 1, 0, 720909, 1, 0, 720910, 1, 0, 720911, 1, 0, 720912, 1, 0, 720913, 1, 0, 720914, 1, 0, 720915, 1, 0, 720916, 1, 0, 720917, 1, 0, 720918, 1, 0, 720919, 1, 0, 720920, 1, 0, 851958, 1, 0, 851959, 1, 0, 851960, 1, 0, 851961, 1, 0, 851962, 1, 0, 851963, 1, 0, 851964, 1, 0, 851965, 1, 0, 851966, 1, 0, 851967, 1, 0, 786432, 1, 0, 786433, 1, 0, 786434, 1, 0, 786435, 1, 0, 786436, 1, 0, 786437, 2, 0, 786438, 2, 0, 786439, 1, 0, 786440, 1, 0, 786441, 1, 0, 786442, 1, 0, 786443, 1, 0, 786444, 1, 0, 786445, 1, 0, 786446, 1, 0, 786447, 1, 0, 786448, 1, 0, 786449, 1, 0, 786450, 1, 0, 786451, 1, 0, 786452, 1, 0, 786453, 1, 0, 786454, 1, 0, 786455, 1, 0, 786456, 1, 0, 917494, 1, 0, 917495, 1, 0, 917496, 1, 0, 917497, 1, 0, 917498, 1, 0, 917499, 1, 0, 917500, 2, 0, 917501, 1, 0, 917502, 1, 0, 917503, 1, 0, 851968, 1, 0, 851969, 1, 0, 851970, 1, 0, 851971, 1, 0, 851972, 1, 0, 851973, 2, 0, 851974, 1, 0, 851975, 1, 0, 851976, 1, 0, 851977, 1, 0, 851978, 1, 0, 851979, 1, 0, 851980, 1, 0, 851981, 1, 0, 851982, 1, 0, 851983, 1, 0, 851984, 1, 0, 851985, 1, 0, 851986, 1, 0, 851987, 1, 0, 851988, 1, 0, 851989, 1, 0, 851990, 1, 0, 851991, 1, 0, 851992, 1, 0, 983030, 1, 0, 983031, 1, 0, 983032, 1, 0, 983033, 1, 0, 983034, 1, 0, 983035, 1, 0, 983036, 1, 0, 983037, 1, 0, 983038, 1, 0, 983039, 1, 0, 917504, 1, 0, 917505, 1, 0, 917506, 1, 0, 917507, 1, 0, 917508, 1, 0, 917509, 1, 0, 917510, 1, 0, 917511, 1, 0, 917512, 1, 0, 917513, 1, 0, 917514, 1, 0, 917515, 1, 0, 917516, 1, 0, 917517, 1, 0, 917518, 1, 0, 917519, 1, 0, 917520, 1, 0, 917521, 1, 0, 917522, 1, 0, 917523, 1, 0, 917524, 1, 0, 917525, 1, 0, 917526, 1, 0, 917527, 1, 0, 917528, 1, 0, 1048566, 1, 0, 1048567, 1, 0, 1048568, 1, 0, 1048569, 1, 0, 1048570, 1, 0, 1048571, 1, 0, 1048572, 1, 0, 1048573, 1, 0, 1048574, 1, 0, 1048575, 1, 0, 983040, 1, 0, 983041, 1, 0, 983042, 1, 0, 983043, 1, 0, 983044, 1, 0, 983045, 1, 0, 983046, 1, 0, 983047, 1, 0, 983048, 1, 0, 983049, 1, 0, 983050, 1, 0, 983051, 1, 0, 983052, 1, 0, 983053, 1, 0, 983054, 1, 0, 983055, 1, 0, 983056, 1, 0, 983057, 1, 0, 983058, 1, 0, 983059, 1, 0, 983060, 1, 0, 983061, 1, 0, 983062, 1, 0, 983063, 1, 0, 983064, 1, 0, 1114102, 1, 0, 1114103, 1, 0, 1114104, 1, 0, 1114105, 1, 0, 1114106, 1, 0, 1114107, 1, 0, 1114108, 1, 0, 1114109, 1, 0, 1114110, 1, 0, 1114111, 1, 0, 1048576, 1, 0, 1048577, 1, 0, 1048578, 1, 0, 1048579, 1, 0, 1048580, 1, 0, 1048581, 1, 0, 1048582, 1, 0, 1048583, 1, 0, 1048584, 1, 0, 1048585, 1, 0, 1048586, 1, 0, 1048587, 1, 0, 1048588, 1, 0, 1048589, 1, 0, 1048590, 1, 0, 1048591, 1, 0, 1048592, 1, 0, 1048593, 1, 0, 1048594, 1, 0, 1048595, 1, 0, 1048596, 1, 0, 1048597, 1, 0, 1048598, 1, 0, 1048599, 1, 0, 1048600, 1, 0, 1179638, 1, 0, 1179639, 1, 0, 1179640, 1, 0, 1179641, 1, 0, 1179642, 1, 0, 1179643, 1, 0, 1179644, 1, 0, 1179645, 1, 0, 1179646, 1, 0, 1179647, 1, 0, 1114112, 1, 0, 1114113, 1, 0, 1114114, 1, 0, 1114115, 1, 0, 1114116, 1, 0, 1114117, 1, 0, 1114118, 1, 0, 1114119, 1, 0, 1114120, 1, 0, 1114121, 1, 0, 1114122, 1, 0, 1114123, 1, 0, 1114124, 1, 0, 1114125, 1, 0, 1114126, 1, 0, 1114127, 1, 0, 1114128, 1, 0, 1114129, 1, 0, 1114130, 1, 0, 1114131, 1, 0, 1114132, 1, 0, 1114133, 1, 0, 1114134, 1, 0, 1114135, 1, 0, 1114136, 1, 0, 1245174, 1, 0, 1245175, 1, 0, 1245176, 1, 0, 1245177, 1, 0, 1245178, 1, 0, 1245179, 1, 0, 1245180, 1, 0, 1245181, 1, 0, 1245182, 1, 0, 1245183, 1, 0, 1179648, 1, 0, 1179649, 1, 0, 1179650, 1, 0, 1179651, 1, 0, 1179652, 1, 0, 1179653, 1, 0, 1179654, 1, 0, 1179655, 1, 0, 1179656, 1, 0, 1179657, 1, 0, 1179658, 1, 0, 1179659, 1, 0, 1179660, 1, 0, 1179661, 1, 0, 1179662, 1, 0, 1179663, 1, 0, 1179664, 1, 0, 1179665, 1, 0, 1179666, 1, 0, 1179667, 1, 0, 1179668, 1, 0, 1179669, 1, 0, 1179670, 1, 0, 1179671, 1, 0, 1179672, 1, 0 ) +script = ExtResource( 3 ) +extended_tilemap_node = NodePath("../1x1") + +[node name="1x1" type="TileMap" parent="."] +light_mask = 2 +tile_set = ExtResource( 2 ) +cell_size = Vector2( 16, 16 ) +format = 1 + +[node name="clown-dir1" type="Sprite" parent="."] +position = Vector2( 299.732, 369.539 ) +texture = ExtResource( 4 ) diff --git a/Scenes/Rendering/MapTiles.gd b/Scenes/Rendering/MapTiles.gd new file mode 100644 index 0000000..6e4f662 --- /dev/null +++ b/Scenes/Rendering/MapTiles.gd @@ -0,0 +1,64 @@ +extends TileMap + +class_name MapTiles + +export(NodePath) var extended_tilemap_node +export var occluders = ["Wall"] + +export var shadow_intensity = 0.2 + +onready var extended_tilemap = get_node(extended_tilemap_node) as TileMap + +func _ready(): + # Make occluders for FOV + make_occluders() + + # Convert 2x2 tiles to 1x1 if possible + convert_extended() + +func convert_extended(): + var extended = extended_tilemap.tile_set + for id in tile_set.get_tiles_ids(): + var name = tile_set.tile_get_name(id) + var extended_id = extended.find_tile_by_name(name) + if extended_id < 0: + # Not found, skip it + continue + # Find all uses of this tile + for cell in get_used_cells_by_id(id): + var x = cell.x * 2 + var y = cell.y * 2 + extended_tilemap.set_cell(x, y, extended_id) + 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) + extended_tilemap.update_bitmask_region() + extended_tilemap.update_dirty_quadrants() + +func make_occluders(): + var occluder_ids = [] + for occluder_name in occluders: + occluder_ids.push_back(tile_set.find_tile_by_name(occluder_name)) + for id in tile_set.get_tiles_ids(): + if occluder_ids.find(id) < 0: + # Not an occluder, skip it + continue + # Find all uses of this tile + for cell in get_used_cells_by_id(id): + # Check sides + var occluder = Occluder.new() + occluder.ignore_sides = [ + occluder_ids.find(get_cell(cell.x, cell.y-1)) >= 0, # Top + occluder_ids.find(get_cell(cell.x+1, cell.y)) >= 0, # Right + occluder_ids.find(get_cell(cell.x, cell.y+1)) >= 0, # Bottom + occluder_ids.find(get_cell(cell.x-1, cell.y)) >= 0 # Left + ] + occluder.transform.origin = map_to_world(cell) + add_child(occluder) + + +func set_occluder_origin(origin): + for child in get_children(): + if child is Occluder: + child.origin = origin diff --git a/Scenes/Rendering/Occluder.gd b/Scenes/Rendering/Occluder.gd new file mode 100644 index 0000000..826b489 --- /dev/null +++ b/Scenes/Rendering/Occluder.gd @@ -0,0 +1,43 @@ +extends Node2D + +class_name Occluder + +const MAX_LENGTH = 200 +const EPSILON = 0.1 + +var ignore_sides = [false, false, false, false] +var size = Vector2(32, 32) +var origin = null +var polygon: PoolVector2Array = [Vector2.ZERO, Vector2(size.x, 0), Vector2(size.x, size.y), Vector2(0, size.y)] + +func _draw(): + if polygon == null: + return + + if origin == null: + return + + var player_position = origin.global_position - global_position + + # Find what edges is the players looking at + var edges = [ + player_position.y < 0, # TOP + player_position.x > size.x*2, # RIGHT + player_position.y > size.y*2, # BOTTOM + player_position.x < 0 # LEFT + ] + + for current in range(0, polygon.size()): + var next = (current + 1) % polygon.size() + var previous = (current - 1) % polygon.size() + + if not ignore_sides[current] and not edges[current]: + draw_polygon([ + (polygon[current] * 2.1 - origin.global_position + global_position) * MAX_LENGTH, + polygon[current], polygon[next], + (polygon[next] * 2.1 - origin.global_position + global_position) * MAX_LENGTH + ], [Color.black]) + +func _process(_delta): + update() + z_index = 999 diff --git a/Scenes/Test.tscn b/Scenes/Test.tscn new file mode 100644 index 0000000..39187e7 --- /dev/null +++ b/Scenes/Test.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://Scenes/Maps/odyssey.tscn" type="PackedScene" id=1] +[ext_resource path="res://Actors/Player/Player.tscn" type="PackedScene" id=2] +[ext_resource path="res://Scenes/World.gd" type="Script" id=4] + +[node name="scene" type="Node2D"] + +[node name="world" type="Node2D" parent="."] +scale = Vector2( 2, 2 ) +script = ExtResource( 4 ) +player_path = NodePath("player") +map_path = NodePath("map") + +[node name="map" parent="world" instance=ExtResource( 1 )] + +[node name="player" parent="world" instance=ExtResource( 2 )] +position = Vector2( 281.46, 222.763 ) +z_index = 1 +is_controlled = true diff --git a/Scenes/World.gd b/Scenes/World.gd new file mode 100755 index 0000000..7eacbc7 --- /dev/null +++ b/Scenes/World.gd @@ -0,0 +1,10 @@ +extends Node2D + +export(NodePath) var player_path +export(NodePath) var map_path + +onready var player = get_node(player_path) as Node2D +onready var map = get_node(map_path) as Map + +func _ready(): + map.tilemap.set_occluder_origin(player) diff --git a/Scenes/clown-dir1.png b/Scenes/clown-dir1.png new file mode 100755 index 0000000..5118f73 Binary files /dev/null and b/Scenes/clown-dir1.png differ diff --git a/Scenes/clown-dir1.png.import b/Scenes/clown-dir1.png.import new file mode 100755 index 0000000..c063c93 --- /dev/null +++ b/Scenes/clown-dir1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/clown-dir1.png-e68e6055ec04fcffc8478b8968bf4987.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Scenes/clown-dir1.png" +dest_files=[ "res://.import/clown-dir1.png-e68e6055ec04fcffc8478b8968bf4987.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 diff --git a/default_env.tres b/default_env.tres new file mode 100644 index 0000000..5816fc1 --- /dev/null +++ b/default_env.tres @@ -0,0 +1,8 @@ +[gd_resource type="Environment" load_steps=2 format=2] + +[sub_resource type="ProceduralSky" id=1] + +[resource] +background_mode = 2 +background_sky = SubResource( 1 ) +ambient_light_energy = 0.0 diff --git a/icon.png b/icon.png new file mode 100755 index 0000000..c98fbb6 Binary files /dev/null and b/icon.png differ diff --git a/icon.png.import b/icon.png.import new file mode 100755 index 0000000..96cbf46 --- /dev/null +++ b/icon.png.import @@ -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=true +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 diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..d26a01b --- /dev/null +++ b/project.godot @@ -0,0 +1,77 @@ +; 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": "Node2D", +"class": "Map", +"language": "GDScript", +"path": "res://Scenes/Map.gd" +}, { +"base": "TileMap", +"class": "MapTiles", +"language": "GDScript", +"path": "res://Scenes/Rendering/MapTiles.gd" +}, { +"base": "Node2D", +"class": "Occluder", +"language": "GDScript", +"path": "res://Scenes/Rendering/Occluder.gd" +} ] +_global_script_class_icons={ +"Map": "", +"MapTiles": "", +"Occluder": "" +} + +[application] + +config/name="odyssey" +run/main_scene="res://Scenes/Test.tscn" +config/icon="res://icon.png" + +[display] + +window/size/width=1280 +window/size/height=800 + +[input] + +ui_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":65,"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) + ] +} +ui_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":68,"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) + ] +} +ui_up={ +"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":87,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) + ] +} +ui_down={ +"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":83,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null) + ] +} + +[rendering] + +quality/driver/driver_name="GLES2" +vram_compression/import_etc=true +vram_compression/import_etc2=false +environment/default_clear_color=Color( 0, 0, 0, 1 ) +environment/default_environment="res://default_env.tres"