summaryrefslogtreecommitdiff
path: root/demos/2d/fog_of_war
diff options
context:
space:
mode:
Diffstat (limited to 'demos/2d/fog_of_war')
-rw-r--r--demos/2d/fog_of_war/engine.cfg2
-rw-r--r--demos/2d/fog_of_war/fog.scnbin4159 -> 0 bytes
-rw-r--r--demos/2d/fog_of_war/fog.tscn51
-rw-r--r--demos/2d/fog_of_war/fog.xml29
-rw-r--r--demos/2d/fog_of_war/tile_edit.scnbin1570 -> 0 bytes
-rw-r--r--demos/2d/fog_of_war/tileset.tres32
-rw-r--r--demos/2d/fog_of_war/tileset_edit.tscn30
-rw-r--r--demos/2d/fog_of_war/troll.scnbin1979 -> 0 bytes
-rw-r--r--demos/2d/fog_of_war/troll.tscn52
9 files changed, 166 insertions, 30 deletions
diff --git a/demos/2d/fog_of_war/engine.cfg b/demos/2d/fog_of_war/engine.cfg
index 1f56851c58..98e20c1e41 100644
--- a/demos/2d/fog_of_war/engine.cfg
+++ b/demos/2d/fog_of_war/engine.cfg
@@ -1,7 +1,7 @@
[application]
name="Fog of War"
-main_scene="res://fog.scn"
+main_scene="res://fog.tscn"
icon="res://icon.png"
[input]
diff --git a/demos/2d/fog_of_war/fog.scn b/demos/2d/fog_of_war/fog.scn
deleted file mode 100644
index cf19601567..0000000000
--- a/demos/2d/fog_of_war/fog.scn
+++ /dev/null
Binary files differ
diff --git a/demos/2d/fog_of_war/fog.tscn b/demos/2d/fog_of_war/fog.tscn
new file mode 100644
index 0000000000..e86a23125c
--- /dev/null
+++ b/demos/2d/fog_of_war/fog.tscn
@@ -0,0 +1,51 @@
+[gd_scene load_steps=4 format=1]
+
+[ext_resource path="res://tileset.tres" type="TileSet" id=1]
+[ext_resource path="res://troll.tscn" type="PackedScene" id=2]
+[ext_resource path="res://fog.gd" type="Script" id=3]
+
+[node name="Node2D" type="Node2D"]
+
+[node name="TileMap" type="TileMap" parent="."]
+
+transform/pos = Vector2( 206, 112 )
+mode = 0
+tile_set = ExtResource( 1 )
+cell/size = Vector2( 48, 48 )
+cell/quadrant_size = 16
+cell/custom_transform = Matrix32( 1, 0, 0, 1, 0, 0 )
+cell/half_offset = 2
+cell/tile_origin = 0
+cell/y_sort = false
+collision/use_kinematic = false
+collision/friction = 1.0
+collision/bounce = 0.0
+collision/layers = 1
+collision/mask = 1
+occluder/light_mask = 1
+tile_data = IntArray( -589834, 2, -589833, 2, -589832, 2, -589831, 2, -589830, 2, -589829, 2, -589828, 2, -589827, 2, -589826, 2, -589825, 2, -655360, 2, -655359, 2, -655358, 2, -655357, 2, -655356, 2, -655355, 2, -655354, 2, -655353, 2, -655352, 2, -655351, 2, -524298, 2, -524297, 2, -524296, 2, -524295, 2, -524294, 2, -524293, 2, -524292, 2, -524291, 2, -524290, 2, -524289, 2, -589824, 2, -589823, 2, -589822, 2, -589821, 2, -589820, 2, -589819, 2, -589818, 2, -589817, 2, -589816, 2, -589815, 2, -458762, 2, -458761, 2, -458760, 2, -458759, 2, -458758, 2, -458757, 2, -458756, 2, -458755, 2, -458754, 2, -458753, 2, -524288, 2, -524287, 2, -524286, 2, -524285, 2, -524284, 2, -524283, 2, -524282, 2, -524281, 2, -524280, 2, -524279, 2, -393226, 2, -393225, 2, -393224, 2, -393223, 2, -393222, 2, -393221, 2, -393220, 2, -393219, 2, -393218, 2, -393217, 2, -458752, 2, -458751, 2, -458750, 2, -458749, 2, -458748, 2, -458747, 2, -458746, 2, -458745, 2, -458744, 2, -458743, 2, -327690, 2, -327689, 2, -327688, 2, -327687, 2, -327686, 2, -327685, 2, -327684, 2, -327683, 2, -327682, 2, -327681, 2, -393216, 2, -393215, 2, -393214, 2, -393213, 2, -393212, 2, -393211, 2, -393210, 2, -393209, 2, -393208, 2, -393207, 2, -262154, 2, -262153, 2, -262152, 2, -262151, 2, -262150, 2, -262149, 2, -262148, 2, -262147, 2, -262146, 2, -262145, 2, -327680, 2, -327679, 2, -327678, 2, -327677, 2, -327676, 2, -327675, 2, -327674, 2, -327673, 2, -327672, 2, -327671, 2, -196618, 2, -196617, 2, -196616, 2, -196615, 2, -196614, 2, -196613, 2, -196612, 2, -196611, 2, -196610, 2, -196609, 2, -262144, 2, -262143, 2, -262142, 2, -262141, 2, -262140, 2, -262139, 2, -262138, 2, -262137, 2, -262136, 2, -262135, 2, -131082, 2, -131081, 2, -131080, 2, -131079, 2, -131078, 2, -131077, 2, -131076, 2, -131075, 2, -131074, 2, -131073, 2, -196608, 2, -196607, 2, -196606, 2, -196605, 2, -196604, 2, -196603, 2, -196602, 2, -196601, 2, -196600, 2, -196599, 2, -65546, 2, -65545, 2, -65544, 2, -65543, 2, -65542, 2, -65541, 2, -65540, 2, -65539, 2, -65538, 2, -65537, 2, -131072, 2, -131071, 2, -131070, 2, -131069, 2, -131068, 2, -131067, 2, -131066, 2, -131065, 2, -131064, 2, -131063, 2, -10, 2, -9, 2, -8, 2, -7, 2, -6, 2, -5, 2, -4, 2, -3, 2, -2, 2, -1, 2, -65536, 2, -65535, 2, -65534, 2, -65533, 2, -65532, 2, -65531, 2, -65530, 2, -65529, 2, -65528, 2, -65527, 2, 65526, 2, 65527, 2, 65528, 2, 65529, 2, 65530, 2, 65531, 2, 65532, 2, 65533, 2, 65534, 2, 65535, 2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 2, 131062, 2, 131063, 2, 131064, 2, 131065, 2, 131066, 2, 131067, 2, 131068, 2, 131069, 2, 131070, 2, 131071, 2, 65536, 2, 65537, 2, 65538, 2, 65539, 2, 65540, 2, 65541, 2, 65542, 2, 65543, 2, 65544, 2, 65545, 2, 196598, 2, 196599, 2, 196600, 2, 196601, 2, 196602, 2, 196603, 2, 196604, 2, 196605, 2, 196606, 2, 196607, 2, 131072, 2, 131073, 2, 131074, 2, 131075, 2, 131076, 2, 131077, 2, 131078, 2, 131079, 2, 131080, 2, 131081, 2, 262134, 2, 262135, 2, 262136, 2, 262137, 2, 262138, 2, 262139, 2, 262140, 2, 262141, 2, 262142, 2, 262143, 2, 196608, 2, 196609, 2, 196610, 2, 196611, 2, 196612, 2, 196613, 2, 196614, 2, 196615, 2, 196616, 2, 196617, 2, 327670, 2, 327671, 2, 327672, 2, 327673, 2, 327674, 2, 327675, 2, 327676, 2, 327677, 2, 327678, 2, 327679, 2, 262144, 2, 262145, 2, 262146, 2, 262147, 2, 262148, 2, 262149, 2, 262150, 2, 262151, 2, 262152, 2, 262153, 2, 393206, 2, 393207, 2, 393208, 2, 393209, 2, 393210, 2, 393211, 2, 393212, 2, 393213, 2, 393214, 2, 393215, 2, 327680, 2, 327681, 2, 327682, 2, 327683, 2, 327684, 2, 327685, 2, 327686, 2, 327687, 2, 327688, 2, 327689, 2, 458742, 2, 458743, 2, 458744, 2, 458745, 2, 458746, 2, 458747, 2, 458748, 2, 458749, 2, 458750, 2, 458751, 2, 393216, 2, 393217, 2, 393218, 2, 393219, 2, 393220, 2, 393221, 2, 393222, 2, 393223, 2, 393224, 2, 393225, 2, 524278, 2, 524279, 2, 524280, 2, 524281, 2, 524282, 2, 524283, 2, 524284, 2, 524285, 2, 524286, 2, 524287, 2, 458752, 2, 458753, 2, 458754, 2, 458755, 2, 458756, 2, 458757, 2, 458758, 2, 458759, 2, 458760, 2, 458761, 2, 589814, 2, 589815, 2, 589816, 2, 589817, 2, 589818, 2, 589819, 2, 589820, 2, 589821, 2, 589822, 2, 589823, 2, 524288, 2, 524289, 2, 524290, 2, 524291, 2, 524292, 2, 524293, 2, 524294, 2, 524295, 2, 524296, 2, 524297, 2, 655350, 2, 655351, 2, 655352, 2, 655353, 2, 655354, 2, 655355, 2, 655356, 2, 655357, 2, 655358, 2, 655359, 2, 589824, 2, 589825, 2, 589826, 2, 589827, 2, 589828, 2, 589829, 2, 589830, 2, 589831, 2, 589832, 2, 589833, 2 )
+
+[node name="troll" parent="." instance=ExtResource( 2 )]
+
+collision/margin = 0.001
+
+[node name="Fog" type="TileMap" parent="."]
+
+mode = 0
+tile_set = ExtResource( 1 )
+cell/size = Vector2( 48, 48 )
+cell/quadrant_size = 16
+cell/custom_transform = Matrix32( 1, 0, 0, 1, 0, 0 )
+cell/half_offset = 2
+cell/tile_origin = 0
+cell/y_sort = false
+collision/use_kinematic = false
+collision/friction = 1.0
+collision/bounce = 0.0
+collision/layers = 1
+collision/mask = 1
+occluder/light_mask = 1
+tile_data = IntArray( )
+script/script = ExtResource( 3 )
+
+
diff --git a/demos/2d/fog_of_war/fog.xml b/demos/2d/fog_of_war/fog.xml
deleted file mode 100644
index ed08d84a1f..0000000000
--- a/demos/2d/fog_of_war/fog.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<resource_file type="TileSet" subresource_count="3" version="1.0" version_name="Godot Engine v1.0.stable.custom_build">
- <ext_resource path="res://floor.png" type="Texture"></ext_resource>
- <ext_resource path="res://fog.png" type="Texture"></ext_resource>
- <main_resource>
- <string name="0/name"> "fog opaque" </string>
- <resource name="0/texture" resource_type="Texture" path="res://fog.png"> </resource>
- <vector2 name="0/tex_offset"> -48, -48 </vector2>
- <vector2 name="0/shape_offset"> 0, 0 </vector2>
- <rect2 name="0/region"> 0, 0, 144, 144 </rect2>
- <array name="0/shapes" len="0" shared="false">
- </array>
- <string name="1/name"> "fog transparent" </string>
- <resource name="1/texture" resource_type="Texture" path="res://fog.png"> </resource>
- <vector2 name="1/tex_offset"> -48, -48 </vector2>
- <vector2 name="1/shape_offset"> 0, 0 </vector2>
- <rect2 name="1/region"> 144, 0, 144, 144 </rect2>
- <array name="1/shapes" len="0" shared="false">
- </array>
- <string name="2/name"> "floor" </string>
- <resource name="2/texture" resource_type="Texture" path="res://floor.png"> </resource>
- <vector2 name="2/tex_offset"> 0, 0 </vector2>
- <vector2 name="2/shape_offset"> 0, 0 </vector2>
- <rect2 name="2/region"> 0, 0, 0, 0 </rect2>
- <array name="2/shapes" len="0" shared="false">
- </array>
-
- </main_resource>
-</resource_file> \ No newline at end of file
diff --git a/demos/2d/fog_of_war/tile_edit.scn b/demos/2d/fog_of_war/tile_edit.scn
deleted file mode 100644
index 3eddf38e48..0000000000
--- a/demos/2d/fog_of_war/tile_edit.scn
+++ /dev/null
Binary files differ
diff --git a/demos/2d/fog_of_war/tileset.tres b/demos/2d/fog_of_war/tileset.tres
new file mode 100644
index 0000000000..c75ba8d5f2
--- /dev/null
+++ b/demos/2d/fog_of_war/tileset.tres
@@ -0,0 +1,32 @@
+[gd_resource type="TileSet" load_steps=3 format=1]
+
+[ext_resource path="res://fog.png" type="Texture" id=1]
+[ext_resource path="res://floor.png" type="Texture" id=2]
+
+[resource]
+
+0/name = "fog opaque"
+0/texture = ExtResource( 1 )
+0/tex_offset = Vector2( -48, -48 )
+0/region = Rect2( 0, 0, 144, 144 )
+0/occluder_offset = Vector2( 0, 0 )
+0/navigation_offset = Vector2( 0, 0 )
+0/shape_offset = Vector2( 0, 0 )
+0/shapes = [ ]
+1/name = "fog transparent"
+1/texture = ExtResource( 1 )
+1/tex_offset = Vector2( -48, -48 )
+1/region = Rect2( 144, 0, 144, 144 )
+1/occluder_offset = Vector2( 0, 0 )
+1/navigation_offset = Vector2( 0, 0 )
+1/shape_offset = Vector2( 0, 0 )
+1/shapes = [ ]
+2/name = "floor"
+2/texture = ExtResource( 2 )
+2/tex_offset = Vector2( 0, 0 )
+2/region = Rect2( 0, 0, 0, 0 )
+2/occluder_offset = Vector2( 24, 24 )
+2/navigation_offset = Vector2( 24, 24 )
+2/shape_offset = Vector2( 0, 0 )
+2/shapes = [ ]
+
diff --git a/demos/2d/fog_of_war/tileset_edit.tscn b/demos/2d/fog_of_war/tileset_edit.tscn
new file mode 100644
index 0000000000..1573e9d05e
--- /dev/null
+++ b/demos/2d/fog_of_war/tileset_edit.tscn
@@ -0,0 +1,30 @@
+[gd_scene load_steps=3 format=1]
+
+[ext_resource path="res://fog.png" type="Texture" id=1]
+[ext_resource path="res://floor.png" type="Texture" id=2]
+
+[node name="Node2D" type="Node2D"]
+
+[node name="fog opaque" type="Sprite" parent="."]
+
+texture = ExtResource( 1 )
+centered = false
+offset = Vector2( -48, -48 )
+region = true
+region_rect = Rect2( 0, 0, 144, 144 )
+
+[node name="fog transparent" type="Sprite" parent="."]
+
+transform/pos = Vector2( 144, 0 )
+texture = ExtResource( 1 )
+centered = false
+offset = Vector2( -48, -48 )
+region = true
+region_rect = Rect2( 144, 0, 144, 144 )
+
+[node name="floor" type="Sprite" parent="."]
+
+transform/pos = Vector2( 264, 24 )
+texture = ExtResource( 2 )
+
+
diff --git a/demos/2d/fog_of_war/troll.scn b/demos/2d/fog_of_war/troll.scn
deleted file mode 100644
index ab9af17221..0000000000
--- a/demos/2d/fog_of_war/troll.scn
+++ /dev/null
Binary files differ
diff --git a/demos/2d/fog_of_war/troll.tscn b/demos/2d/fog_of_war/troll.tscn
new file mode 100644
index 0000000000..2dc8bdbf67
--- /dev/null
+++ b/demos/2d/fog_of_war/troll.tscn
@@ -0,0 +1,52 @@
+[gd_scene load_steps=4 format=1]
+
+[ext_resource path="res://troll.gd" type="Script" id=1]
+[ext_resource path="res://troll.png" type="Texture" id=2]
+
+[sub_resource type="CircleShape2D" id=1]
+
+custom_solver_bias = 0.0
+radius = 16.0
+
+[node name="troll" type="KinematicBody2D"]
+
+input/pickable = false
+shapes/0/shape = SubResource( 1 )
+shapes/0/transform = Matrix32( 1, 0, 0, 1, 3.24216, 19.453 )
+shapes/0/trigger = false
+collision/layers = 1
+collision/mask = 1
+collision/margin = 0.001
+script/script = ExtResource( 1 )
+
+[node name="Sprite" type="Sprite" parent="."]
+
+texture = ExtResource( 2 )
+
+[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
+
+transform/pos = Vector2( 3.24216, 19.453 )
+shape = SubResource( 1 )
+trigger = false
+_update_shape_index = -1
+
+[node name="Camera2D" type="Camera2D" parent="."]
+
+anchor_mode = 1
+rotating = false
+current = true
+zoom = Vector2( 1, 1 )
+limit/left = -10000000
+limit/top = -10000000
+limit/right = 10000000
+limit/bottom = 10000000
+drag_margin/h_enabled = true
+drag_margin/v_enabled = true
+smoothing/enable = false
+smoothing/speed = 5.0
+drag_margin/left = 0.2
+drag_margin/top = 0.2
+drag_margin/right = 0.2
+drag_margin/bottom = 0.2
+
+