Преглед изворни кода

Relevant stuff is ported, so erasing old demos for now.

Juan Linietsky пре 8 година
родитељ
комит
85b8aeebc1
100 измењених фајлова са 7 додато и 1029 уклоњено
  1. 7 0
      3d/material_testers/project.godot
  2. BIN
      3d/material_testers/tester.scn
  3. BIN
      old/2d/area_input/box_area.png
  4. BIN
      old/2d/area_input/circle_area.png
  5. 0 5
      old/2d/area_input/engine.cfg
  6. BIN
      old/2d/area_input/icon.png
  7. 0 15
      old/2d/area_input/input.gd
  8. 0 113
      old/2d/area_input/input.tscn
  9. 0 17
      old/2d/dynamic_collision_shapes/ball.gd
  10. BIN
      old/2d/dynamic_collision_shapes/ball.png
  11. 0 47
      old/2d/dynamic_collision_shapes/ball.tscn
  12. BIN
      old/2d/dynamic_collision_shapes/box.png
  13. BIN
      old/2d/dynamic_collision_shapes/circle.png
  14. 0 19
      old/2d/dynamic_collision_shapes/dynamic_colobjs.gd
  15. 0 218
      old/2d/dynamic_collision_shapes/dynamic_colobjs.tscn
  16. 0 5
      old/2d/dynamic_collision_shapes/engine.cfg
  17. BIN
      old/2d/dynamic_collision_shapes/icon.png
  18. BIN
      old/2d/dynamic_collision_shapes/poly.png
  19. 0 12
      old/2d/fog_of_war/engine.cfg
  20. BIN
      old/2d/fog_of_war/floor.png
  21. 0 78
      old/2d/fog_of_war/fog.gd
  22. BIN
      old/2d/fog_of_war/fog.png
  23. 0 25
      old/2d/fog_of_war/fog.tscn
  24. BIN
      old/2d/fog_of_war/icon.png
  25. 0 32
      old/2d/fog_of_war/tileset.tres
  26. 0 30
      old/2d/fog_of_war/tileset_edit.tscn
  27. 0 38
      old/2d/fog_of_war/troll.gd
  28. BIN
      old/2d/fog_of_war/troll.png
  29. 0 52
      old/2d/fog_of_war/troll.tscn
  30. 0 12
      old/2d/isometric_light/character_shader.tres
  31. 0 52
      old/2d/isometric_light/column.tscn
  32. 0 85
      old/2d/isometric_light/cubio.gd
  33. 0 174
      old/2d/isometric_light/cubio.tscn
  34. BIN
      old/2d/isometric_light/cubio/idle0001.png
  35. BIN
      old/2d/isometric_light/cubio/idle0002.png
  36. BIN
      old/2d/isometric_light/cubio/idle0003.png
  37. BIN
      old/2d/isometric_light/cubio/idle0004.png
  38. BIN
      old/2d/isometric_light/cubio/idle0005.png
  39. BIN
      old/2d/isometric_light/cubio/idle0006.png
  40. BIN
      old/2d/isometric_light/cubio/idle0007.png
  41. BIN
      old/2d/isometric_light/cubio/idle0008.png
  42. BIN
      old/2d/isometric_light/cubio/idle0009.png
  43. BIN
      old/2d/isometric_light/cubio/idle0010.png
  44. BIN
      old/2d/isometric_light/cubio/idle0011.png
  45. BIN
      old/2d/isometric_light/cubio/idle0012.png
  46. BIN
      old/2d/isometric_light/cubio/idle0013.png
  47. BIN
      old/2d/isometric_light/cubio/idle0014.png
  48. BIN
      old/2d/isometric_light/cubio/idle0015.png
  49. BIN
      old/2d/isometric_light/cubio/idle0016.png
  50. BIN
      old/2d/isometric_light/cubio/idle0017.png
  51. BIN
      old/2d/isometric_light/cubio/idle0018.png
  52. BIN
      old/2d/isometric_light/cubio/idle0019.png
  53. BIN
      old/2d/isometric_light/cubio/idle0020.png
  54. BIN
      old/2d/isometric_light/cubio/idle0021.png
  55. BIN
      old/2d/isometric_light/cubio/idle0022.png
  56. BIN
      old/2d/isometric_light/cubio/idle0023.png
  57. BIN
      old/2d/isometric_light/cubio/idle0024.png
  58. BIN
      old/2d/isometric_light/cubio/idle0025.png
  59. BIN
      old/2d/isometric_light/cubio/idle0026.png
  60. BIN
      old/2d/isometric_light/cubio/idle0027.png
  61. BIN
      old/2d/isometric_light/cubio/idle0028.png
  62. BIN
      old/2d/isometric_light/cubio/idle0029.png
  63. BIN
      old/2d/isometric_light/cubio/idle0030.png
  64. BIN
      old/2d/isometric_light/cubio/idle0031.png
  65. BIN
      old/2d/isometric_light/cubio/idle0032.png
  66. BIN
      old/2d/isometric_light/cubio/idle0033.png
  67. BIN
      old/2d/isometric_light/cubio/idle0034.png
  68. BIN
      old/2d/isometric_light/cubio/idle0035.png
  69. BIN
      old/2d/isometric_light/cubio/idle0036.png
  70. BIN
      old/2d/isometric_light/cubio/idle0037.png
  71. BIN
      old/2d/isometric_light/cubio/idle0038.png
  72. BIN
      old/2d/isometric_light/cubio/idle0039.png
  73. BIN
      old/2d/isometric_light/cubio/idle0040.png
  74. BIN
      old/2d/isometric_light/cubio/idle0041.png
  75. BIN
      old/2d/isometric_light/cubio/idle0042.png
  76. BIN
      old/2d/isometric_light/cubio/idle0043.png
  77. BIN
      old/2d/isometric_light/cubio/idle0044.png
  78. BIN
      old/2d/isometric_light/cubio/idle0045.png
  79. BIN
      old/2d/isometric_light/cubio/idle0046.png
  80. BIN
      old/2d/isometric_light/cubio/idle0047.png
  81. BIN
      old/2d/isometric_light/cubio/idle0048.png
  82. BIN
      old/2d/isometric_light/cubio/idle0049.png
  83. BIN
      old/2d/isometric_light/cubio/idle0050.png
  84. BIN
      old/2d/isometric_light/cubio/idle0051.png
  85. BIN
      old/2d/isometric_light/cubio/idle0052.png
  86. BIN
      old/2d/isometric_light/cubio/idle0053.png
  87. BIN
      old/2d/isometric_light/cubio/idle0054.png
  88. BIN
      old/2d/isometric_light/cubio/idle0055.png
  89. BIN
      old/2d/isometric_light/cubio/idle0056.png
  90. BIN
      old/2d/isometric_light/cubio/idle0057.png
  91. BIN
      old/2d/isometric_light/cubio/idle0058.png
  92. BIN
      old/2d/isometric_light/cubio/idle0059.png
  93. BIN
      old/2d/isometric_light/cubio/idle0060.png
  94. BIN
      old/2d/isometric_light/cubio/norm-b-0001.png
  95. BIN
      old/2d/isometric_light/cubio/norm-b-0002.png
  96. BIN
      old/2d/isometric_light/cubio/norm-b-0003.png
  97. BIN
      old/2d/isometric_light/cubio/norm-b-0004.png
  98. BIN
      old/2d/isometric_light/cubio/norm-b-0005.png
  99. BIN
      old/2d/isometric_light/cubio/norm-b-0006.png
  100. BIN
      old/2d/isometric_light/cubio/norm-b-0007.png

+ 7 - 0
3d/material_testers/project.godot

@@ -1,4 +1,11 @@
 config_version=3
+config_version=null
+
+[application]
+
+name="Material Tester"
+main_scene="res://tester.scn"
+
 [memory]
 
 multithread/thread_rid_pool_prealloc=60

BIN
3d/material_testers/tester.scn


BIN
old/2d/area_input/box_area.png


BIN
old/2d/area_input/circle_area.png


+ 0 - 5
old/2d/area_input/engine.cfg

@@ -1,5 +0,0 @@
-[application]
-
-name="Area 2D Input Events"
-main_scene="res://input.tscn"
-icon="res://icon.png"

BIN
old/2d/area_input/icon.png


+ 0 - 15
old/2d/area_input/input.gd

@@ -1,15 +0,0 @@
-
-extends Area2D
-
-
-# Virtual from CollisionObject2D (also available as signal)
-func _input_event(viewport, event, shape_idx):
-	# Convert event to local coordinates
-	if (event.type == InputEvent.MOUSE_MOTION):
-		event = make_input_local(event)
-		get_node("label").set_text(str(event.pos))
-
-
-# Virtual from CollisionObject2D (also available as signal)
-func _mouse_exit():
-	get_node("label").set_text("")

+ 0 - 113
old/2d/area_input/input.tscn

@@ -1,113 +0,0 @@
-[gd_scene load_steps=6 format=1]
-
-[ext_resource path="res://input.gd" type="Script" id=1]
-[ext_resource path="res://box_area.png" type="Texture" id=2]
-[ext_resource path="res://circle_area.png" type="Texture" id=3]
-
-[sub_resource type="RectangleShape2D" id=1]
-
-custom_solver_bias = 0.0
-extents = Vector2( 64, 64 )
-
-[sub_resource type="CircleShape2D" id=2]
-
-custom_solver_bias = 0.0
-radius = 64.0
-
-[node name="base" type="Node2D"]
-
-[node name="box" type="Area2D" parent="."]
-
-transform/pos = Vector2( 212, 281 )
-transform/rot = 35.4081
-input/pickable = true
-shapes/0/shape = SubResource( 1 )
-shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
-shapes/0/trigger = false
-gravity_vec = Vector2( 0, 1 )
-gravity = 98.0
-linear_damp = 0.1
-angular_damp = 1.0
-script/script = ExtResource( 1 )
-
-[node name="sprite" type="Sprite" parent="box"]
-
-texture = ExtResource( 2 )
-
-[node name="label" type="Label" parent="box"]
-
-focus/ignore_mouse = true
-focus/stop_mouse = true
-size_flags/horizontal = 2
-size_flags/vertical = 0
-margin/left = -43.0
-margin/top = 71.0
-margin/right = 43.0
-margin/bottom = 84.0
-align = 1
-percent_visible = 1.0
-lines_skipped = 0
-max_lines_visible = -1
-
-[node name="shape" type="CollisionShape2D" parent="box"]
-
-shape = SubResource( 1 )
-trigger = false
-_update_shape_index = -1
-
-[node name="circle" type="Area2D" parent="."]
-
-transform/pos = Vector2( 547.877, 286.808 )
-transform/rot = -40.5985
-input/pickable = true
-shapes/0/shape = SubResource( 2 )
-shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
-shapes/0/trigger = false
-gravity_vec = Vector2( 0, 1 )
-gravity = 98.0
-linear_damp = 0.1
-angular_damp = 1.0
-script/script = ExtResource( 1 )
-
-[node name="sprite" type="Sprite" parent="circle"]
-
-texture = ExtResource( 3 )
-
-[node name="label" type="Label" parent="circle"]
-
-focus/ignore_mouse = true
-focus/stop_mouse = true
-size_flags/horizontal = 2
-size_flags/vertical = 0
-margin/left = -43.0
-margin/top = 71.0
-margin/right = 43.0
-margin/bottom = 84.0
-align = 1
-percent_visible = 1.0
-lines_skipped = 0
-max_lines_visible = -1
-
-[node name="shape" type="CollisionShape2D" parent="circle"]
-
-shape = SubResource( 2 )
-trigger = false
-_update_shape_index = -1
-
-[node name="Label" type="Label" parent="."]
-
-focus/ignore_mouse = true
-focus/stop_mouse = true
-size_flags/horizontal = 2
-size_flags/vertical = 0
-margin/left = 0.0
-margin/top = 0.0
-margin/right = 40.0
-margin/bottom = 13.0
-text = "This demo shows how to use a regular Area2D to get input events, and how to convert the input events to local coordinates of the node.
-Unlike controls, Input on Area2D or PhysicsBody2D nodes only works properly (with scrolling) on canvas layer 0."
-percent_visible = 1.0
-lines_skipped = 0
-max_lines_visible = -1
-
-

+ 0 - 17
old/2d/dynamic_collision_shapes/ball.gd

@@ -1,17 +0,0 @@
-
-extends RigidBody2D
-
-# Member variables
-var timeout = 5
-
-
-func _process(delta):
-	timeout -= delta
-	if (timeout < 1):
-		set_opacity(timeout)
-	if (timeout < 0):
-		queue_free()
-
-
-func _ready():
-	set_process(true)

BIN
old/2d/dynamic_collision_shapes/ball.png


+ 0 - 47
old/2d/dynamic_collision_shapes/ball.tscn

@@ -1,47 +0,0 @@
-[gd_scene load_steps=4 format=1]
-
-[ext_resource path="res://ball.gd" type="Script" id=1]
-[ext_resource path="res://ball.png" type="Texture" id=2]
-
-[sub_resource type="CircleShape2D" id=1]
-
-custom_solver_bias = 0.0
-radius = 7.45713
-
-[node name="bal" type="RigidBody2D"]
-
-input/pickable = false
-shapes/0/shape = SubResource( 1 )
-shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
-shapes/0/trigger = false
-collision/layers = 1
-collision/mask = 1
-mode = 0
-mass = 1.0
-friction = 1.0
-bounce = 0.0
-gravity_scale = 1.0
-custom_integrator = false
-continuous_cd = 0
-contacts_reported = 0
-contact_monitor = false
-sleeping = false
-can_sleep = true
-velocity/linear = Vector2( 0, 0 )
-velocity/angular = 0.0
-damp_override/linear = -1.0
-damp_override/angular = -1.0
-script/script = ExtResource( 1 )
-
-[node name="sprite" type="Sprite" parent="."]
-
-transform/pos = Vector2( 0, 1 )
-texture = ExtResource( 2 )
-
-[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
-
-shape = SubResource( 1 )
-trigger = false
-_update_shape_index = 0
-
-

BIN
old/2d/dynamic_collision_shapes/box.png


BIN
old/2d/dynamic_collision_shapes/circle.png


+ 0 - 19
old/2d/dynamic_collision_shapes/dynamic_colobjs.gd

@@ -1,19 +0,0 @@
-
-extends Node2D
-
-# Member variables
-const EMIT_INTERVAL = 0.1
-var timeout = EMIT_INTERVAL
-
-
-func _process(delta):
-	timeout -= delta
-	if (timeout < 0):
-		timeout = EMIT_INTERVAL
-		var ball = preload("res://ball.tscn").instance()
-		ball.set_pos(Vector2(randf()*get_viewport_rect().size.x, 0))
-		add_child(ball)
-
-
-func _ready():
-	set_process(true)

+ 0 - 218
old/2d/dynamic_collision_shapes/dynamic_colobjs.tscn

@@ -1,218 +0,0 @@
-[gd_scene load_steps=13 format=1]
-
-[ext_resource path="res://dynamic_colobjs.gd" type="Script" id=1]
-[ext_resource path="res://circle.png" type="Texture" id=2]
-[ext_resource path="res://box.png" type="Texture" id=3]
-[ext_resource path="res://poly.png" type="Texture" id=4]
-
-[sub_resource type="CircleShape2D" id=1]
-
-custom_solver_bias = 0.0
-radius = 28.8504
-
-[sub_resource type="RectangleShape2D" id=2]
-
-custom_solver_bias = 0.0
-extents = Vector2( 32.1805, 30.0328 )
-
-[sub_resource type="ConvexPolygonShape2D" id=3]
-
-custom_solver_bias = 0.0
-points = Vector2Array( 49.5669, -27.9744, 45.1564, 15.3961, 18.6931, -1.51105 )
-
-[sub_resource type="ConvexPolygonShape2D" id=4]
-
-custom_solver_bias = 0.0
-points = Vector2Array( -55.093, -14.2052, -37.1739, 2.89948, -40.1345, 21.2602, -53.3067, 15.8716 )
-
-[sub_resource type="ConvexPolygonShape2D" id=5]
-
-custom_solver_bias = 0.0
-points = Vector2Array( -40.1345, 21.2602, -37.1739, 2.89948, -14.386, -14.0076, -6.30005, 0.694214 )
-
-[sub_resource type="ConvexPolygonShape2D" id=6]
-
-custom_solver_bias = 0.0
-points = Vector2Array( -14.386, -14.0076, 18.6931, -1.51105, 45.1564, 15.3961, -6.30005, 0.694214 )
-
-[sub_resource type="Animation" id=7]
-
-resource/name = "movethem"
-length = 4.0
-loop = true
-step = 0.1
-tracks/0/type = "value"
-tracks/0/path = NodePath("base/circle:transform/pos")
-tracks/0/interp = 1
-tracks/0/imported = false
-tracks/0/keys = {
-"times": FloatArray( 0, 2 ),
-"transitions": FloatArray( 1, 1 ),
-"update": 0,
-"values": [ Vector2( 0, 0 ), Vector2( 52.7569, -70.845 ) ]
-}
-tracks/1/type = "value"
-tracks/1/path = NodePath("base/box:transform/pos")
-tracks/1/interp = 1
-tracks/1/imported = false
-tracks/1/keys = {
-"times": FloatArray( 0, 2 ),
-"transitions": FloatArray( 1, 1 ),
-"update": 0,
-"values": [ Vector2( 193.173, -2.72076 ), Vector2( 195.894, -72.0999 ) ]
-}
-tracks/2/type = "value"
-tracks/2/path = NodePath("base/box:transform/rot")
-tracks/2/interp = 1
-tracks/2/imported = false
-tracks/2/keys = {
-"times": FloatArray( 0, 2 ),
-"transitions": FloatArray( 1, 1 ),
-"update": 0,
-"values": [ 0.0, 92.8111 ]
-}
-tracks/3/type = "value"
-tracks/3/path = NodePath("base/polygon:transform/pos")
-tracks/3/interp = 1
-tracks/3/imported = false
-tracks/3/keys = {
-"times": FloatArray( 0, 2 ),
-"transitions": FloatArray( 1, 1 ),
-"update": 0,
-"values": [ Vector2( 382.265, -2.72076 ), Vector2( 495.176, -10.883 ) ]
-}
-
-[sub_resource type="Animation" id=8]
-
-resource/name = "toggletrigger"
-length = 6.0
-loop = true
-step = 0.1
-tracks/0/type = "value"
-tracks/0/path = NodePath("base/box:trigger")
-tracks/0/interp = 1
-tracks/0/imported = false
-tracks/0/keys = {
-"times": FloatArray( 0, 4 ),
-"transitions": FloatArray( 1, 1 ),
-"update": 1,
-"values": [ false, true ]
-}
-tracks/1/type = "value"
-tracks/1/path = NodePath("base/box:visibility/opacity")
-tracks/1/interp = 1
-tracks/1/imported = false
-tracks/1/keys = {
-"times": FloatArray( 0, 4 ),
-"transitions": FloatArray( 1, 1 ),
-"update": 1,
-"values": [ 1.0, 0.2 ]
-}
-
-[node name="base" type="Node2D"]
-
-script/script = ExtResource( 1 )
-
-[node name="base" type="KinematicBody2D" parent="."]
-
-transform/pos = Vector2( 137, 470 )
-input/pickable = false
-shapes/0/shape = SubResource( 1 )
-shapes/0/transform = Matrix32( 1, 0, 0, 1, 7.91353, -10.6267 )
-shapes/0/trigger = false
-shapes/1/shape = SubResource( 2 )
-shapes/1/transform = Matrix32( 0.970626, -0.240595, 0.240595, 0.970626, 193.581, -13.1276 )
-shapes/1/trigger = false
-shapes/2/shape = SubResource( 3 )
-shapes/2/transform = Matrix32( 1, 0, 0, 1, 399.202, -3.9451 )
-shapes/2/trigger = false
-shapes/3/shape = SubResource( 4 )
-shapes/3/transform = Matrix32( 1, 0, 0, 1, 399.202, -3.9451 )
-shapes/3/trigger = false
-shapes/4/shape = SubResource( 5 )
-shapes/4/transform = Matrix32( 1, 0, 0, 1, 399.202, -3.9451 )
-shapes/4/trigger = false
-shapes/5/shape = SubResource( 6 )
-shapes/5/transform = Matrix32( 1, 0, 0, 1, 399.202, -3.9451 )
-shapes/5/trigger = false
-collision/layers = 1
-collision/mask = 1
-collision/margin = 0.08
-
-[node name="circle" type="CollisionShape2D" parent="base"]
-
-transform/pos = Vector2( 7.91353, -10.6267 )
-shape = SubResource( 1 )
-trigger = false
-_update_shape_index = 0
-
-[node name="sprite" type="Sprite" parent="base/circle"]
-
-texture = ExtResource( 2 )
-
-[node name="box" type="CollisionShape2D" parent="base"]
-
-transform/pos = Vector2( 193.581, -13.1276 )
-transform/rot = 13.9217
-shape = SubResource( 2 )
-trigger = false
-_update_shape_index = 1
-
-[node name="Sprite" type="Sprite" parent="base/box"]
-
-texture = ExtResource( 3 )
-
-[node name="polygon" type="CollisionPolygon2D" parent="base"]
-
-transform/pos = Vector2( 399.202, -3.9451 )
-build_mode = 0
-polygon = Vector2Array( -55.093, -14.2052, -37.1739, 2.89948, -14.386, -14.0076, 18.6931, -1.51105, 49.5669, -27.9744, 45.1564, 15.3961, -6.30005, 0.694214, -40.1345, 21.2602, -53.3067, 15.8716 )
-shape_range = Vector2( 2, 5 )
-trigger = false
-
-[node name="Sprite" type="Sprite" parent="base/polygon"]
-
-texture = ExtResource( 4 )
-
-[node name="shapemove" type="AnimationPlayer" parent="."]
-
-playback/process_mode = 1
-playback/default_blend_time = 0.0
-root/root = NodePath("..")
-anims/movethem = SubResource( 7 )
-playback/active = true
-playback/speed = 1.0
-blend_times = [  ]
-autoplay = "movethem"
-
-[node name="triggertoggle" type="AnimationPlayer" parent="."]
-
-playback/process_mode = 1
-playback/default_blend_time = 0.0
-root/root = NodePath("..")
-anims/movethem = SubResource( 7 )
-anims/toggletrigger = SubResource( 8 )
-playback/active = true
-playback/speed = 1.0
-blend_times = [  ]
-autoplay = "toggletrigger"
-
-[node name="Label" type="Label" parent="."]
-
-focus/ignore_mouse = true
-focus/stop_mouse = true
-size_flags/horizontal = 2
-size_flags/vertical = 0
-margin/left = 21.0
-margin/top = 21.0
-margin/right = 719.0
-margin/bottom = 73.0
-text = "This demo simply shows that it's possible now to move a CollisionShape and CollisionPolygon after it was created
-and also turn it into a trigger at run-time. CollisionShape will remain alive during the running game and you can
-interact with them, even though they are just meant to be helpers.
-It is always recommended in a real use-case scenario, to move a body instead of a shape, as that path is better optimized."
-percent_visible = 1.0
-lines_skipped = 0
-max_lines_visible = -1
-
-

+ 0 - 5
old/2d/dynamic_collision_shapes/engine.cfg

@@ -1,5 +0,0 @@
-[application]
-
-name="Run-Time CollisionShape"
-main_scene="res://dynamic_colobjs.tscn"
-icon="res://icon.png"

BIN
old/2d/dynamic_collision_shapes/icon.png


BIN
old/2d/dynamic_collision_shapes/poly.png


+ 0 - 12
old/2d/fog_of_war/engine.cfg

@@ -1,12 +0,0 @@
-[application]
-
-name="Fog of War"
-main_scene="res://fog.tscn"
-icon="res://icon.png"
-
-[input]
-
-move_up=[key(Up)]
-move_bottom=[key(Down)]
-move_left=[key(Left)]
-move_right=[key(Right)]

BIN
old/2d/fog_of_war/floor.png


+ 0 - 78
old/2d/fog_of_war/fog.gd

@@ -1,78 +0,0 @@
-
-extends TileMap
-
-# Member variables
-
-# Boundaries for the fog rectangle
-var x_min = -20 # Left start tile
-var x_max = 20 # Right end tile
-var y_min = -20 # Top start tile
-var y_max = 20 # Bottom end tile
-
-var position # Player's position
-
-# Iteration variables
-var x
-var y
-
-# Variables to check if the player moved
-var x_old
-var y_old
-
-# Array to build up the visible area like a square.
-# First value determines the width/height of the tip.
-# Here it would be 2*2 + 1 = 5 tiles wide/high.
-# Second value determines the total squares size.
-# Here it would be 5*2 + 1 = 10 tiles wide/high.
-var l = range(2, 5)
-
-
-# Process that runs in realtime
-func _fixed_process(delta):
-	position = get_node("../troll").get_pos()
-	
-	# Calculate the corresponding tile
-	# from the players position
-	x = int(position.x/get_cell_size().x)
-	# Switching from positive to negative tile positions
-	# causes problems because of rounding problems
-	if position.x < 0:
-		x -= 1 # Correct negative values
-	
-	y = int(position.y/get_cell_size().y)
-	if (position.y < 0):
-		y -= 1
-	
-	# Check if the player moved one tile further
-	if ((x_old != x) or (y_old != y)):
-		# Create the transparent part (visited area)
-		var end = l.size() - 1
-		var start = 0
-		for steps in range(l.size()):
-			for m in range(x - l[end] - 1, x + l[end] + 2):
-				for n in range(y - l[start] - 1, y + l[start] + 2):
-					if (get_cell(m, n) != 0):
-						set_cell(m, n, 1, 0, 0)
-			end -= 1
-			start += 1
-		
-		# Create the actual and active visible part
-		var end = l.size() - 1
-		var start = 0
-		for steps in range(l.size()):
-			for m in range(x - l[end], x + l[end] + 1):
-				for n in range(y - l[start], y + l[start] + 1):
-					set_cell(m, n, -1)
-			end -= 1
-			start += 1
-	
-	x_old = x
-	y_old = y
-
-
-func _ready():
-	# Create a square filled with the 100% opaque fog
-	for x in range(x_min, x_max):
-		for y in range(y_min, y_max):
-			set_cell(x, y, 0, 0, 0)
-	set_fixed_process(true)

BIN
old/2d/fog_of_war/fog.png


Разлика између датотеке није приказан због своје велике величине
+ 0 - 25
old/2d/fog_of_war/fog.tscn


BIN
old/2d/fog_of_war/icon.png


+ 0 - 32
old/2d/fog_of_war/tileset.tres

@@ -1,32 +0,0 @@
-[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 = [  ]
-

+ 0 - 30
old/2d/fog_of_war/tileset_edit.tscn

@@ -1,30 +0,0 @@
-[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 )
-
-

+ 0 - 38
old/2d/fog_of_war/troll.gd

@@ -1,38 +0,0 @@
-
-extends KinematicBody2D
-
-# This is a simple collision demo showing how
-# the kinematic controller works.
-# move() will allow to move the node, and will
-# always move it to a non-colliding spot,
-# as long as it starts from a non-colliding spot too.
-
-# Member variables
-const MOTION_SPEED = 160 # Pixels/second
-
-
-func _fixed_process(delta):
-	var motion = Vector2()
-	
-	if (Input.is_action_pressed("move_up")):
-		motion += Vector2(0, -1)
-	if (Input.is_action_pressed("move_bottom")):
-		motion += Vector2(0, 1)
-	if (Input.is_action_pressed("move_left")):
-		motion += Vector2(-1, 0)
-	if (Input.is_action_pressed("move_right")):
-		motion += Vector2(1, 0)
-	
-	motion = motion.normalized()*MOTION_SPEED*delta
-	motion = move(motion)
-	
-	# Make character slide nicely through the world
-	var slide_attempts = 4
-	while(is_colliding() and slide_attempts > 0):
-		motion = get_collision_normal().slide(motion)
-		motion = move(motion)
-		slide_attempts -= 1
-
-
-func _ready():
-	set_fixed_process(true)

BIN
old/2d/fog_of_war/troll.png


+ 0 - 52
old/2d/fog_of_war/troll.tscn

@@ -1,52 +0,0 @@
-[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
-
-

+ 0 - 12
old/2d/isometric_light/character_shader.tres

@@ -1,12 +0,0 @@
-[gd_resource type="CanvasItemMaterial" load_steps=2 format=1]
-
-[sub_resource type="CanvasItemShader" id=1]
-
-_code = { "fragment":"//there is no albedo (all shading is normal)\nuniform color col;\nCOLOR=col;\n//sample normal texture\nvec4 ntex = tex(TEXTURE,UV);\n//take the alpha from the normal texture\nCOLOR.a=ntex.a;\n//adjust normalmap from [0..1] to [-1..1]\nntex.rgb = ntex.rgb * vec3(-2,-2,1) - vec3(-1,-1,0);\n//half size of the tile \nvec2 tile_vec=vec2(47,22);\n//rotation to convert the normal to pseudo 3d coordinates\n//this could be optimized\nfloat r = asin(tile_vec.y / tile_vec.x);\nmat3 rot_mat = mat3( vec3(1,0,0), vec3(0,cos(r),-sin(r)), vec3(0,sin(r),cos(r)));\n\n//pass the normal\nNORMAL =  rot_mat * ntex.rgb;\n\n\n\n\n", "fragment_ofs":0, "light":"//apply the normal as simple diffuse (same as default code)\nvec3 light_normal = normalize(vec3(LIGHT_VEC,-LIGHT_HEIGHT));\nLIGHT=LIGHT_COLOR*COLOR*max(dot(-light_normal,NORMAL),0.0);\n//substract light position to be always aligned to the bottom of the sprite\n//this makes lighting on it look like a billboard\nLIGHT_VEC.y-=VAR1.y;\n", "light_ofs":0, "vertex":"// pass the local sprite coordinates through a varying\n// the red cross in the sprite is the 0,0\nVAR1.xy=SRC_VERTEX;", "vertex_ofs":0 }
-
-[resource]
-
-shader/shader = SubResource( 1 )
-shader/shading_mode = 0
-shader_param/col = Color( 1, 0.836638, 0.693806, 1 )
-

+ 0 - 52
old/2d/isometric_light/column.tscn

@@ -1,52 +0,0 @@
-[gd_scene load_steps=5 format=1]
-
-[ext_resource path="res://wall_shader.tres" type="CanvasItemMaterial" id=1]
-[ext_resource path="res://faceColor.png" type="Texture" id=2]
-
-[sub_resource type="CircleShape2D" id=1]
-
-custom_solver_bias = 0.0
-radius = 20.0
-
-[sub_resource type="OccluderPolygon2D" id=2]
-
-closed = false
-cull_mode = 0
-polygon = Vector2Array( -16.1183, 62.9508, 4.32091, 74.9223, 23.3002, 65.2867 )
-
-[node name="column" type="StaticBody2D"]
-
-input/pickable = false
-shapes/0/shape = SubResource( 1 )
-shapes/0/transform = Matrix32( 1, 0, 0, 1, 1.36365, 7.83751 )
-shapes/0/trigger = false
-collision/layers = 1
-collision/mask = 1
-constant_linear_velocity = Vector2( 0, 0 )
-constant_angular_velocity = 0.0
-friction = 1.0
-bounce = 0.0
-
-[node name="Sprite" type="Sprite" parent="."]
-
-material/material = ExtResource( 1 )
-transform/pos = Vector2( 0.487671, 0.487679 )
-texture = ExtResource( 2 )
-offset = Vector2( -4.37984, -50.8523 )
-region = true
-region_rect = Rect2( 569, 179, 48, 154 )
-
-[node name="occluder" type="LightOccluder2D" parent="."]
-
-transform/pos = Vector2( -3.90138, -50.97 )
-occluder = SubResource( 2 )
-light_mask = 1
-
-[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
-
-transform/pos = Vector2( 1.36365, 7.83751 )
-shape = SubResource( 1 )
-trigger = false
-_update_shape_index = -1
-
-

+ 0 - 85
old/2d/isometric_light/cubio.gd

@@ -1,85 +0,0 @@
-
-extends KinematicBody2D
-
-# Member variables
-const MAX_SPEED = 300.0
-const IDLE_SPEED = 10.0
-const ACCEL = 5.0
-const VSCALE = 0.5
-const SHOOT_INTERVAL = 0.3
-
-var speed = Vector2()
-var current_anim = ""
-var current_mirror = false
-
-var shoot_countdown = 0
-
-
-func _input(event):
-	if (event.type == InputEvent.MOUSE_BUTTON and event.button_index == 1 and event.pressed and shoot_countdown <= 0):
-		var pos = get_canvas_transform().affine_inverse()*event.pos
-		var dir = (pos - get_global_pos()).normalized()
-		var bullet = preload("res://shoot.tscn").instance()
-		bullet.advance_dir = dir
-		bullet.set_pos(get_global_pos() + dir*60)
-		get_parent().add_child(bullet)
-		shoot_countdown = SHOOT_INTERVAL
-
-
-func _fixed_process(delta):
-	shoot_countdown -= delta
-	var dir = Vector2()
-	if (Input.is_action_pressed("up")):
-		dir += Vector2(0, -1)
-	if (Input.is_action_pressed("down")):
-		dir += Vector2(0, 1)
-	if (Input.is_action_pressed("left")):
-		dir += Vector2(-1, 0)
-	if (Input.is_action_pressed("right")):
-		dir += Vector2(1, 0)
-	
-	if (dir != Vector2()):
-		dir = dir.normalized()
-	speed = speed.linear_interpolate(dir*MAX_SPEED, delta*ACCEL)
-	var motion = speed*delta
-	motion.y *= VSCALE
-	motion = move(motion)
-	
-	if (is_colliding()):
-		var n = get_collision_normal()
-		motion = n.slide(motion)
-		move(motion)
-
-	var next_anim = ""
-	var next_mirror = false
-	
-	if (dir == Vector2() and speed.length() < IDLE_SPEED):
-		next_anim = "idle"
-		next_mirror = false
-	elif (speed.length() > IDLE_SPEED*0.1):
-		var angle = atan2(abs(speed.x), speed.y)
-		
-		next_mirror = speed.x > 0
-		if (angle < PI/8):
-			next_anim = "bottom"
-			next_mirror = false
-		elif (angle < PI/4 + PI/8):
-			next_anim = "bottom_left"
-		elif (angle < PI*2/4 + PI/8):
-			next_anim = "left"
-		elif (angle < PI*3/4 + PI/8):
-			next_anim = "top_left"
-		else:
-			next_anim = "top"
-			next_mirror = false
-	
-	if (next_anim != current_anim or next_mirror != current_mirror):
-		get_node("frames").set_flip_h(next_mirror)
-		get_node("anim").play(next_anim)
-		current_anim = next_anim
-		current_mirror = next_mirror
-
-
-func _ready():
-	set_fixed_process(true)
-	set_process_input(true)

Разлика између датотеке није приказан због своје велике величине
+ 0 - 174
old/2d/isometric_light/cubio.tscn


BIN
old/2d/isometric_light/cubio/idle0001.png


BIN
old/2d/isometric_light/cubio/idle0002.png


BIN
old/2d/isometric_light/cubio/idle0003.png


BIN
old/2d/isometric_light/cubio/idle0004.png


BIN
old/2d/isometric_light/cubio/idle0005.png


BIN
old/2d/isometric_light/cubio/idle0006.png


BIN
old/2d/isometric_light/cubio/idle0007.png


BIN
old/2d/isometric_light/cubio/idle0008.png


BIN
old/2d/isometric_light/cubio/idle0009.png


BIN
old/2d/isometric_light/cubio/idle0010.png


BIN
old/2d/isometric_light/cubio/idle0011.png


BIN
old/2d/isometric_light/cubio/idle0012.png


BIN
old/2d/isometric_light/cubio/idle0013.png


BIN
old/2d/isometric_light/cubio/idle0014.png


BIN
old/2d/isometric_light/cubio/idle0015.png


BIN
old/2d/isometric_light/cubio/idle0016.png


BIN
old/2d/isometric_light/cubio/idle0017.png


BIN
old/2d/isometric_light/cubio/idle0018.png


BIN
old/2d/isometric_light/cubio/idle0019.png


BIN
old/2d/isometric_light/cubio/idle0020.png


BIN
old/2d/isometric_light/cubio/idle0021.png


BIN
old/2d/isometric_light/cubio/idle0022.png


BIN
old/2d/isometric_light/cubio/idle0023.png


BIN
old/2d/isometric_light/cubio/idle0024.png


BIN
old/2d/isometric_light/cubio/idle0025.png


BIN
old/2d/isometric_light/cubio/idle0026.png


BIN
old/2d/isometric_light/cubio/idle0027.png


BIN
old/2d/isometric_light/cubio/idle0028.png


BIN
old/2d/isometric_light/cubio/idle0029.png


BIN
old/2d/isometric_light/cubio/idle0030.png


BIN
old/2d/isometric_light/cubio/idle0031.png


BIN
old/2d/isometric_light/cubio/idle0032.png


BIN
old/2d/isometric_light/cubio/idle0033.png


BIN
old/2d/isometric_light/cubio/idle0034.png


BIN
old/2d/isometric_light/cubio/idle0035.png


BIN
old/2d/isometric_light/cubio/idle0036.png


BIN
old/2d/isometric_light/cubio/idle0037.png


BIN
old/2d/isometric_light/cubio/idle0038.png


BIN
old/2d/isometric_light/cubio/idle0039.png


BIN
old/2d/isometric_light/cubio/idle0040.png


BIN
old/2d/isometric_light/cubio/idle0041.png


BIN
old/2d/isometric_light/cubio/idle0042.png


BIN
old/2d/isometric_light/cubio/idle0043.png


BIN
old/2d/isometric_light/cubio/idle0044.png


BIN
old/2d/isometric_light/cubio/idle0045.png


BIN
old/2d/isometric_light/cubio/idle0046.png


BIN
old/2d/isometric_light/cubio/idle0047.png


BIN
old/2d/isometric_light/cubio/idle0048.png


BIN
old/2d/isometric_light/cubio/idle0049.png


BIN
old/2d/isometric_light/cubio/idle0050.png


BIN
old/2d/isometric_light/cubio/idle0051.png


BIN
old/2d/isometric_light/cubio/idle0052.png


BIN
old/2d/isometric_light/cubio/idle0053.png


BIN
old/2d/isometric_light/cubio/idle0054.png


BIN
old/2d/isometric_light/cubio/idle0055.png


BIN
old/2d/isometric_light/cubio/idle0056.png


BIN
old/2d/isometric_light/cubio/idle0057.png


BIN
old/2d/isometric_light/cubio/idle0058.png


BIN
old/2d/isometric_light/cubio/idle0059.png


BIN
old/2d/isometric_light/cubio/idle0060.png


BIN
old/2d/isometric_light/cubio/norm-b-0001.png


BIN
old/2d/isometric_light/cubio/norm-b-0002.png


BIN
old/2d/isometric_light/cubio/norm-b-0003.png


BIN
old/2d/isometric_light/cubio/norm-b-0004.png


BIN
old/2d/isometric_light/cubio/norm-b-0005.png


BIN
old/2d/isometric_light/cubio/norm-b-0006.png


BIN
old/2d/isometric_light/cubio/norm-b-0007.png


Неке датотеке нису приказане због велике количине промена