Added player, added tiles, added objects
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
class_name Player
|
||||
extends CharacterBody2D
|
||||
|
||||
|
||||
const ANIMATION_IDLE = "idle"
|
||||
const ANIMATION_LOOK_AROUND_1 = "look_around_1"
|
||||
const ANIMATION_LOOK_AROUND_2 = "look_around_2"
|
||||
const ANIMATION_WALK_LEFT = "walk_left"
|
||||
const ANIMATION_WALK_RIGHT = "walk_right"
|
||||
const ANIMATION_FALL_DOWN = "fall_down"
|
||||
const ANIMATION_FALL_DOWN_LEFT = "fall_down_left"
|
||||
const ANIMATION_FALL_DOWN_RIGHT = "fall_down_right"
|
||||
const ANIMATION_FALL_UP = "fall_up"
|
||||
const ANIMATION_FALL_UP_LEFT = "fall_up_left"
|
||||
const ANIMATION_FALL_UP_RIGHT = "fall_up_right"
|
||||
|
||||
const LOOK_AROUND_CHANCE = 25
|
||||
|
||||
|
||||
@export_range(0.0, 1000.0) var max_speed := 160
|
||||
@export_range(0.0, 1000.0) var acceleration := 600.0
|
||||
@export_range(0.0, 1000.0) var jump_velocity := 320.0
|
||||
@export_range(0.0, 10.0) var switch_time := 1.0
|
||||
|
||||
|
||||
@onready var sprite : AnimatedSprite2D = $AnimatedSprite2D
|
||||
@onready var collision_switcher : CollisionSwitcher = $CollisionSwitcher
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
collision_switcher.material = sprite.material
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if not is_on_floor():
|
||||
velocity += get_gravity() * delta
|
||||
|
||||
if Input.is_action_just_pressed("jump") and is_on_floor():
|
||||
velocity.y = -jump_velocity
|
||||
|
||||
var direction := Input.get_axis("move_left", "move_right")
|
||||
if direction:
|
||||
velocity.x = move_toward(velocity.x, direction * max_speed, acceleration * delta)
|
||||
else:
|
||||
velocity.x = move_toward(velocity.x, 0, acceleration * delta)
|
||||
|
||||
_update_animation()
|
||||
move_and_slide()
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("switch_color"):
|
||||
collision_switcher.switch_color(switch_time)
|
||||
|
||||
|
||||
func _update_animation() -> void:
|
||||
var animation := _get_animation()
|
||||
if sprite.animation != animation:
|
||||
sprite.play(animation)
|
||||
|
||||
|
||||
func _get_animation() -> String:
|
||||
if is_on_floor():
|
||||
if velocity.x > 0:
|
||||
return ANIMATION_WALK_RIGHT
|
||||
elif velocity.x < 0:
|
||||
return ANIMATION_WALK_LEFT
|
||||
else:
|
||||
if is_zero_approx(velocity.x):
|
||||
if velocity.y > 0:
|
||||
return ANIMATION_FALL_DOWN
|
||||
else:
|
||||
return ANIMATION_FALL_UP
|
||||
if velocity.x > 0:
|
||||
if velocity.y > 0:
|
||||
return ANIMATION_FALL_DOWN_RIGHT
|
||||
else:
|
||||
return ANIMATION_FALL_UP_RIGHT
|
||||
elif velocity.x < 0:
|
||||
if velocity.y > 0:
|
||||
return ANIMATION_FALL_DOWN_LEFT
|
||||
else:
|
||||
return ANIMATION_FALL_UP_LEFT
|
||||
|
||||
if sprite.animation in [ANIMATION_LOOK_AROUND_1, ANIMATION_LOOK_AROUND_2]:
|
||||
return sprite.animation
|
||||
|
||||
return ANIMATION_IDLE
|
||||
|
||||
|
||||
func _on_animation_finished() -> void:
|
||||
match sprite.animation:
|
||||
ANIMATION_LOOK_AROUND_1, ANIMATION_LOOK_AROUND_2:
|
||||
sprite.play(ANIMATION_IDLE)
|
||||
|
||||
|
||||
func _on_animation_looped() -> void:
|
||||
match sprite.animation:
|
||||
ANIMATION_IDLE:
|
||||
if randi_range(1, 100) <= LOOK_AROUND_CHANCE:
|
||||
_play_look_around_animation()
|
||||
|
||||
|
||||
func _play_look_around_animation() -> void:
|
||||
sprite.play(ANIMATION_LOOK_AROUND_1 if randi_range(1, 2) == 1 else ANIMATION_LOOK_AROUND_2)
|
||||
@@ -0,0 +1 @@
|
||||
uid://bb8kc32sggrn2
|
||||
@@ -0,0 +1,323 @@
|
||||
[gd_scene load_steps=39 format=3 uid="uid://dtcad8tdx78tg"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bb8kc32sggrn2" path="res://game/characters/player.gd" id="1_xln5q"]
|
||||
[ext_resource type="Shader" uid="uid://lqq1mg6l1qqe" path="res://game/shaders/black_n_white.gdshader" id="2_i05k5"]
|
||||
[ext_resource type="PackedScene" uid="uid://5qlocc0yu8ug" path="res://game/collision_switcher.tscn" id="2_j06tb"]
|
||||
[ext_resource type="Texture2D" uid="uid://bjccaucrio6ht" path="res://images/characters/player.png" id="2_n6ad3"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_i05k5"]
|
||||
shader = ExtResource("2_i05k5")
|
||||
shader_parameter/black_color = Color(0, 0, 0, 1)
|
||||
shader_parameter/white_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/switch_colors = false
|
||||
shader_parameter/threshold = 0.5
|
||||
shader_parameter/speed = 5.0
|
||||
shader_parameter/intensity = 1.0
|
||||
shader_parameter/scale = 20.0
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_457no"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(128, 32, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ly4f6"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(128, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_htqrf"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(128, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vkuli"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(160, 32, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hrxdh"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(160, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gjv0h"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(160, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_n6ad3"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_i05k5"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mrbkc"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(64, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_166ew"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kepaj"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_v8w1g"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(128, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ss7fc"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_14vf2"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(96, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_rfvyr"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(96, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_v6e46"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(0, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qikhv"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(32, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xtgne"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(64, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qvokx"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(96, 96, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_cc0lq"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(0, 128, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_dw7uy"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(32, 128, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ecm54"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(64, 128, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0l1kh"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(96, 128, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_c3gpp"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(0, 32, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_myk4l"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(32, 32, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kwrpx"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(64, 32, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0n461"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(96, 32, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bgbv2"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(0, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_h5vay"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(32, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_4u621"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(64, 64, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_tqwgk"]
|
||||
atlas = ExtResource("2_n6ad3")
|
||||
region = Rect2(96, 64, 32, 32)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_v8w1g"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_457no")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"fall_down",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ly4f6")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"fall_down_left",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_htqrf")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"fall_down_right",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_vkuli")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"fall_up",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_hrxdh")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"fall_up_left",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_gjv0h")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"fall_up_right",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 3.0,
|
||||
"texture": SubResource("AtlasTexture_n6ad3")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_i05k5")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mrbkc")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_166ew")
|
||||
}, {
|
||||
"duration": 4.0,
|
||||
"texture": SubResource("AtlasTexture_kepaj")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 2.0,
|
||||
"texture": SubResource("AtlasTexture_v8w1g")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ss7fc")
|
||||
}, {
|
||||
"duration": 2.0,
|
||||
"texture": SubResource("AtlasTexture_14vf2")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"look_around_1",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 2.0,
|
||||
"texture": SubResource("AtlasTexture_rfvyr")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ss7fc")
|
||||
}, {
|
||||
"duration": 2.0,
|
||||
"texture": SubResource("AtlasTexture_v8w1g")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"look_around_2",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_v6e46")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qikhv")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xtgne")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_qvokx")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_cc0lq")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_dw7uy")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ecm54")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0l1kh")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk_left",
|
||||
"speed": 10.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_c3gpp")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_myk4l")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_kwrpx")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0n461")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_bgbv2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_h5vay")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_4u621")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_tqwgk")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"walk_right",
|
||||
"speed": 10.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_xln5q"]
|
||||
radius = 4.0
|
||||
|
||||
[node name="Player" type="CharacterBody2D"]
|
||||
collision_layer = 129
|
||||
collision_mask = 113
|
||||
script = ExtResource("1_xln5q")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
material = SubResource("ShaderMaterial_i05k5")
|
||||
sprite_frames = SubResource("SpriteFrames_v8w1g")
|
||||
animation = &"fall_up"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 1)
|
||||
shape = SubResource("CapsuleShape2D_xln5q")
|
||||
|
||||
[node name="CollisionSwitcher" parent="." node_paths=PackedStringArray("object") instance=ExtResource("2_j06tb")]
|
||||
object = NodePath("..")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
position_smoothing_enabled = true
|
||||
|
||||
[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animation_finished"]
|
||||
[connection signal="animation_looped" from="AnimatedSprite2D" to="." method="_on_animation_looped"]
|
||||
@@ -0,0 +1,131 @@
|
||||
class_name CollisionSwitcher
|
||||
extends Node
|
||||
|
||||
|
||||
enum Collisions {
|
||||
GREY_WORLD = 1 << 0,
|
||||
GREY_ENEMY = 1 << 4,
|
||||
|
||||
BLACK_WORLD = 1 << 1,
|
||||
BLACK_ENEMY = 1 << 2,
|
||||
BLACK_PLAYER = 1 << 3,
|
||||
|
||||
WHITE_WORLD = 1 << 5,
|
||||
WHITE_ENEMY = 1 << 6,
|
||||
WHITE_PLAYER = 1 << 7,
|
||||
|
||||
GREY = GREY_WORLD | GREY_ENEMY,
|
||||
BLACK = BLACK_WORLD | BLACK_ENEMY | BLACK_PLAYER,
|
||||
WHITE = WHITE_WORLD | WHITE_ENEMY | WHITE_PLAYER,
|
||||
}
|
||||
|
||||
enum State {
|
||||
Black,
|
||||
White,
|
||||
TransitionToBlack,
|
||||
TransitionToWhite,
|
||||
}
|
||||
|
||||
|
||||
const COLLISION_WHITE_SHIFT = 4
|
||||
|
||||
const MAX_INTENSITY = 1.0
|
||||
|
||||
const SHADER_SWITCH_COLORS = "shader_parameter/switch_colors"
|
||||
const SHADER_INTENSITY = "shader_parameter/intensity"
|
||||
|
||||
|
||||
@export var object : CollisionObject2D
|
||||
|
||||
@export var state := _state:
|
||||
set(value):
|
||||
if (_state != value):
|
||||
_state = value
|
||||
get():
|
||||
return _state
|
||||
|
||||
|
||||
var material : Material:
|
||||
set(value):
|
||||
material = value
|
||||
_apply_color()
|
||||
|
||||
var _state : State = State.White:
|
||||
set(value):
|
||||
_state = value
|
||||
_apply_color()
|
||||
|
||||
var _intensity_tween : Tween
|
||||
|
||||
var _grey_layer := 0
|
||||
var _color_layer := 0
|
||||
|
||||
var _grey_mask := 0
|
||||
var _color_mask := 0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_grey_layer = _get_grey_collision(object.collision_layer)
|
||||
_color_layer = _get_color_collision(object.collision_layer)
|
||||
|
||||
_grey_mask = _get_grey_collision(object.collision_mask)
|
||||
_color_mask = _get_color_collision(object.collision_mask)
|
||||
|
||||
|
||||
func switch_color(time: float = 0.0) -> void:
|
||||
if _intensity_tween != null and _intensity_tween.is_running(): return
|
||||
|
||||
if is_zero_approx(time):
|
||||
_state = State.Black if _state == State.White else State.White
|
||||
else:
|
||||
_state = State.TransitionToBlack if _state == State.White else State.TransitionToWhite
|
||||
|
||||
_intensity_tween = create_tween()
|
||||
_intensity_tween.tween_method(_set_shader_internsity, 0.0, MAX_INTENSITY, time)
|
||||
_intensity_tween.finished.connect(_update_state)
|
||||
|
||||
|
||||
func _get_grey_collision(collision: int) -> int:
|
||||
return collision & Collisions.GREY
|
||||
|
||||
|
||||
func _get_color_collision(collision: int) -> int:
|
||||
var black_collision := collision & Collisions.BLACK
|
||||
var white_collision := (collision & Collisions.WHITE) >> COLLISION_WHITE_SHIFT
|
||||
return black_collision | white_collision
|
||||
|
||||
|
||||
func _set_shader_internsity(value: float) -> void:
|
||||
material.set(SHADER_INTENSITY, value)
|
||||
|
||||
|
||||
func _update_state() -> void:
|
||||
match _state:
|
||||
State.TransitionToBlack:
|
||||
state = State.Black
|
||||
State.TransitionToWhite:
|
||||
state = State.White
|
||||
|
||||
|
||||
func _apply_color() -> void:
|
||||
var layer := 0
|
||||
var mask := 0
|
||||
|
||||
match _state:
|
||||
State.Black:
|
||||
layer = _grey_layer | _color_layer
|
||||
mask = _grey_mask | _color_mask
|
||||
State.White:
|
||||
layer = _grey_layer | (_color_layer << COLLISION_WHITE_SHIFT)
|
||||
mask = _grey_mask | (_color_mask << COLLISION_WHITE_SHIFT)
|
||||
State.TransitionToBlack, State.TransitionToWhite:
|
||||
layer = _grey_layer | _color_layer | (_color_layer << COLLISION_WHITE_SHIFT)
|
||||
mask = _grey_mask | _color_mask | (_color_mask << COLLISION_WHITE_SHIFT)
|
||||
|
||||
object.collision_layer = layer
|
||||
object.collision_mask = mask
|
||||
|
||||
|
||||
if material != null:
|
||||
var is_black := _state == State.Black or _state == State.TransitionToBlack
|
||||
material.set(SHADER_SWITCH_COLORS, is_black)
|
||||
@@ -0,0 +1 @@
|
||||
uid://cwdy67a7t021g
|
||||
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://5qlocc0yu8ug"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cwdy67a7t021g" path="res://game/collision_switcher.gd" id="1_imm5a"]
|
||||
|
||||
[node name="CollisionSwitcher" type="Node"]
|
||||
script = ExtResource("1_imm5a")
|
||||
@@ -1 +1,2 @@
|
||||
class_name AbstractLevel
|
||||
extends Node2D
|
||||
|
||||
@@ -1,6 +1,383 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://mpsu4g2b5h3a"]
|
||||
[gd_scene load_steps=13 format=3 uid="uid://mpsu4g2b5h3a"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c737mx0kxva7i" path="res://game/levels/abstract_level.gd" id="1_o2mui"]
|
||||
[ext_resource type="PackedScene" uid="uid://dtcad8tdx78tg" path="res://game/characters/player.tscn" id="2_r0ht6"]
|
||||
[ext_resource type="Texture2D" uid="uid://due8mmt5ww1sf" path="res://images/level/walls.png" id="3_fnnmn"]
|
||||
[ext_resource type="Material" uid="uid://dojhoc6ljpt1a" path="res://game/materials/gray_walls.tres" id="3_pi5fd"]
|
||||
[ext_resource type="Material" uid="uid://d2o2o1w8kb51g" path="res://game/materials/white_walls.tres" id="5_6b8cu"]
|
||||
[ext_resource type="Material" uid="uid://bhksbugqhxxa0" path="res://game/materials/black_walls.tres" id="6_x8k35"]
|
||||
|
||||
[node name="Level" type="Node2D"]
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_pi5fd"]
|
||||
texture = ExtResource("3_fnnmn")
|
||||
0:0/0 = 0
|
||||
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, -8, -8, 8, -3, 8, -3, -3, 8, -3, 8, -8)
|
||||
1:0/0 = 0
|
||||
1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, -3, -8, -3)
|
||||
2:0/0 = 0
|
||||
2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, 3, 8, 3, -3, -8, -3)
|
||||
3:0/0 = 0
|
||||
3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, 3, 8, 3, 8, 8, 3, 8)
|
||||
4:0/0 = 0
|
||||
4:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, -3, 3, -3, 8, -8, 8)
|
||||
5:0/0 = 0
|
||||
5:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
6:0/0 = 0
|
||||
6:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
0:1/0 = 0
|
||||
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 8, -8, 8)
|
||||
2:1/0 = 0
|
||||
2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, 8, 3, 8)
|
||||
3:1/0 = 0
|
||||
3:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, -3, 3, -3)
|
||||
4:1/0 = 0
|
||||
4:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-3, -8, -3, -3, -8, -3, -8, -8)
|
||||
5:1/0 = 0
|
||||
5:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
6:1/0 = 0
|
||||
6:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
0:2/0 = 0
|
||||
0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 3, 8, 3, 8, 8, -8, 8)
|
||||
1:2/0 = 0
|
||||
1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
2:2/0 = 0
|
||||
2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(8, -8, 8, 8, -8, 8, -8, 3, 3, 3, 3, -8)
|
||||
3:2/0 = 0
|
||||
3:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
4:2/0 = 0
|
||||
4:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
5:2/0 = 0
|
||||
5:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
6:2/0 = 0
|
||||
6:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
0:3/0 = 0
|
||||
0:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, -3, -8, -3)
|
||||
1:3/0 = 0
|
||||
1:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, -3, 8, -3, 8, -8)
|
||||
2:3/0 = 0
|
||||
2:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
3:3/0 = 0
|
||||
3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, -8, 8, 8, 8, 8, 3)
|
||||
4:3/0 = 0
|
||||
4:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
5:3/0 = 0
|
||||
5:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
6:3/0 = 0
|
||||
6:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 3, 8, 8, 8, 8, -8)
|
||||
6:4/0 = 0
|
||||
6:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 8, -8, 8)
|
||||
5:5/0 = 0
|
||||
5:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 3, 8, 3, 8, 8, -8, 8)
|
||||
4:5/0 = 0
|
||||
4:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 3, 3, -8, 3, -8, 8, 8, 8, 8, -8)
|
||||
3:5/0 = 0
|
||||
3:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 3, 8, 3, 8, 8, -8, 8)
|
||||
2:5/0 = 0
|
||||
2:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, 8, -8, 8, -8, 3, 3, 3)
|
||||
1:5/0 = 0
|
||||
1:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 3, 8, 3, 8, 8, -8, 8)
|
||||
0:5/0 = 0
|
||||
0:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, 8, -8, 8, -8, 3, 3, 3)
|
||||
0:4/0 = 0
|
||||
0:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, 3, 8, 3, -3, -8, -3)
|
||||
1:4/0 = 0
|
||||
1:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, -3, -3, -3, -3, 8, -8, 8)
|
||||
2:4/0 = 0
|
||||
2:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, 3, 8, 3, -3, -8, -3)
|
||||
3:4/0 = 0
|
||||
3:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, -3, -3, -3, -3, 8, -8, 8)
|
||||
4:4/0 = 0
|
||||
4:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 8, -8, 8)
|
||||
5:4/0 = 0
|
||||
5:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, 8, 3, 8)
|
||||
0:6/0 = 0
|
||||
0:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
1:6/0 = 0
|
||||
1:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
2:6/0 = 0
|
||||
2:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
7:0/0 = 0
|
||||
7:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:0/0 = 0
|
||||
8:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:1/0 = 0
|
||||
8:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:1/0 = 0
|
||||
7:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:2/0 = 0
|
||||
7:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:2/0 = 0
|
||||
8:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:3/0 = 0
|
||||
8:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:3/0 = 0
|
||||
7:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:4/0 = 0
|
||||
7:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:4/0 = 0
|
||||
8:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:5/0 = 0
|
||||
8:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:5/0 = 0
|
||||
7:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
|
||||
[sub_resource type="TileSet" id="TileSet_r0ht6"]
|
||||
physics_layer_0/collision_layer = 1
|
||||
physics_layer_0/collision_mask = 0
|
||||
sources/0 = SubResource("TileSetAtlasSource_pi5fd")
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_l0xih"]
|
||||
texture = ExtResource("3_fnnmn")
|
||||
0:0/0 = 0
|
||||
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, -8, -8, 8, -3, 8, -3, -3, 8, -3, 8, -8)
|
||||
1:0/0 = 0
|
||||
1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, -3, -8, -3)
|
||||
2:0/0 = 0
|
||||
2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, 3, 8, 3, -3, -8, -3)
|
||||
3:0/0 = 0
|
||||
3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, 3, 8, 3, 8, 8, 3, 8)
|
||||
4:0/0 = 0
|
||||
4:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, -3, 3, -3, 8, -8, 8)
|
||||
5:0/0 = 0
|
||||
5:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
6:0/0 = 0
|
||||
6:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
0:1/0 = 0
|
||||
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 8, -8, 8)
|
||||
2:1/0 = 0
|
||||
2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, 8, 3, 8)
|
||||
3:1/0 = 0
|
||||
3:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, -3, 3, -3)
|
||||
4:1/0 = 0
|
||||
4:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-3, -8, -3, -3, -8, -3, -8, -8)
|
||||
5:1/0 = 0
|
||||
5:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
6:1/0 = 0
|
||||
6:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
0:2/0 = 0
|
||||
0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 3, 8, 3, 8, 8, -8, 8)
|
||||
1:2/0 = 0
|
||||
1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
2:2/0 = 0
|
||||
2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(8, -8, 8, 8, -8, 8, -8, 3, 3, 3, 3, -8)
|
||||
3:2/0 = 0
|
||||
3:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
4:2/0 = 0
|
||||
4:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
5:2/0 = 0
|
||||
5:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
6:2/0 = 0
|
||||
6:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
0:3/0 = 0
|
||||
0:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, -3, -8, -3)
|
||||
1:3/0 = 0
|
||||
1:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, -3, 8, -3, 8, -8)
|
||||
2:3/0 = 0
|
||||
2:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
3:3/0 = 0
|
||||
3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, -8, 8, 8, 8, 8, 3)
|
||||
4:3/0 = 0
|
||||
4:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
5:3/0 = 0
|
||||
5:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
6:3/0 = 0
|
||||
6:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 3, 8, 8, 8, 8, -8)
|
||||
6:4/0 = 0
|
||||
6:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 8, -8, 8)
|
||||
5:5/0 = 0
|
||||
5:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 3, 8, 3, 8, 8, -8, 8)
|
||||
4:5/0 = 0
|
||||
4:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 3, 3, -8, 3, -8, 8, 8, 8, 8, -8)
|
||||
3:5/0 = 0
|
||||
3:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 3, 8, 3, 8, 8, -8, 8)
|
||||
2:5/0 = 0
|
||||
2:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, 8, -8, 8, -8, 3, 3, 3)
|
||||
1:5/0 = 0
|
||||
1:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 3, 8, 3, 8, 8, -8, 8)
|
||||
0:5/0 = 0
|
||||
0:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, 8, -8, 8, -8, 3, 3, 3)
|
||||
0:4/0 = 0
|
||||
0:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, 3, 8, 3, -3, -8, -3)
|
||||
1:4/0 = 0
|
||||
1:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, -3, -3, -3, -3, 8, -8, 8)
|
||||
2:4/0 = 0
|
||||
2:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, 3, 8, 3, -3, -8, -3)
|
||||
3:4/0 = 0
|
||||
3:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, -3, -3, -3, -3, 8, -8, 8)
|
||||
4:4/0 = 0
|
||||
4:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 8, -8, 8)
|
||||
5:4/0 = 0
|
||||
5:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, 8, 3, 8)
|
||||
0:6/0 = 0
|
||||
0:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
1:6/0 = 0
|
||||
1:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
2:6/0 = 0
|
||||
2:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
7:0/0 = 0
|
||||
7:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:0/0 = 0
|
||||
8:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:1/0 = 0
|
||||
8:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:1/0 = 0
|
||||
7:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:2/0 = 0
|
||||
7:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:2/0 = 0
|
||||
8:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:3/0 = 0
|
||||
8:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:3/0 = 0
|
||||
7:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:4/0 = 0
|
||||
7:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:4/0 = 0
|
||||
8:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:5/0 = 0
|
||||
8:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:5/0 = 0
|
||||
7:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
|
||||
[sub_resource type="TileSet" id="TileSet_b7vts"]
|
||||
physics_layer_0/collision_layer = 2
|
||||
physics_layer_0/collision_mask = 0
|
||||
sources/0 = SubResource("TileSetAtlasSource_l0xih")
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_x8k35"]
|
||||
texture = ExtResource("3_fnnmn")
|
||||
0:0/0 = 0
|
||||
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, -8, -8, 8, -3, 8, -3, -3, 8, -3, 8, -8)
|
||||
1:0/0 = 0
|
||||
1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, -3, -8, -3)
|
||||
2:0/0 = 0
|
||||
2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, 3, 8, 3, -3, -8, -3)
|
||||
3:0/0 = 0
|
||||
3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, 3, 8, 3, 8, 8, 3, 8)
|
||||
4:0/0 = 0
|
||||
4:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, -3, 3, -3, 8, -8, 8)
|
||||
5:0/0 = 0
|
||||
5:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
6:0/0 = 0
|
||||
6:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
0:1/0 = 0
|
||||
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 8, -8, 8)
|
||||
2:1/0 = 0
|
||||
2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, 8, 3, 8)
|
||||
3:1/0 = 0
|
||||
3:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, -3, 3, -3)
|
||||
4:1/0 = 0
|
||||
4:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-3, -8, -3, -3, -8, -3, -8, -8)
|
||||
5:1/0 = 0
|
||||
5:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
6:1/0 = 0
|
||||
6:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
0:2/0 = 0
|
||||
0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 3, 8, 3, 8, 8, -8, 8)
|
||||
1:2/0 = 0
|
||||
1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
2:2/0 = 0
|
||||
2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(8, -8, 8, 8, -8, 8, -8, 3, 3, 3, 3, -8)
|
||||
3:2/0 = 0
|
||||
3:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
4:2/0 = 0
|
||||
4:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
5:2/0 = 0
|
||||
5:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
6:2/0 = 0
|
||||
6:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
0:3/0 = 0
|
||||
0:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, -3, -8, -3)
|
||||
1:3/0 = 0
|
||||
1:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -8, -3, 8, -3, 8, -8)
|
||||
2:3/0 = 0
|
||||
2:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
3:3/0 = 0
|
||||
3:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, -8, 8, 8, 8, 8, 3)
|
||||
4:3/0 = 0
|
||||
4:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
5:3/0 = 0
|
||||
5:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
6:3/0 = 0
|
||||
6:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 3, 8, 8, 8, 8, -8)
|
||||
6:4/0 = 0
|
||||
6:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 8, -8, 8)
|
||||
5:5/0 = 0
|
||||
5:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 3, 8, 3, 8, 8, -8, 8)
|
||||
4:5/0 = 0
|
||||
4:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 3, 3, -8, 3, -8, 8, 8, 8, 8, -8)
|
||||
3:5/0 = 0
|
||||
3:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 3, 8, 3, 8, 8, -8, 8)
|
||||
2:5/0 = 0
|
||||
2:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, 8, -8, 8, -8, 3, 3, 3)
|
||||
1:5/0 = 0
|
||||
1:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 3, 8, 3, 8, 8, -8, 8)
|
||||
0:5/0 = 0
|
||||
0:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, 8, -8, 8, -8, 3, 3, 3)
|
||||
0:4/0 = 0
|
||||
0:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, 3, 8, 3, -3, -8, -3)
|
||||
1:4/0 = 0
|
||||
1:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, -3, -3, -3, -3, 8, -8, 8)
|
||||
2:4/0 = 0
|
||||
2:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, 3, 8, 3, -3, -8, -3)
|
||||
3:4/0 = 0
|
||||
3:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, -3, -3, -3, -3, 8, -8, 8)
|
||||
4:4/0 = 0
|
||||
4:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, -3, -8, -3, 8, -8, 8)
|
||||
5:4/0 = 0
|
||||
5:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(3, -8, 8, -8, 8, 8, 3, 8)
|
||||
0:6/0 = 0
|
||||
0:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
1:6/0 = 0
|
||||
1:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
2:6/0 = 0
|
||||
2:6/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, 3, 8, 3, 8, 8, -8, 8)
|
||||
7:0/0 = 0
|
||||
7:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:0/0 = 0
|
||||
8:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:1/0 = 0
|
||||
8:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:1/0 = 0
|
||||
7:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:2/0 = 0
|
||||
7:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:2/0 = 0
|
||||
8:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:3/0 = 0
|
||||
8:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:3/0 = 0
|
||||
7:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:4/0 = 0
|
||||
7:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:4/0 = 0
|
||||
8:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
8:5/0 = 0
|
||||
8:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
7:5/0 = 0
|
||||
7:5/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||
|
||||
[sub_resource type="TileSet" id="TileSet_l0xih"]
|
||||
physics_layer_0/collision_layer = 32
|
||||
physics_layer_0/collision_mask = 0
|
||||
sources/0 = SubResource("TileSetAtlasSource_x8k35")
|
||||
|
||||
[node name="AbstractLevel" type="Node2D"]
|
||||
script = ExtResource("1_o2mui")
|
||||
|
||||
[node name="Objects" type="Node2D" parent="."]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("2_r0ht6")]
|
||||
|
||||
[node name="Tiles" type="Node2D" parent="."]
|
||||
|
||||
[node name="GrayWalls" type="TileMapLayer" parent="Tiles"]
|
||||
material = ExtResource("3_pi5fd")
|
||||
tile_set = SubResource("TileSet_r0ht6")
|
||||
|
||||
[node name="BlackWalls" type="TileMapLayer" parent="Tiles"]
|
||||
material = ExtResource("6_x8k35")
|
||||
tile_set = SubResource("TileSet_b7vts")
|
||||
|
||||
[node name="WhiteWalls" type="TileMapLayer" parent="Tiles"]
|
||||
material = ExtResource("5_6b8cu")
|
||||
tile_set = SubResource("TileSet_l0xih")
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
class_name Level1
|
||||
extends AbstractLevel
|
||||
@@ -0,0 +1 @@
|
||||
uid://b04km0lbc108u
|
||||
@@ -0,0 +1,32 @@
|
||||
[gd_scene load_steps=7 format=4 uid="uid://bmn74wc2vophn"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://mpsu4g2b5h3a" path="res://game/levels/abstract_level.tscn" id="1_15okj"]
|
||||
[ext_resource type="Script" uid="uid://b04km0lbc108u" path="res://game/levels/level_1.gd" id="2_hj65a"]
|
||||
[ext_resource type="PackedScene" uid="uid://b3kyqvuxmfn8f" path="res://game/objects/fireplace.tscn" id="3_tuvkr"]
|
||||
[ext_resource type="PackedScene" uid="uid://pw8xqtpauy57" path="res://game/objects/tutorial/jump_kbd.tscn" id="4_crrvt"]
|
||||
[ext_resource type="PackedScene" uid="uid://cemhsfdru4pv6" path="res://game/objects/tutorial/movement_kbd.tscn" id="5_rifvl"]
|
||||
[ext_resource type="PackedScene" uid="uid://deo60sij43ibm" path="res://game/objects/tutorial/switch_kbd.tscn" id="6_l6jt4"]
|
||||
|
||||
[node name="Level1" instance=ExtResource("1_15okj")]
|
||||
script = ExtResource("2_hj65a")
|
||||
|
||||
[node name="Fireplace" parent="Objects" index="0" instance=ExtResource("3_tuvkr")]
|
||||
position = Vector2(452, -48)
|
||||
|
||||
[node name="JumpKbd" parent="Objects" index="1" instance=ExtResource("4_crrvt")]
|
||||
position = Vector2(346, -74)
|
||||
|
||||
[node name="MovementKbd" parent="Objects" index="2" instance=ExtResource("5_rifvl")]
|
||||
position = Vector2(65, 1)
|
||||
|
||||
[node name="SwitchKbd" parent="Objects" index="3" instance=ExtResource("6_l6jt4")]
|
||||
position = Vector2(692, -72)
|
||||
|
||||
[node name="GrayWalls" parent="Tiles" index="0"]
|
||||
tile_map_data = PackedByteArray("AAD9/wEAAAABAAAAAAD+/wEAAAABAAAAAAD//wEAAAABAAAAAAAAAAEAAAABAAAAAAABAAEAAAABAAAAAAACAAEAAAABAAAAAAD8/wEAAAADAAEAAAD8/wAAAAACAAEAAAD8////AAACAAEAAAD8//7/AAACAAEAAAD8//3/AAACAAEAAAADAAEAAAABAAAAAAAEAAEAAAABAAAAAAAFAAEAAAABAAAAAAAGAAEAAAABAAAAAAAHAAEAAAABAAAAAAAIAAEAAAABAAAAAAAJAAEAAAABAAAAAAAKAAEAAAABAAAAAAALAAEAAAABAAAAAAAMAAEAAAABAAAAAAANAAEAAAABAAAAAAAOAAEAAAABAAAAAAAPAAEAAAABAAAAAAAQAAEAAAABAAAAAAARAAEAAAABAAAAAAASAAEAAAABAAAAAAATAAEAAAAEAAEAAAATAAAAAAAAAAEAAAATAP//AAAAAAEAAAATAP7/AAAAAAAAAAAUAP7/AAABAAAAAAAVAP7/AAABAAAAAAAWAP7/AAABAAAAAAAXAP7/AAABAAAAAAAYAP7/AAABAAAAAAAZAP7/AAABAAAAAAAaAP7/AAABAAAAAAAbAP7/AAABAAAAAAAcAP7/AAABAAAAAAAdAP7/AAABAAAAAAAeAP7/AAABAAAAAAAfAP7/AAABAAAAAAAgAP7/AAABAAAAAAAhAP7/AAABAAAAAAAiAP7/AAABAAAAAAAjAP7/AAABAAAAAAAkAP7/AAABAAAAAAAlAP7/AAABAAAAAAAmAP7/AAABAAAAAAAnAP7/AAABAAAAAAAoAP7/AAABAAAAAAApAP7/AAABAAAAAAAqAP7/AAABAAAAAAArAP7/AAABAAAAAAAsAP7/AAABAAAAAAAtAP7/AAABAAAAAAAuAP7/AAABAAAAAAAvAP7/AAABAAAAAAAwAP7/AAABAAAAAAAxAP7/AAABAAAAAAAyAP7/AAABAAAAAAAzAP7/AAABAAAAAAA0AP7/AAABAAAAAAA1AP7/AAABAAAAAAA2AP7/AAABAAAAAAA3AP7/AAABAAAAAAA4AP7/AAABAAAAAABEAP7/AAAEAAEAAABEAP3/AAAAAAEAAABEAPz/AAAAAAEAAABEAPv/AAAAAAEAAABEAPr/AAAAAAEAAAA5AP7/AAABAAAAAAA6AP7/AAABAAAAAAA7AP7/AAABAAAAAAA8AP7/AAABAAAAAAA9AP7/AAABAAAAAAA+AP7/AAABAAAAAABCAP7/AAABAAAAAABDAP7/AAABAAAAAABHAAMAAAAAAAEAAABHAAQAAAAAAAEAAABHAAUAAAAAAAEAAABHAAYAAAAAAAEAAAA5AAMAAAACAAEAAAA5AAQAAAACAAEAAAA5AAUAAAACAAEAAAA5AAYAAAACAAEAAAA5AAcAAAADAAEAAABHAAcAAAAEAAEAAABGAAcAAAABAAAAAABFAAcAAAABAAAAAABEAAcAAAABAAAAAABDAAcAAAABAAAAAABCAAcAAAABAAAAAABBAAcAAAABAAAAAABAAAcAAAABAAAAAAA/AAcAAAABAAAAAAA+AAcAAAABAAAAAAA9AAcAAAABAAAAAAA8AAcAAAABAAAAAAA7AAcAAAABAAAAAAA6AAcAAAABAAAAAAA/AP7/AAAIAAAAAABBAP7/AAAHAAAAAAA=")
|
||||
|
||||
[node name="BlackWalls" parent="Tiles" index="1"]
|
||||
tile_map_data = PackedByteArray("AABAAP7/AAAEAAIAAAA=")
|
||||
|
||||
[node name="WhiteWalls" parent="Tiles" index="2"]
|
||||
tile_map_data = PackedByteArray("AAAwAP3/AAAAAAEAAAAwAPz/AAAAAAEAAAAwAPv/AAAAAAEAAAAwAPr/AAAAAAEAAAAwAPn/AAAAAAEAAAAwAPj/AAAAAAEAAAAwAPf/AAAAAAEAAAD8//z/AAACAAEAAAD8//v/AAACAAEAAAD8//r/AAACAAEAAAD8//n/AAACAAEAAAD8//j/AAACAAEAAAD8//f/AAACAAEAAAD8//b/AAADAAAAAAD9//b/AAABAAIAAAD+//b/AAABAAIAAAD///b/AAABAAIAAAAAAPb/AAABAAIAAAABAPb/AAABAAIAAAACAPb/AAABAAIAAAADAPb/AAABAAIAAAAEAPb/AAABAAIAAAAFAPb/AAABAAIAAAAGAPb/AAABAAIAAAAHAPb/AAABAAIAAAAIAPb/AAABAAIAAAAJAPb/AAABAAIAAAAKAPb/AAABAAIAAAALAPb/AAABAAIAAAAMAPb/AAABAAIAAAANAPb/AAABAAIAAAAOAPb/AAABAAIAAAAPAPb/AAABAAIAAAAQAPb/AAABAAIAAAARAPb/AAABAAIAAAASAPb/AAABAAIAAAATAPb/AAABAAIAAAAUAPb/AAABAAIAAAAVAPb/AAABAAIAAAAWAPb/AAABAAIAAAAXAPb/AAABAAIAAAAYAPb/AAABAAIAAAAZAPb/AAABAAIAAAAaAPb/AAABAAIAAAAbAPb/AAABAAIAAAAcAPb/AAABAAIAAAAdAPb/AAABAAIAAAAeAPb/AAABAAIAAAAfAPb/AAABAAIAAAAgAPb/AAABAAIAAAAhAPb/AAABAAIAAAAiAPb/AAABAAIAAAAjAPb/AAABAAIAAAAkAPb/AAABAAIAAAAlAPb/AAABAAIAAAAmAPb/AAABAAIAAAAnAPb/AAABAAIAAAAoAPb/AAABAAIAAAApAPb/AAABAAIAAAAqAPb/AAABAAIAAAArAPb/AAABAAIAAAAsAPb/AAABAAIAAAAtAPb/AAABAAIAAAAuAPb/AAABAAIAAAAvAPb/AAABAAIAAAAwAPb/AAABAAYAAAAxAPb/AAABAAIAAAAyAPb/AAABAAIAAAAzAPb/AAABAAIAAAA0APb/AAABAAIAAAA1APb/AAABAAIAAAA2APb/AAABAAIAAAA3APb/AAABAAIAAAA4APb/AAABAAIAAAA5APb/AAABAAIAAAA6APb/AAABAAIAAAA7APb/AAABAAIAAAA8APb/AAABAAIAAAA9APb/AAABAAIAAAA+APb/AAABAAIAAAA/APb/AAABAAIAAABAAPb/AAABAAIAAABEAPn/AAAAAAEAAABEAPj/AAAAAAEAAABEAPf/AAAAAAEAAABEAPb/AAAEAAAAAABBAPb/AAABAAIAAABCAPb/AAABAAIAAABDAPb/AAABAAIAAAA+AP7/AAADAAAAAABCAP7/AAAEAAAAAAA+AP//AAACAAIAAABCAP//AAAAAAIAAAA9AP//AAABAAIAAAA8AP//AAABAAIAAAA7AP//AAABAAIAAAA6AP//AAABAAIAAABDAP//AAABAAIAAABEAP//AAABAAIAAABFAP//AAABAAIAAABGAP//AAABAAIAAAA5AP//AAADAAAAAABHAP//AAAEAAAAAAA5AAAAAAACAAEAAAA5AAEAAAACAAEAAAA5AAIAAAACAAEAAABHAAAAAAAAAAEAAABHAAEAAAAAAAEAAABHAAIAAAAAAAEAAAA=")
|
||||
@@ -0,0 +1,13 @@
|
||||
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://bhksbugqhxxa0"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://lqq1mg6l1qqe" path="res://game/shaders/black_n_white.gdshader" id="1_sq141"]
|
||||
|
||||
[resource]
|
||||
shader = ExtResource("1_sq141")
|
||||
shader_parameter/black_color = Color(0, 0, 0, 1)
|
||||
shader_parameter/white_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/switch_colors = true
|
||||
shader_parameter/threshold = 0.5
|
||||
shader_parameter/speed = 5.0
|
||||
shader_parameter/intensity = 1.0
|
||||
shader_parameter/scale = 20.0
|
||||
@@ -0,0 +1,13 @@
|
||||
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://dojhoc6ljpt1a"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://lqq1mg6l1qqe" path="res://game/shaders/black_n_white.gdshader" id="1_rnyyp"]
|
||||
|
||||
[resource]
|
||||
shader = ExtResource("1_rnyyp")
|
||||
shader_parameter/black_color = Color(0, 0, 0, 1)
|
||||
shader_parameter/white_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/switch_colors = false
|
||||
shader_parameter/threshold = 0.5
|
||||
shader_parameter/speed = 2.000000095
|
||||
shader_parameter/intensity = 0.50000002375
|
||||
shader_parameter/scale = 15.0000007125
|
||||
@@ -0,0 +1,13 @@
|
||||
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://d2o2o1w8kb51g"]
|
||||
|
||||
[ext_resource type="Shader" uid="uid://lqq1mg6l1qqe" path="res://game/shaders/black_n_white.gdshader" id="1_1yg6n"]
|
||||
|
||||
[resource]
|
||||
shader = ExtResource("1_1yg6n")
|
||||
shader_parameter/black_color = Color(0, 0, 0, 1)
|
||||
shader_parameter/white_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/switch_colors = false
|
||||
shader_parameter/threshold = 0.5
|
||||
shader_parameter/speed = 5.0
|
||||
shader_parameter/intensity = 1.0
|
||||
shader_parameter/scale = 20.0
|
||||
@@ -22,7 +22,7 @@ func _setup_neighbors() -> void:
|
||||
|
||||
|
||||
func _on_start_button_pressed() -> void:
|
||||
pass
|
||||
get_tree().change_scene_to_file("res://game/levels/level_1.tscn")
|
||||
|
||||
|
||||
func _on_options_button_pressed() -> void:
|
||||
|
||||
@@ -14,15 +14,6 @@ grow_vertical = 2
|
||||
theme = ExtResource("2_qnvmd")
|
||||
script = ExtResource("1_5d27k")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
|
||||
@@ -19,15 +19,6 @@ grow_vertical = 2
|
||||
theme = ExtResource("2_e2bp2")
|
||||
script = ExtResource("1_lq2ks")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
class_name BWObject
|
||||
extends Node2D
|
||||
|
||||
|
||||
@export var is_colored := true
|
||||
@export var is_white := true
|
||||
|
||||
|
||||
func invert() -> void:
|
||||
is_white = not is_white
|
||||
@@ -1 +0,0 @@
|
||||
uid://b7qut5xhc5hxo
|
||||
@@ -1,10 +0,0 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://bgtb7602a2260"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b7qut5xhc5hxo" path="res://game/objects/b_w_object.gd" id="1_jpa1b"]
|
||||
|
||||
[node name="BlackAndWhiteObject" type="Node2D"]
|
||||
script = ExtResource("1_jpa1b")
|
||||
|
||||
[node name="Black" type="Node2D" parent="."]
|
||||
|
||||
[node name="White" type="Node2D" parent="."]
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dx1yasi8wlaye"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_nvgb0"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_opqiy"]
|
||||
atlas = ExtResource("1_nvgb0")
|
||||
region = Rect2(48, 0, 16, 32)
|
||||
|
||||
[node name="Bookstand" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_opqiy")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dopjsft0y8mw5"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_57t4w"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_sqimt"]
|
||||
atlas = ExtResource("1_57t4w")
|
||||
region = Rect2(128, 32, 32, 32)
|
||||
|
||||
[node name="Cabinet" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_sqimt")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://b8pvlnpdnfmd0"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_rse2u"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1kw05"]
|
||||
atlas = ExtResource("1_rse2u")
|
||||
region = Rect2(176, 0, 16, 32)
|
||||
|
||||
[node name="Chair" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_1kw05")
|
||||
@@ -0,0 +1,59 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://b3kyqvuxmfn8f"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_xghly"]
|
||||
[ext_resource type="Shader" uid="uid://lqq1mg6l1qqe" path="res://game/shaders/black_n_white.gdshader" id="2_4nvxe"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_4nvxe"]
|
||||
script/source = "extends Node2D
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
$AnimatedSprite2D.play(\"default\")
|
||||
"
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2ho61"]
|
||||
atlas = ExtResource("1_xghly")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_2ho61"]
|
||||
shader = ExtResource("2_4nvxe")
|
||||
shader_parameter/black_color = Color(0, 0, 0, 1)
|
||||
shader_parameter/white_color = Color(1, 1, 1, 1)
|
||||
shader_parameter/switch_colors = false
|
||||
shader_parameter/threshold = 0.5
|
||||
shader_parameter/speed = 5.0000002375
|
||||
shader_parameter/intensity = 0.50000002375
|
||||
shader_parameter/scale = 75.0000035625
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6xx0h"]
|
||||
atlas = ExtResource("1_xghly")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_b1qtt"]
|
||||
atlas = ExtResource("1_xghly")
|
||||
region = Rect2(32, 16, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_f0x6e"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_6xx0h")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_b1qtt")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[node name="Fireplace" type="Node2D"]
|
||||
script = SubResource("GDScript_4nvxe")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_2ho61")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
material = SubResource("ShaderMaterial_2ho61")
|
||||
position = Vector2(0, 8)
|
||||
sprite_frames = SubResource("SpriteFrames_f0x6e")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://betmooym3gxqx"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_x2hio"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_1c3a2"]
|
||||
atlas = ExtResource("1_x2hio")
|
||||
region = Rect2(160, 32, 32, 32)
|
||||
|
||||
[node name="Moon" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_1c3a2")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://crccdk7wmuqig"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_a62d7"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_qwmf4"]
|
||||
atlas = ExtResource("1_a62d7")
|
||||
region = Rect2(0, 32, 48, 32)
|
||||
|
||||
[node name="PaintingHL" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_qwmf4")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://c0bk5sk661hi1"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_u3qkd"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vssfe"]
|
||||
atlas = ExtResource("1_u3qkd")
|
||||
region = Rect2(48, 32, 32, 32)
|
||||
|
||||
[node name="PaintingHS" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_vssfe")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://d330w1ygg6uxy"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_v74mh"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_hq5lq"]
|
||||
atlas = ExtResource("1_v74mh")
|
||||
region = Rect2(96, 0, 32, 48)
|
||||
|
||||
[node name="PaintingVL" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_hq5lq")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bo7756lp68bl1"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_1hdr2"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0ynw1"]
|
||||
atlas = ExtResource("1_1hdr2")
|
||||
region = Rect2(64, 0, 32, 32)
|
||||
|
||||
[node name="PaintingVS" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_0ynw1")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bdwbdnbenueu1"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_qacj7"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_runce"]
|
||||
atlas = ExtResource("1_qacj7")
|
||||
region = Rect2(128, 0, 48, 32)
|
||||
|
||||
[node name="Table" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_runce")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bgs6j6ak5qnq1"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_0act5"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pnn6n"]
|
||||
atlas = ExtResource("1_0act5")
|
||||
region = Rect2(48, 96, 32, 32)
|
||||
|
||||
[node name="InteractionKbd" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_pnn6n")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://c0cae3bivcnal"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_fjtec"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ow2w5"]
|
||||
atlas = ExtResource("1_fjtec")
|
||||
region = Rect2(112, 96, 32, 32)
|
||||
|
||||
[node name="InteractionPad" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_ow2w5")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://pw8xqtpauy57"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_gth0n"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wa8xe"]
|
||||
atlas = ExtResource("1_gth0n")
|
||||
region = Rect2(0, 96, 48, 32)
|
||||
|
||||
[node name="JumpKbd" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_wa8xe")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://3372ayctb2ed"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_206pc"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_6w0xc"]
|
||||
atlas = ExtResource("1_206pc")
|
||||
region = Rect2(80, 96, 32, 32)
|
||||
|
||||
[node name="JumpPad" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_6w0xc")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cemhsfdru4pv6"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_pa6ll"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_v0og1"]
|
||||
atlas = ExtResource("1_pa6ll")
|
||||
region = Rect2(0, 64, 48, 32)
|
||||
|
||||
[node name="MovementKbd" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_v0og1")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://tipop68pyrf7"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_crf2r"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_00r84"]
|
||||
atlas = ExtResource("1_crf2r")
|
||||
region = Rect2(80, 48, 32, 48)
|
||||
|
||||
[node name="MovementPad" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_00r84")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://deo60sij43ibm"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_t6r5l"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_lviuj"]
|
||||
atlas = ExtResource("1_t6r5l")
|
||||
region = Rect2(48, 64, 32, 32)
|
||||
|
||||
[node name="SwitchKbd" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_lviuj")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://f70xseggdimg"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_d2iw1"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nyhjv"]
|
||||
atlas = ExtResource("1_d2iw1")
|
||||
region = Rect2(112, 64, 32, 32)
|
||||
|
||||
[node name="SwitchPad" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_nyhjv")
|
||||
@@ -0,0 +1,12 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cvhovmnl050os"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddm4gc2g3aj2i" path="res://images/level/objects.png" id="1_610bq"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_wbqlk"]
|
||||
atlas = ExtResource("1_610bq")
|
||||
region = Rect2(144, 80, 32, 48)
|
||||
|
||||
[node name="Wardrobe" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = SubResource("AtlasTexture_wbqlk")
|
||||
@@ -0,0 +1,57 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform vec4 black_color : source_color = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
uniform vec4 white_color : source_color = vec4(1.0, 1.0, 1.0, 1.0);
|
||||
uniform bool switch_colors = false;
|
||||
uniform float threshold : hint_range(0.0, 1.0) = 0.5;
|
||||
uniform float speed : hint_range(0.0, 10.0) = 5.0;
|
||||
uniform float intensity : hint_range(0.0, 1.0) = 1.0;
|
||||
uniform float scale : hint_range(0.0, 100.0) = 20.0;
|
||||
|
||||
float rand(vec2 coord) {
|
||||
return fract(sin(dot(coord, vec2(12.9898, 78.233))) * 43758.5453);
|
||||
}
|
||||
|
||||
float cellular(vec2 coord) {
|
||||
vec2 i = floor(coord);
|
||||
vec2 f = fract(coord);
|
||||
|
||||
float min_dist = 1.0;
|
||||
|
||||
for (int y = -1; y <= 1; y++) {
|
||||
for (int x = -1; x <= 1; x++) {
|
||||
vec2 neighbor = vec2(float(x), float(y));
|
||||
vec2 point = vec2(rand(i + neighbor), rand(i + neighbor + vec2(1000.0)));
|
||||
point = 0.5 * sin(TIME * speed + 6.2831 * point);
|
||||
vec2 diff = neighbor + point - f;
|
||||
float dist = length(diff);
|
||||
min_dist = min(min_dist, dist);
|
||||
}
|
||||
}
|
||||
|
||||
return min_dist;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
if (COLOR.a != 0.0) {
|
||||
float l = dot(COLOR.rgb, vec3(0.2126, 0.7152, 0.0722));
|
||||
|
||||
bool is_black = l < threshold;
|
||||
if (switch_colors) {
|
||||
is_black = !is_black;
|
||||
}
|
||||
if (intensity < 1.0) {
|
||||
vec2 coord = UV * scale;
|
||||
if (cellular(coord) > intensity) {
|
||||
is_black = !is_black;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_black) {
|
||||
COLOR = black_color;
|
||||
}
|
||||
else {
|
||||
COLOR = white_color;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://lqq1mg6l1qqe
|
||||
Reference in New Issue
Block a user