Reworked Cultist
This commit is contained in:
@@ -1,10 +0,0 @@
|
|||||||
class_name AbstractColorCultist
|
|
||||||
extends AbstractCultist
|
|
||||||
|
|
||||||
|
|
||||||
@onready var collision_switcher : CollisionSwitcher = $CollisionSwitcher
|
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
super._ready()
|
|
||||||
collision_switcher.add_material(sprite.material)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://das7ujanefsn0
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
[gd_scene format=3 uid="uid://d37eyum03h83i"]
|
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bx0luh4vdob3q" path="res://game/characters/enemies/abstract_cultist.tscn" id="1_12hr0"]
|
|
||||||
[ext_resource type="Script" uid="uid://das7ujanefsn0" path="res://game/characters/enemies/abstract_color_cultist.gd" id="2_rd56i"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://5qlocc0yu8ug" path="res://game/collision_switcher.tscn" id="3_e5cea"]
|
|
||||||
|
|
||||||
[sub_resource type="ViewportTexture" id="ViewportTexture_f5md8"]
|
|
||||||
viewport_path = NodePath("SubViewport")
|
|
||||||
|
|
||||||
[node name="AbstractColorCultist" unique_id=644641841 instance=ExtResource("1_12hr0")]
|
|
||||||
script = ExtResource("2_rd56i")
|
|
||||||
|
|
||||||
[node name="CultistSprite" parent="." index="1" unique_id=797412888]
|
|
||||||
texture = SubResource("ViewportTexture_f5md8")
|
|
||||||
|
|
||||||
[node name="CollisionSwitcher" parent="." index="2" unique_id=991274552 node_paths=PackedStringArray("objects") instance=ExtResource("3_e5cea")]
|
|
||||||
objects = [NodePath("..")]
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
class_name AbstractCultist
|
|
||||||
extends CharacterBody2D
|
|
||||||
|
|
||||||
|
|
||||||
const MAX_WALK_SPEED = 85
|
|
||||||
const MAX_CHASE_SPEED = 170
|
|
||||||
const ACCELERATION = 600.0
|
|
||||||
const JUMP_VELOCITY = 222.0
|
|
||||||
const JUMP_GRAVITY_FACTOR = 1.0
|
|
||||||
const FALL_GRAVITY_FACTOR = 1.5
|
|
||||||
|
|
||||||
|
|
||||||
var target_x := 0.0
|
|
||||||
|
|
||||||
|
|
||||||
@onready var sprite : Sprite2D = $CultistSprite
|
|
||||||
@onready var water_splash : GPUParticles2D = $WaterSplash
|
|
||||||
@onready var animated_sprite : AnimatedSprite2D = $SubViewport/CultistSprite
|
|
||||||
|
|
||||||
@onready var left_wall_high_ray : RayCast2D = $WallCheckHigh/LeftWallRay
|
|
||||||
@onready var right_wall_high_ray : RayCast2D = $WallCheckHigh/RightWallRay
|
|
||||||
|
|
||||||
@onready var left_wall_low_ray : RayCast2D = $WallCheckLow/LeftWallRay
|
|
||||||
@onready var right_wall_low_ray : RayCast2D = $WallCheckLow/RightWallRay
|
|
||||||
|
|
||||||
@onready var left_player_close_ray : RayCast2D = $%LeftPlayerCloseRay
|
|
||||||
@onready var right_player_close_ray : RayCast2D = $%RightPlayerCloseRay
|
|
||||||
|
|
||||||
@onready var left_player_distant_ray : RayCast2D = $%LeftPlayerDistantRay
|
|
||||||
@onready var right_player_distant_ray : RayCast2D = $%RightPlayerDistantRay
|
|
||||||
|
|
||||||
@onready var state_machine : CultistStateMachine = $CultistStateMachine
|
|
||||||
@onready var chase_left_state : CultistState = $CultistStateMachine/ChaseLeftState
|
|
||||||
@onready var chase_right_state : CultistState = $CultistStateMachine/ChaseRightState
|
|
||||||
@onready var look_around_state : CultistState = $CultistStateMachine/LookAroundState
|
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
|
||||||
_set_ray_cast_enable(left_player_close_ray, false)
|
|
||||||
_set_ray_cast_enable(right_player_close_ray, false)
|
|
||||||
_set_ray_cast_enable(left_player_distant_ray, false)
|
|
||||||
_set_ray_cast_enable(right_player_distant_ray, false)
|
|
||||||
|
|
||||||
state_machine.init()
|
|
||||||
|
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
|
||||||
state_machine.physics_process(delta)
|
|
||||||
move_and_slide()
|
|
||||||
|
|
||||||
|
|
||||||
func kill(type := KillingArea.Type.None) -> void:
|
|
||||||
match type:
|
|
||||||
KillingArea.Type.Water:
|
|
||||||
SoundManager.play_sfx_stream(SoundManager.sfx_stream_splash, global_position)
|
|
||||||
water_splash.finished.connect(queue_free)
|
|
||||||
water_splash.restart()
|
|
||||||
_:
|
|
||||||
queue_free()
|
|
||||||
|
|
||||||
|
|
||||||
func update_x_velocity(direction: int, max_speed: float, delta: float) -> void:
|
|
||||||
velocity.x = move_toward(velocity.x, direction * max_speed, ACCELERATION * delta)
|
|
||||||
|
|
||||||
|
|
||||||
func get_gravity_factor() -> float:
|
|
||||||
return JUMP_GRAVITY_FACTOR if velocity.y < 0.0 else FALL_GRAVITY_FACTOR
|
|
||||||
|
|
||||||
|
|
||||||
func _set_ray_cast_enable(ray_cast: RayCast2D, enabled: bool) -> void:
|
|
||||||
ray_cast.process_mode = Node.PROCESS_MODE_INHERIT if enabled else Node.PROCESS_MODE_DISABLED
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
class_name BlackCultist
|
|
||||||
extends AbstractColorCultist
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://c2knsjcp6faf6
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
[gd_scene format=3 uid="uid://cutjutvd8dqqc"]
|
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://d37eyum03h83i" path="res://game/characters/enemies/abstract_color_cultist.tscn" id="1_gj2ks"]
|
|
||||||
[ext_resource type="Script" uid="uid://c2knsjcp6faf6" path="res://game/characters/enemies/black_cultist.gd" id="2_332ds"]
|
|
||||||
[ext_resource type="Material" uid="uid://dggr8t4b30e3n" path="res://game/materials/enemy_black.tres" id="3_v1if5"]
|
|
||||||
|
|
||||||
[sub_resource type="ViewportTexture" id="ViewportTexture_q6bby"]
|
|
||||||
viewport_path = NodePath("SubViewport")
|
|
||||||
|
|
||||||
[node name="BlackCultist" unique_id=1910124567 instance=ExtResource("1_gj2ks")]
|
|
||||||
collision_layer = 4
|
|
||||||
collision_mask = 3
|
|
||||||
script = ExtResource("2_332ds")
|
|
||||||
|
|
||||||
[node name="CultistSprite" parent="." index="0" unique_id=797412888]
|
|
||||||
material = ExtResource("3_v1if5")
|
|
||||||
texture = SubResource("ViewportTexture_q6bby")
|
|
||||||
|
|
||||||
[node name="CollisionSwitcher" parent="." index="2" unique_id=991274552]
|
|
||||||
initial_state = 0
|
|
||||||
|
|
||||||
[node name="LeftWallRay" parent="WallCheckLow" parent_id_path=PackedInt32Array(782156094) index="0" unique_id=521416854]
|
|
||||||
collision_mask = 3
|
|
||||||
|
|
||||||
[node name="RightWallRay" parent="WallCheckLow" parent_id_path=PackedInt32Array(782156094) index="1" unique_id=1457669135]
|
|
||||||
collision_mask = 3
|
|
||||||
|
|
||||||
[node name="LeftPlayerCloseRay" parent="PlayerCloseCheck" parent_id_path=PackedInt32Array(1593775088) index="0" unique_id=947570027]
|
|
||||||
target_position = Vector2(-32, 0)
|
|
||||||
collision_mask = 11
|
|
||||||
|
|
||||||
[node name="RightPlayerCloseRay" parent="PlayerCloseCheck" parent_id_path=PackedInt32Array(1593775088) index="1" unique_id=1559118218]
|
|
||||||
target_position = Vector2(32, 0)
|
|
||||||
collision_mask = 11
|
|
||||||
|
|
||||||
[node name="LeftPlayerDistantRay" parent="PlayerDistantCheck" parent_id_path=PackedInt32Array(1597489123) index="0" unique_id=1491085518]
|
|
||||||
collision_mask = 11
|
|
||||||
|
|
||||||
[node name="RightPlayerDistantRay" parent="PlayerDistantCheck" parent_id_path=PackedInt32Array(1597489123) index="1" unique_id=1377654831]
|
|
||||||
collision_mask = 11
|
|
||||||
|
|
||||||
[node name="KillingArea" parent="." index="8" unique_id=1891922549]
|
|
||||||
collision_mask = 8
|
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
@tool
|
||||||
|
class_name Cultist
|
||||||
|
extends CharacterBody2D
|
||||||
|
|
||||||
|
|
||||||
|
enum Type {
|
||||||
|
White,
|
||||||
|
Black,
|
||||||
|
Gray,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const MAX_WALK_SPEED = 85
|
||||||
|
const MAX_CHASE_SPEED = 170
|
||||||
|
const ACCELERATION = 600.0
|
||||||
|
const JUMP_VELOCITY = 222.0
|
||||||
|
const JUMP_GRAVITY_FACTOR = 1.0
|
||||||
|
const FALL_GRAVITY_FACTOR = 1.5
|
||||||
|
|
||||||
|
|
||||||
|
@export var type := Type.White:
|
||||||
|
set(value):
|
||||||
|
type = value
|
||||||
|
if is_node_ready():
|
||||||
|
_updated_sprite()
|
||||||
|
_updated_collision()
|
||||||
|
|
||||||
|
|
||||||
|
var target_x := 0.0
|
||||||
|
|
||||||
|
|
||||||
|
@onready var sprite : Sprite2D = $CultistSprite
|
||||||
|
@onready var animated_sprite : AnimatedSprite2D = $CultistSprite.animated_sprite
|
||||||
|
@onready var water_splash : GPUParticles2D = $WaterSplash
|
||||||
|
@onready var killing_area : KillingArea = $KillingArea
|
||||||
|
|
||||||
|
@onready var left_wall_high_ray : RayCast2D = $WallCheckHigh/LeftWallRay
|
||||||
|
@onready var right_wall_high_ray : RayCast2D = $WallCheckHigh/RightWallRay
|
||||||
|
|
||||||
|
@onready var left_wall_low_ray : RayCast2D = $WallCheckLow/LeftWallRay
|
||||||
|
@onready var right_wall_low_ray : RayCast2D = $WallCheckLow/RightWallRay
|
||||||
|
|
||||||
|
@onready var left_player_close_ray : RayCast2D = $%LeftPlayerCloseRay
|
||||||
|
@onready var right_player_close_ray : RayCast2D = $%RightPlayerCloseRay
|
||||||
|
|
||||||
|
@onready var left_player_distant_ray : RayCast2D = $%LeftPlayerDistantRay
|
||||||
|
@onready var right_player_distant_ray : RayCast2D = $%RightPlayerDistantRay
|
||||||
|
|
||||||
|
@onready var wall_rays : Array[RayCast2D] = [
|
||||||
|
left_wall_high_ray, right_wall_high_ray,
|
||||||
|
left_wall_low_ray, right_wall_low_ray,
|
||||||
|
]
|
||||||
|
@onready var player_rays : Array[RayCast2D] = [
|
||||||
|
left_player_close_ray, right_player_close_ray,
|
||||||
|
left_player_distant_ray, right_player_distant_ray,
|
||||||
|
]
|
||||||
|
|
||||||
|
@onready var state_machine : CultistStateMachine = $CultistStateMachine
|
||||||
|
@onready var chase_left_state : CultistState = $CultistStateMachine/ChaseLeftState
|
||||||
|
@onready var chase_right_state : CultistState = $CultistStateMachine/ChaseRightState
|
||||||
|
@onready var look_around_state : CultistState = $CultistStateMachine/LookAroundState
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
_updated_sprite()
|
||||||
|
_updated_collision()
|
||||||
|
if not Engine.is_editor_hint():
|
||||||
|
_set_ray_cast_enable(left_player_close_ray, false)
|
||||||
|
_set_ray_cast_enable(right_player_close_ray, false)
|
||||||
|
_set_ray_cast_enable(left_player_distant_ray, false)
|
||||||
|
_set_ray_cast_enable(right_player_distant_ray, false)
|
||||||
|
state_machine.init()
|
||||||
|
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
if not Engine.is_editor_hint():
|
||||||
|
state_machine.physics_process(delta)
|
||||||
|
move_and_slide()
|
||||||
|
|
||||||
|
|
||||||
|
func kill(killing_type := KillingArea.Type.None) -> void:
|
||||||
|
match killing_type:
|
||||||
|
KillingArea.Type.Water:
|
||||||
|
SoundManager.play_sfx_stream(SoundManager.sfx_stream_splash, global_position)
|
||||||
|
water_splash.finished.connect(queue_free)
|
||||||
|
water_splash.restart()
|
||||||
|
_:
|
||||||
|
queue_free()
|
||||||
|
|
||||||
|
|
||||||
|
func update_x_velocity(direction: int, max_speed: float, delta: float) -> void:
|
||||||
|
velocity.x = move_toward(velocity.x, direction * max_speed, ACCELERATION * delta)
|
||||||
|
|
||||||
|
|
||||||
|
func get_gravity_factor() -> float:
|
||||||
|
return JUMP_GRAVITY_FACTOR if velocity.y < 0.0 else FALL_GRAVITY_FACTOR
|
||||||
|
|
||||||
|
|
||||||
|
func _updated_sprite() -> void:
|
||||||
|
sprite.type = type
|
||||||
|
|
||||||
|
|
||||||
|
func _updated_collision() -> void:
|
||||||
|
const C = CollisionSwitcher.Collisions
|
||||||
|
|
||||||
|
var layer: int
|
||||||
|
var world_mask: int
|
||||||
|
var player_mask: int
|
||||||
|
|
||||||
|
match type:
|
||||||
|
Type.White:
|
||||||
|
layer = C.WHITE_ENEMY
|
||||||
|
world_mask = C.WHITE_WORLD
|
||||||
|
player_mask = C.WHITE_PLAYER
|
||||||
|
Type.Black:
|
||||||
|
layer = C.BLACK_ENEMY
|
||||||
|
world_mask = C.BLACK_WORLD
|
||||||
|
player_mask = C.BLACK_PLAYER
|
||||||
|
Type.Gray:
|
||||||
|
layer = C.GREY_ENEMY
|
||||||
|
world_mask = C.WHITE_WORLD | C.BLACK_WORLD
|
||||||
|
player_mask = C.WHITE_PLAYER | C.BLACK_PLAYER
|
||||||
|
_:
|
||||||
|
return
|
||||||
|
world_mask |= C.GREY_WORLD
|
||||||
|
|
||||||
|
collision_layer = layer
|
||||||
|
_set_mask(world_mask, player_mask)
|
||||||
|
|
||||||
|
|
||||||
|
func _set_mask(world_mask: int, player_mask: int) -> void:
|
||||||
|
collision_mask = world_mask
|
||||||
|
for ray in wall_rays:
|
||||||
|
ray.collision_mask = world_mask
|
||||||
|
for ray in player_rays:
|
||||||
|
ray.collision_mask = world_mask | player_mask
|
||||||
|
killing_area.collision_mask = player_mask
|
||||||
|
|
||||||
|
|
||||||
|
func _set_ray_cast_enable(ray_cast: RayCast2D, enabled: bool) -> void:
|
||||||
|
ray_cast.process_mode = Node.PROCESS_MODE_INHERIT if enabled else Node.PROCESS_MODE_DISABLED
|
||||||
|
if Engine.is_editor_hint():
|
||||||
|
if enabled: ray_cast.show()
|
||||||
|
else: ray_cast.hide()
|
||||||
+73
-60
@@ -1,23 +1,38 @@
|
|||||||
[gd_scene format=3 uid="uid://bx0luh4vdob3q"]
|
[gd_scene format=3 uid="uid://bx0luh4vdob3q"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://but5aeh7y1s0f" path="res://game/characters/enemies/abstract_cultist.gd" id="1_2wrno"]
|
[ext_resource type="Script" uid="uid://but5aeh7y1s0f" path="res://game/characters/enemies/cultist.gd" id="1_ah13v"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dtxiercm8dsfm" path="res://game/characters/enemies/cultist_sprite.tscn" id="2_tjvyk"]
|
[ext_resource type="PackedScene" uid="uid://8yd8f5x1hujv" path="res://game/characters/water_splash.tscn" id="2_go1hq"]
|
||||||
[ext_resource type="PackedScene" uid="uid://8yd8f5x1hujv" path="res://game/characters/water_splash.tscn" id="2_w1t0g"]
|
[ext_resource type="PackedScene" uid="uid://dtxiercm8dsfm" path="res://game/characters/enemies/cultist_sprite.tscn" id="3_mbt3t"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dike8xgbqdut2" path="res://game/killing_area.tscn" id="3_tjvyk"]
|
[ext_resource type="Shader" uid="uid://lqq1mg6l1qqe" path="res://game/shaders/black_n_white.gdshader" id="4_ul6ar"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bg7k6ovbk1xgm" path="res://game/characters/enemies/state_machine/cultist_state_machine.tscn" id="4_yu28k"]
|
[ext_resource type="PackedScene" uid="uid://dike8xgbqdut2" path="res://game/killing_area.tscn" id="5_500rx"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bq1v55jv4c6qe" path="res://game/characters/enemies/state_machine/cultist_state.tscn" id="5_tu2pi"]
|
[ext_resource type="PackedScene" uid="uid://bg7k6ovbk1xgm" path="res://game/characters/enemies/state_machine/cultist_state_machine.tscn" id="6_oqd45"]
|
||||||
[ext_resource type="Script" uid="uid://bqnq6m0s4etqh" path="res://game/characters/enemies/state_machine/fall_state.gd" id="7_7tkj8"]
|
[ext_resource type="PackedScene" uid="uid://bq1v55jv4c6qe" path="res://game/characters/enemies/state_machine/cultist_state.tscn" id="7_nsxyj"]
|
||||||
[ext_resource type="Script" uid="uid://b8o0lvuy6a5q1" path="res://game/characters/enemies/state_machine/fall_left_state.gd" id="8_2opx4"]
|
[ext_resource type="Script" uid="uid://bqnq6m0s4etqh" path="res://game/characters/enemies/state_machine/fall_state.gd" id="8_h77eg"]
|
||||||
[ext_resource type="Script" uid="uid://cxg54u14yb6go" path="res://game/characters/enemies/state_machine/fall_right_state.gd" id="9_lu83c"]
|
[ext_resource type="Script" uid="uid://b8o0lvuy6a5q1" path="res://game/characters/enemies/state_machine/fall_left_state.gd" id="9_uasba"]
|
||||||
[ext_resource type="Script" uid="uid://bfp8gywqqkju7" path="res://game/characters/enemies/state_machine/look_around_state.gd" id="10_lu83c"]
|
[ext_resource type="Script" uid="uid://cxg54u14yb6go" path="res://game/characters/enemies/state_machine/fall_right_state.gd" id="10_mye2w"]
|
||||||
[ext_resource type="Script" uid="uid://hgn4yll571hp" path="res://game/characters/enemies/state_machine/walk_left_state.gd" id="11_lh753"]
|
[ext_resource type="Script" uid="uid://bfp8gywqqkju7" path="res://game/characters/enemies/state_machine/look_around_state.gd" id="11_rqqg0"]
|
||||||
[ext_resource type="Script" uid="uid://bwwhmjxhg2adp" path="res://game/characters/enemies/state_machine/walk_right_state.gd" id="12_lh753"]
|
[ext_resource type="Script" uid="uid://hgn4yll571hp" path="res://game/characters/enemies/state_machine/walk_left_state.gd" id="12_vm7uu"]
|
||||||
[ext_resource type="Script" uid="uid://cn2lfl4kuxvjk" path="res://game/characters/enemies/state_machine/chase_left_state.gd" id="13_42ivi"]
|
[ext_resource type="Script" uid="uid://bwwhmjxhg2adp" path="res://game/characters/enemies/state_machine/walk_right_state.gd" id="13_x8b3k"]
|
||||||
[ext_resource type="Script" uid="uid://cqlym4lqahsd3" path="res://game/characters/enemies/state_machine/cultist_jump_left_state.gd" id="14_42ivi"]
|
[ext_resource type="Script" uid="uid://cn2lfl4kuxvjk" path="res://game/characters/enemies/state_machine/chase_left_state.gd" id="14_d5aal"]
|
||||||
[ext_resource type="Script" uid="uid://3kl84tu1vwiv" path="res://game/characters/enemies/state_machine/chase_right_state.gd" id="14_cqp7f"]
|
[ext_resource type="Script" uid="uid://3kl84tu1vwiv" path="res://game/characters/enemies/state_machine/chase_right_state.gd" id="15_1yxn0"]
|
||||||
[ext_resource type="Script" uid="uid://cf52bjcpasft1" path="res://game/characters/enemies/state_machine/cultist_jump_right_state.gd" id="15_cqp7f"]
|
[ext_resource type="Script" uid="uid://cqlym4lqahsd3" path="res://game/characters/enemies/state_machine/cultist_jump_left_state.gd" id="16_11eub"]
|
||||||
|
[ext_resource type="Script" uid="uid://cf52bjcpasft1" path="res://game/characters/enemies/state_machine/cultist_jump_right_state.gd" id="17_6hjcx"]
|
||||||
|
|
||||||
[sub_resource type="ViewportTexture" id="ViewportTexture_cqp7f"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_ah13v"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
shader = ExtResource("4_ul6ar")
|
||||||
|
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 = 3.0
|
||||||
|
shader_parameter/intensity = 1.0
|
||||||
|
shader_parameter/scale = 5.0
|
||||||
|
shader_parameter/seed = 0.0
|
||||||
|
shader_parameter/direction = Vector2(0, 1)
|
||||||
|
shader_parameter/use_world_pos = false
|
||||||
|
|
||||||
|
[sub_resource type="ViewportTexture" id="ViewportTexture_go1hq"]
|
||||||
viewport_path = NodePath("SubViewport")
|
viewport_path = NodePath("SubViewport")
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_mocsw"]
|
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_mocsw"]
|
||||||
@@ -28,24 +43,18 @@ height = 28.0
|
|||||||
radius = 4.0
|
radius = 4.0
|
||||||
height = 28.0
|
height = 28.0
|
||||||
|
|
||||||
[node name="AbstractCultist" type="CharacterBody2D" unique_id=1676614852]
|
[node name="Cultist" type="CharacterBody2D" unique_id=1676614852]
|
||||||
collision_layer = 0
|
collision_layer = 64
|
||||||
script = ExtResource("1_2wrno")
|
collision_mask = 33
|
||||||
|
script = ExtResource("1_ah13v")
|
||||||
|
|
||||||
[node name="WaterSplash" parent="." unique_id=658940825 instance=ExtResource("2_w1t0g")]
|
[node name="WaterSplash" parent="." unique_id=658940825 instance=ExtResource("2_go1hq")]
|
||||||
position = Vector2(0, -14)
|
position = Vector2(0, -14)
|
||||||
|
|
||||||
[node name="CultistSprite" type="Sprite2D" parent="." unique_id=797412888]
|
[node name="CultistSprite" parent="." unique_id=1997264413 instance=ExtResource("3_mbt3t")]
|
||||||
texture = SubResource("ViewportTexture_cqp7f")
|
material = SubResource("ShaderMaterial_ah13v")
|
||||||
|
position = Vector2(0, 1)
|
||||||
[node name="SubViewport" type="SubViewport" parent="." unique_id=903152885]
|
texture = SubResource("ViewportTexture_go1hq")
|
||||||
transparent_bg = true
|
|
||||||
canvas_item_default_texture_filter = 0
|
|
||||||
size = Vector2i(32, 32)
|
|
||||||
|
|
||||||
[node name="CultistSprite" parent="SubViewport" unique_id=1997264413 instance=ExtResource("2_tjvyk")]
|
|
||||||
material = null
|
|
||||||
position = Vector2(16, 16)
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=185651284]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=185651284]
|
||||||
position = Vector2(0, 2)
|
position = Vector2(0, 2)
|
||||||
@@ -56,18 +65,22 @@ position = Vector2(0, -8)
|
|||||||
|
|
||||||
[node name="LeftWallRay" type="RayCast2D" parent="WallCheckHigh" unique_id=1026693538]
|
[node name="LeftWallRay" type="RayCast2D" parent="WallCheckHigh" unique_id=1026693538]
|
||||||
target_position = Vector2(-16, 0)
|
target_position = Vector2(-16, 0)
|
||||||
|
collision_mask = 33
|
||||||
|
|
||||||
[node name="RightWallRay" type="RayCast2D" parent="WallCheckHigh" unique_id=1129233918]
|
[node name="RightWallRay" type="RayCast2D" parent="WallCheckHigh" unique_id=1129233918]
|
||||||
target_position = Vector2(16, 0)
|
target_position = Vector2(16, 0)
|
||||||
|
collision_mask = 33
|
||||||
|
|
||||||
[node name="WallCheckLow" type="Node2D" parent="." unique_id=782156094]
|
[node name="WallCheckLow" type="Node2D" parent="." unique_id=782156094]
|
||||||
position = Vector2(0, 9)
|
position = Vector2(0, 9)
|
||||||
|
|
||||||
[node name="LeftWallRay" type="RayCast2D" parent="WallCheckLow" unique_id=521416854]
|
[node name="LeftWallRay" type="RayCast2D" parent="WallCheckLow" unique_id=521416854]
|
||||||
target_position = Vector2(-16, 0)
|
target_position = Vector2(-16, 0)
|
||||||
|
collision_mask = 33
|
||||||
|
|
||||||
[node name="RightWallRay" type="RayCast2D" parent="WallCheckLow" unique_id=1457669135]
|
[node name="RightWallRay" type="RayCast2D" parent="WallCheckLow" unique_id=1457669135]
|
||||||
target_position = Vector2(16, 0)
|
target_position = Vector2(16, 0)
|
||||||
|
collision_mask = 33
|
||||||
|
|
||||||
[node name="PlayerCloseCheck" type="Node2D" parent="." unique_id=1593775088]
|
[node name="PlayerCloseCheck" type="Node2D" parent="." unique_id=1593775088]
|
||||||
position = Vector2(0, -8)
|
position = Vector2(0, -8)
|
||||||
@@ -75,12 +88,12 @@ position = Vector2(0, -8)
|
|||||||
[node name="LeftPlayerCloseRay" type="RayCast2D" parent="PlayerCloseCheck" unique_id=947570027]
|
[node name="LeftPlayerCloseRay" type="RayCast2D" parent="PlayerCloseCheck" unique_id=947570027]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
target_position = Vector2(-48, 0)
|
target_position = Vector2(-48, 0)
|
||||||
collision_mask = 0
|
collision_mask = 161
|
||||||
|
|
||||||
[node name="RightPlayerCloseRay" type="RayCast2D" parent="PlayerCloseCheck" unique_id=1559118218]
|
[node name="RightPlayerCloseRay" type="RayCast2D" parent="PlayerCloseCheck" unique_id=1559118218]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
target_position = Vector2(48, 0)
|
target_position = Vector2(48, 0)
|
||||||
collision_mask = 0
|
collision_mask = 161
|
||||||
|
|
||||||
[node name="PlayerDistantCheck" type="Node2D" parent="." unique_id=1597489123]
|
[node name="PlayerDistantCheck" type="Node2D" parent="." unique_id=1597489123]
|
||||||
position = Vector2(0, -8)
|
position = Vector2(0, -8)
|
||||||
@@ -88,43 +101,43 @@ position = Vector2(0, -8)
|
|||||||
[node name="LeftPlayerDistantRay" type="RayCast2D" parent="PlayerDistantCheck" unique_id=1491085518]
|
[node name="LeftPlayerDistantRay" type="RayCast2D" parent="PlayerDistantCheck" unique_id=1491085518]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
target_position = Vector2(-320, 0)
|
target_position = Vector2(-320, 0)
|
||||||
collision_mask = 0
|
collision_mask = 161
|
||||||
|
|
||||||
[node name="RightPlayerDistantRay" type="RayCast2D" parent="PlayerDistantCheck" unique_id=1377654831]
|
[node name="RightPlayerDistantRay" type="RayCast2D" parent="PlayerDistantCheck" unique_id=1377654831]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
target_position = Vector2(320, 0)
|
target_position = Vector2(320, 0)
|
||||||
collision_mask = 0
|
collision_mask = 161
|
||||||
|
|
||||||
[node name="KillingArea" parent="." unique_id=1891922549 instance=ExtResource("3_tjvyk")]
|
[node name="KillingArea" parent="." unique_id=1891922549 instance=ExtResource("5_500rx")]
|
||||||
collision_mask = 0
|
collision_mask = 128
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="KillingArea" unique_id=1710758452]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="KillingArea" unique_id=1710758452]
|
||||||
position = Vector2(0, 2)
|
position = Vector2(0, 2)
|
||||||
shape = SubResource("CapsuleShape2D_tjvyk")
|
shape = SubResource("CapsuleShape2D_tjvyk")
|
||||||
|
|
||||||
[node name="CultistStateMachine" parent="." unique_id=633169960 node_paths=PackedStringArray("cultist", "initial_state") instance=ExtResource("4_yu28k")]
|
[node name="CultistStateMachine" parent="." unique_id=633169960 node_paths=PackedStringArray("cultist", "initial_state") instance=ExtResource("6_oqd45")]
|
||||||
cultist = NodePath("..")
|
cultist = NodePath("..")
|
||||||
initial_state = NodePath("WalkLeftState")
|
initial_state = NodePath("LookAroundState")
|
||||||
|
|
||||||
[node name="FallState" parent="CultistStateMachine" unique_id=1764777802 node_paths=PackedStringArray("look_around_state", "cultist") instance=ExtResource("5_tu2pi")]
|
[node name="FallState" parent="CultistStateMachine" unique_id=1764777802 node_paths=PackedStringArray("look_around_state", "cultist") instance=ExtResource("7_nsxyj")]
|
||||||
script = ExtResource("7_7tkj8")
|
script = ExtResource("8_h77eg")
|
||||||
look_around_state = NodePath("../LookAroundState")
|
look_around_state = NodePath("../LookAroundState")
|
||||||
cultist = NodePath("../..")
|
cultist = NodePath("../..")
|
||||||
|
|
||||||
[node name="FallLeftState" parent="CultistStateMachine" unique_id=1011952297 node_paths=PackedStringArray("fall_state", "look_around_state", "cultist") instance=ExtResource("5_tu2pi")]
|
[node name="FallLeftState" parent="CultistStateMachine" unique_id=1011952297 node_paths=PackedStringArray("fall_state", "look_around_state", "cultist") instance=ExtResource("7_nsxyj")]
|
||||||
script = ExtResource("8_2opx4")
|
script = ExtResource("9_uasba")
|
||||||
fall_state = NodePath("../FallState")
|
fall_state = NodePath("../FallState")
|
||||||
look_around_state = NodePath("../LookAroundState")
|
look_around_state = NodePath("../LookAroundState")
|
||||||
cultist = NodePath("../..")
|
cultist = NodePath("../..")
|
||||||
|
|
||||||
[node name="FallRightState" parent="CultistStateMachine" unique_id=1932915544 node_paths=PackedStringArray("fall_state", "look_around_state", "cultist") instance=ExtResource("5_tu2pi")]
|
[node name="FallRightState" parent="CultistStateMachine" unique_id=1932915544 node_paths=PackedStringArray("fall_state", "look_around_state", "cultist") instance=ExtResource("7_nsxyj")]
|
||||||
script = ExtResource("9_lu83c")
|
script = ExtResource("10_mye2w")
|
||||||
fall_state = NodePath("../FallState")
|
fall_state = NodePath("../FallState")
|
||||||
look_around_state = NodePath("../LookAroundState")
|
look_around_state = NodePath("../LookAroundState")
|
||||||
cultist = NodePath("../..")
|
cultist = NodePath("../..")
|
||||||
|
|
||||||
[node name="LookAroundState" parent="CultistStateMachine" unique_id=2025927882 node_paths=PackedStringArray("fall_state", "walk_left_state", "walk_right_state", "chase_left_state", "chase_right_state", "cultist") instance=ExtResource("5_tu2pi")]
|
[node name="LookAroundState" parent="CultistStateMachine" unique_id=2025927882 node_paths=PackedStringArray("fall_state", "walk_left_state", "walk_right_state", "chase_left_state", "chase_right_state", "cultist") instance=ExtResource("7_nsxyj")]
|
||||||
script = ExtResource("10_lu83c")
|
script = ExtResource("11_rqqg0")
|
||||||
fall_state = NodePath("../FallState")
|
fall_state = NodePath("../FallState")
|
||||||
walk_left_state = NodePath("../WalkLeftState")
|
walk_left_state = NodePath("../WalkLeftState")
|
||||||
walk_right_state = NodePath("../WalkRightState")
|
walk_right_state = NodePath("../WalkRightState")
|
||||||
@@ -132,40 +145,40 @@ chase_left_state = NodePath("../ChaseLeftState")
|
|||||||
chase_right_state = NodePath("../ChaseRightState")
|
chase_right_state = NodePath("../ChaseRightState")
|
||||||
cultist = NodePath("../..")
|
cultist = NodePath("../..")
|
||||||
|
|
||||||
[node name="WalkLeftState" parent="CultistStateMachine" unique_id=276543931 node_paths=PackedStringArray("chase_state", "another_direction_walk_state", "fall_state", "cultist") instance=ExtResource("5_tu2pi")]
|
[node name="WalkLeftState" parent="CultistStateMachine" unique_id=276543931 node_paths=PackedStringArray("chase_state", "another_direction_walk_state", "fall_state", "cultist") instance=ExtResource("7_nsxyj")]
|
||||||
script = ExtResource("11_lh753")
|
script = ExtResource("12_vm7uu")
|
||||||
chase_state = NodePath("../ChaseLeftState")
|
chase_state = NodePath("../ChaseLeftState")
|
||||||
another_direction_walk_state = NodePath("../WalkRightState")
|
another_direction_walk_state = NodePath("../WalkRightState")
|
||||||
fall_state = NodePath("../FallLeftState")
|
fall_state = NodePath("../FallLeftState")
|
||||||
cultist = NodePath("../..")
|
cultist = NodePath("../..")
|
||||||
|
|
||||||
[node name="WalkRightState" parent="CultistStateMachine" unique_id=1671686910 node_paths=PackedStringArray("chase_state", "another_direction_walk_state", "fall_state", "cultist") instance=ExtResource("5_tu2pi")]
|
[node name="WalkRightState" parent="CultistStateMachine" unique_id=1671686910 node_paths=PackedStringArray("chase_state", "another_direction_walk_state", "fall_state", "cultist") instance=ExtResource("7_nsxyj")]
|
||||||
script = ExtResource("12_lh753")
|
script = ExtResource("13_x8b3k")
|
||||||
chase_state = NodePath("../ChaseRightState")
|
chase_state = NodePath("../ChaseRightState")
|
||||||
another_direction_walk_state = NodePath("../WalkLeftState")
|
another_direction_walk_state = NodePath("../WalkLeftState")
|
||||||
fall_state = NodePath("../FallRightState")
|
fall_state = NodePath("../FallRightState")
|
||||||
cultist = NodePath("../..")
|
cultist = NodePath("../..")
|
||||||
|
|
||||||
[node name="ChaseLeftState" parent="CultistStateMachine" unique_id=209480830 node_paths=PackedStringArray("look_around_state", "jump_state", "fall_state", "cultist") instance=ExtResource("5_tu2pi")]
|
[node name="ChaseLeftState" parent="CultistStateMachine" unique_id=209480830 node_paths=PackedStringArray("look_around_state", "jump_state", "fall_state", "cultist") instance=ExtResource("7_nsxyj")]
|
||||||
script = ExtResource("13_42ivi")
|
script = ExtResource("14_d5aal")
|
||||||
look_around_state = NodePath("../LookAroundState")
|
look_around_state = NodePath("../LookAroundState")
|
||||||
jump_state = NodePath("../JumpLeftState")
|
jump_state = NodePath("../JumpLeftState")
|
||||||
fall_state = NodePath("../FallState")
|
fall_state = NodePath("../FallState")
|
||||||
cultist = NodePath("../..")
|
cultist = NodePath("../..")
|
||||||
|
|
||||||
[node name="ChaseRightState" parent="CultistStateMachine" unique_id=383038915 node_paths=PackedStringArray("look_around_state", "jump_state", "fall_state", "cultist") instance=ExtResource("5_tu2pi")]
|
[node name="ChaseRightState" parent="CultistStateMachine" unique_id=383038915 node_paths=PackedStringArray("look_around_state", "jump_state", "fall_state", "cultist") instance=ExtResource("7_nsxyj")]
|
||||||
script = ExtResource("14_cqp7f")
|
script = ExtResource("15_1yxn0")
|
||||||
look_around_state = NodePath("../LookAroundState")
|
look_around_state = NodePath("../LookAroundState")
|
||||||
jump_state = NodePath("../JumpRightState")
|
jump_state = NodePath("../JumpRightState")
|
||||||
fall_state = NodePath("../FallState")
|
fall_state = NodePath("../FallState")
|
||||||
cultist = NodePath("../..")
|
cultist = NodePath("../..")
|
||||||
|
|
||||||
[node name="JumpLeftState" parent="CultistStateMachine" unique_id=739226464 node_paths=PackedStringArray("chase_state", "cultist") instance=ExtResource("5_tu2pi")]
|
[node name="JumpLeftState" parent="CultistStateMachine" unique_id=739226464 node_paths=PackedStringArray("chase_state", "cultist") instance=ExtResource("7_nsxyj")]
|
||||||
script = ExtResource("14_42ivi")
|
script = ExtResource("16_11eub")
|
||||||
chase_state = NodePath("../ChaseLeftState")
|
chase_state = NodePath("../ChaseLeftState")
|
||||||
cultist = NodePath("../..")
|
cultist = NodePath("../..")
|
||||||
|
|
||||||
[node name="JumpRightState" parent="CultistStateMachine" unique_id=756126836 node_paths=PackedStringArray("chase_state", "cultist") instance=ExtResource("5_tu2pi")]
|
[node name="JumpRightState" parent="CultistStateMachine" unique_id=756126836 node_paths=PackedStringArray("chase_state", "cultist") instance=ExtResource("7_nsxyj")]
|
||||||
script = ExtResource("15_cqp7f")
|
script = ExtResource("17_6hjcx")
|
||||||
chase_state = NodePath("../ChaseRightState")
|
chase_state = NodePath("../ChaseRightState")
|
||||||
cultist = NodePath("../..")
|
cultist = NodePath("../..")
|
||||||
@@ -1,7 +1,31 @@
|
|||||||
|
@tool
|
||||||
class_name CultistSprite
|
class_name CultistSprite
|
||||||
extends AnimatedSprite2D
|
extends Sprite2D
|
||||||
|
|
||||||
|
|
||||||
|
enum View {
|
||||||
|
Front,
|
||||||
|
Right,
|
||||||
|
Left,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const SHADER_SWITCH_COLORS = "shader_parameter/switch_colors"
|
||||||
|
const SHADER_INTENSITY = "shader_parameter/intensity"
|
||||||
|
const SHADER_SEED = "shader_parameter/seed"
|
||||||
|
|
||||||
|
|
||||||
|
const is_color_switched : Dictionary[Cultist.Type, bool] = {
|
||||||
|
Cultist.Type.White: false,
|
||||||
|
Cultist.Type.Black: true,
|
||||||
|
Cultist.Type.Gray: false,
|
||||||
|
}
|
||||||
|
const intensity : Dictionary[Cultist.Type, float] = {
|
||||||
|
Cultist.Type.White: 1.0,
|
||||||
|
Cultist.Type.Black: 1.0,
|
||||||
|
Cultist.Type.Gray: 0.5,
|
||||||
|
}
|
||||||
|
|
||||||
const ANIMATION_FALL = "fall"
|
const ANIMATION_FALL = "fall"
|
||||||
const ANIMATION_FALL_LEFT = "fall_left"
|
const ANIMATION_FALL_LEFT = "fall_left"
|
||||||
const ANIMATION_FALL_RIGHT = "fall_right"
|
const ANIMATION_FALL_RIGHT = "fall_right"
|
||||||
@@ -21,3 +45,41 @@ const LOOK_AROUND_ANIMATIONS : Array[String] = [
|
|||||||
ANIMATION_LOOK_AROUND_1,
|
ANIMATION_LOOK_AROUND_1,
|
||||||
ANIMATION_LOOK_AROUND_2,
|
ANIMATION_LOOK_AROUND_2,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@export var type := Cultist.Type.White:
|
||||||
|
set(value):
|
||||||
|
type = value
|
||||||
|
if is_node_ready():
|
||||||
|
_update_type()
|
||||||
|
|
||||||
|
@export var view := View.Front:
|
||||||
|
set(value):
|
||||||
|
view = value
|
||||||
|
if is_node_ready():
|
||||||
|
_update_view()
|
||||||
|
|
||||||
|
|
||||||
|
@onready var animated_sprite : AnimatedSprite2D = $SubViewport/AnimatedSprite2D
|
||||||
|
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
_update_type()
|
||||||
|
_update_view()
|
||||||
|
if not Engine.is_editor_hint():
|
||||||
|
material.set(SHADER_SEED, randf())
|
||||||
|
|
||||||
|
|
||||||
|
func _update_type() -> void:
|
||||||
|
material.set(SHADER_INTENSITY, intensity[type])
|
||||||
|
material.set(SHADER_SWITCH_COLORS, is_color_switched[type])
|
||||||
|
|
||||||
|
|
||||||
|
func _update_view() -> void:
|
||||||
|
match view:
|
||||||
|
View.Front:
|
||||||
|
animated_sprite.animation = ANIMATION_IDLE
|
||||||
|
View.Left:
|
||||||
|
animated_sprite.animation = ANIMATION_WALK_LEFT
|
||||||
|
View.Right:
|
||||||
|
animated_sprite.animation = ANIMATION_WALK_RIGHT
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
uid://dkxmwkjttbf2d
|
uid://bmk0r5ovfi60u
|
||||||
|
|||||||
@@ -1,18 +1,11 @@
|
|||||||
[gd_scene format=3 uid="uid://dtxiercm8dsfm"]
|
[gd_scene format=3 uid="uid://dtxiercm8dsfm"]
|
||||||
|
|
||||||
[ext_resource type="Shader" uid="uid://lqq1mg6l1qqe" path="res://game/shaders/black_n_white.gdshader" id="1_ew6gn"]
|
[ext_resource type="Material" uid="uid://dwgqr50guokxg" path="res://game/materials/cultist.tres" id="1_1pedr"]
|
||||||
|
[ext_resource type="Script" uid="uid://bmk0r5ovfi60u" path="res://game/characters/enemies/cultist_sprite.gd" id="2_ew6gn"]
|
||||||
[ext_resource type="Texture2D" uid="uid://drk8j57acajrq" path="res://images/characters/cultist.png" id="2_g4n4l"]
|
[ext_resource type="Texture2D" uid="uid://drk8j57acajrq" path="res://images/characters/cultist.png" id="2_g4n4l"]
|
||||||
[ext_resource type="Script" uid="uid://dkxmwkjttbf2d" path="res://game/characters/enemies/cultist_sprite.gd" id="3_ef0vi"]
|
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_vecdo"]
|
[sub_resource type="ViewportTexture" id="ViewportTexture_bhunq"]
|
||||||
shader = ExtResource("1_ew6gn")
|
viewport_path = NodePath("SubViewport")
|
||||||
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_l58xb"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_l58xb"]
|
||||||
atlas = ExtResource("2_g4n4l")
|
atlas = ExtResource("2_g4n4l")
|
||||||
@@ -177,7 +170,7 @@ animations = [{
|
|||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_x6npu")
|
"texture": SubResource("AtlasTexture_x6npu")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": 1,
|
||||||
"name": &"chase_left",
|
"name": &"chase_left",
|
||||||
"speed": 20.0
|
"speed": 20.0
|
||||||
}, {
|
}, {
|
||||||
@@ -206,7 +199,7 @@ animations = [{
|
|||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_0xs27")
|
"texture": SubResource("AtlasTexture_0xs27")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": 1,
|
||||||
"name": &"chase_right",
|
"name": &"chase_right",
|
||||||
"speed": 20.0
|
"speed": 20.0
|
||||||
}, {
|
}, {
|
||||||
@@ -214,7 +207,7 @@ animations = [{
|
|||||||
"duration": 10.0,
|
"duration": 10.0,
|
||||||
"texture": SubResource("AtlasTexture_tjvyk")
|
"texture": SubResource("AtlasTexture_tjvyk")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": 1,
|
||||||
"name": &"fall",
|
"name": &"fall",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
@@ -222,7 +215,7 @@ animations = [{
|
|||||||
"duration": 5.0,
|
"duration": 5.0,
|
||||||
"texture": SubResource("AtlasTexture_vecdo")
|
"texture": SubResource("AtlasTexture_vecdo")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": 1,
|
||||||
"name": &"fall_left",
|
"name": &"fall_left",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
@@ -230,7 +223,7 @@ animations = [{
|
|||||||
"duration": 5.0,
|
"duration": 5.0,
|
||||||
"texture": SubResource("AtlasTexture_qly8p")
|
"texture": SubResource("AtlasTexture_qly8p")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": 1,
|
||||||
"name": &"fall_right",
|
"name": &"fall_right",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
@@ -244,7 +237,7 @@ animations = [{
|
|||||||
"duration": 5.0,
|
"duration": 5.0,
|
||||||
"texture": SubResource("AtlasTexture_ijx3p")
|
"texture": SubResource("AtlasTexture_ijx3p")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": 1,
|
||||||
"name": &"idle",
|
"name": &"idle",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
@@ -252,7 +245,7 @@ animations = [{
|
|||||||
"duration": 5.0,
|
"duration": 5.0,
|
||||||
"texture": SubResource("AtlasTexture_klrad")
|
"texture": SubResource("AtlasTexture_klrad")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": 1,
|
||||||
"name": &"jump",
|
"name": &"jump",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
@@ -260,7 +253,7 @@ animations = [{
|
|||||||
"duration": 5.0,
|
"duration": 5.0,
|
||||||
"texture": SubResource("AtlasTexture_rjy0i")
|
"texture": SubResource("AtlasTexture_rjy0i")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": 1,
|
||||||
"name": &"jump_left",
|
"name": &"jump_left",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
@@ -268,7 +261,7 @@ animations = [{
|
|||||||
"duration": 5.0,
|
"duration": 5.0,
|
||||||
"texture": SubResource("AtlasTexture_ps2ar")
|
"texture": SubResource("AtlasTexture_ps2ar")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": 1,
|
||||||
"name": &"jump_right",
|
"name": &"jump_right",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
@@ -285,7 +278,7 @@ animations = [{
|
|||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_soo8x")
|
"texture": SubResource("AtlasTexture_soo8x")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": 1,
|
||||||
"name": &"look_around",
|
"name": &"look_around",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
@@ -305,7 +298,7 @@ animations = [{
|
|||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_vbirv")
|
"texture": SubResource("AtlasTexture_vbirv")
|
||||||
}],
|
}],
|
||||||
"loop": false,
|
"loop": 0,
|
||||||
"name": &"look_around_1",
|
"name": &"look_around_1",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
@@ -325,7 +318,7 @@ animations = [{
|
|||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_hrljr")
|
"texture": SubResource("AtlasTexture_hrljr")
|
||||||
}],
|
}],
|
||||||
"loop": false,
|
"loop": 0,
|
||||||
"name": &"look_around_2",
|
"name": &"look_around_2",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
@@ -354,7 +347,7 @@ animations = [{
|
|||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_x6npu")
|
"texture": SubResource("AtlasTexture_x6npu")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": 1,
|
||||||
"name": &"walk_left",
|
"name": &"walk_left",
|
||||||
"speed": 10.0
|
"speed": 10.0
|
||||||
}, {
|
}, {
|
||||||
@@ -383,13 +376,21 @@ animations = [{
|
|||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_0xs27")
|
"texture": SubResource("AtlasTexture_0xs27")
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": 1,
|
||||||
"name": &"walk_right",
|
"name": &"walk_right",
|
||||||
"speed": 10.0
|
"speed": 10.0
|
||||||
}]
|
}]
|
||||||
|
|
||||||
[node name="CultistSprite" type="AnimatedSprite2D" unique_id=351120861]
|
[node name="CultistSprite" type="Sprite2D" unique_id=1870874123]
|
||||||
material = SubResource("ShaderMaterial_vecdo")
|
material = ExtResource("1_1pedr")
|
||||||
|
texture = SubResource("ViewportTexture_bhunq")
|
||||||
|
script = ExtResource("2_ew6gn")
|
||||||
|
|
||||||
|
[node name="SubViewport" type="SubViewport" parent="." unique_id=1722886587]
|
||||||
|
transparent_bg = true
|
||||||
|
size = Vector2i(32, 32)
|
||||||
|
|
||||||
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="SubViewport" unique_id=1233349440]
|
||||||
|
position = Vector2(16, 16)
|
||||||
sprite_frames = SubResource("SpriteFrames_2wrno")
|
sprite_frames = SubResource("SpriteFrames_2wrno")
|
||||||
animation = &"idle"
|
animation = &"idle"
|
||||||
script = ExtResource("3_ef0vi")
|
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
class_name GrayCultist
|
|
||||||
extends AbstractCultist
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://cern5veiqkrkc
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
[gd_scene format=3 uid="uid://cb0w6mt8g4mer"]
|
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bx0luh4vdob3q" path="res://game/characters/enemies/abstract_cultist.tscn" id="1_q3s46"]
|
|
||||||
[ext_resource type="Script" uid="uid://cern5veiqkrkc" path="res://game/characters/enemies/gray_cultist.gd" id="2_olede"]
|
|
||||||
[ext_resource type="Material" uid="uid://dbkn3k0batj5w" path="res://game/materials/enemy_gray.tres" id="3_ho47d"]
|
|
||||||
|
|
||||||
[sub_resource type="ViewportTexture" id="ViewportTexture_b3gyl"]
|
|
||||||
viewport_path = NodePath("SubViewport")
|
|
||||||
|
|
||||||
[node name="GrayCultist" unique_id=139812221 instance=ExtResource("1_q3s46")]
|
|
||||||
collision_layer = 16
|
|
||||||
collision_mask = 35
|
|
||||||
script = ExtResource("2_olede")
|
|
||||||
|
|
||||||
[node name="CultistSprite" parent="." index="0" unique_id=797412888]
|
|
||||||
material = ExtResource("3_ho47d")
|
|
||||||
texture = SubResource("ViewportTexture_b3gyl")
|
|
||||||
|
|
||||||
[node name="LeftWallRay" parent="WallCheckLow" parent_id_path=PackedInt32Array(782156094) index="0" unique_id=521416854]
|
|
||||||
collision_mask = 35
|
|
||||||
|
|
||||||
[node name="RightWallRay" parent="WallCheckLow" parent_id_path=PackedInt32Array(782156094) index="1" unique_id=1457669135]
|
|
||||||
collision_mask = 35
|
|
||||||
|
|
||||||
[node name="LeftPlayerCloseRay" parent="PlayerCloseCheck" parent_id_path=PackedInt32Array(1593775088) index="0" unique_id=947570027]
|
|
||||||
collision_mask = 171
|
|
||||||
|
|
||||||
[node name="RightPlayerCloseRay" parent="PlayerCloseCheck" parent_id_path=PackedInt32Array(1593775088) index="1" unique_id=1559118218]
|
|
||||||
collision_mask = 171
|
|
||||||
|
|
||||||
[node name="LeftPlayerDistantRay" parent="PlayerDistantCheck" parent_id_path=PackedInt32Array(1597489123) index="0" unique_id=1491085518]
|
|
||||||
collision_mask = 171
|
|
||||||
|
|
||||||
[node name="RightPlayerDistantRay" parent="PlayerDistantCheck" parent_id_path=PackedInt32Array(1597489123) index="1" unique_id=1377654831]
|
|
||||||
collision_mask = 171
|
|
||||||
|
|
||||||
[node name="KillingArea" parent="." index="7" unique_id=1891922549]
|
|
||||||
collision_mask = 136
|
|
||||||
@@ -6,7 +6,7 @@ const DIRECTION_LEFT = -1
|
|||||||
const DIRECTION_RIGHT = 1
|
const DIRECTION_RIGHT = 1
|
||||||
|
|
||||||
|
|
||||||
@export var cultist: AbstractCultist
|
@export var cultist: Cultist
|
||||||
|
|
||||||
|
|
||||||
func _get_colliding_player(ray_cast: RayCast2D) -> Player:
|
func _get_colliding_player(ray_cast: RayCast2D) -> Player:
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ class_name CultistStateMachine
|
|||||||
extends StateMachine
|
extends StateMachine
|
||||||
|
|
||||||
|
|
||||||
@export var cultist: AbstractCultist
|
@export var cultist: Cultist
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
class_name WhiteCultist
|
|
||||||
extends AbstractColorCultist
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
uid://dmcpkytgiuedi
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
[gd_scene format=3 uid="uid://bv2gahb4wxgb1"]
|
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://d37eyum03h83i" path="res://game/characters/enemies/abstract_color_cultist.tscn" id="1_3yi7g"]
|
|
||||||
[ext_resource type="Script" uid="uid://dmcpkytgiuedi" path="res://game/characters/enemies/white_cultist.gd" id="2_c7pdf"]
|
|
||||||
[ext_resource type="Material" uid="uid://ci7xuso12af5" path="res://game/materials/enemy_white.tres" id="3_36f86"]
|
|
||||||
|
|
||||||
[sub_resource type="ViewportTexture" id="ViewportTexture_fb5t4"]
|
|
||||||
viewport_path = NodePath("SubViewport")
|
|
||||||
|
|
||||||
[node name="WhiteEnemy" unique_id=486389199 instance=ExtResource("1_3yi7g")]
|
|
||||||
collision_layer = 64
|
|
||||||
collision_mask = 33
|
|
||||||
script = ExtResource("2_c7pdf")
|
|
||||||
|
|
||||||
[node name="CultistSprite" parent="." index="0" unique_id=797412888]
|
|
||||||
material = ExtResource("3_36f86")
|
|
||||||
texture = SubResource("ViewportTexture_fb5t4")
|
|
||||||
|
|
||||||
[node name="LeftWallRay" parent="WallCheckLow" parent_id_path=PackedInt32Array(782156094) index="0" unique_id=521416854]
|
|
||||||
collision_mask = 33
|
|
||||||
|
|
||||||
[node name="RightWallRay" parent="WallCheckLow" parent_id_path=PackedInt32Array(782156094) index="1" unique_id=1457669135]
|
|
||||||
collision_mask = 33
|
|
||||||
|
|
||||||
[node name="LeftPlayerCloseRay" parent="PlayerCloseCheck" parent_id_path=PackedInt32Array(1593775088) index="0" unique_id=947570027]
|
|
||||||
target_position = Vector2(-32, 0)
|
|
||||||
collision_mask = 161
|
|
||||||
|
|
||||||
[node name="RightPlayerCloseRay" parent="PlayerCloseCheck" parent_id_path=PackedInt32Array(1593775088) index="1" unique_id=1559118218]
|
|
||||||
target_position = Vector2(32, 0)
|
|
||||||
collision_mask = 161
|
|
||||||
|
|
||||||
[node name="LeftPlayerDistantRay" parent="PlayerDistantCheck" parent_id_path=PackedInt32Array(1597489123) index="0" unique_id=1491085518]
|
|
||||||
collision_mask = 161
|
|
||||||
|
|
||||||
[node name="RightPlayerDistantRay" parent="PlayerDistantCheck" parent_id_path=PackedInt32Array(1597489123) index="1" unique_id=1377654831]
|
|
||||||
collision_mask = 161
|
|
||||||
|
|
||||||
[node name="KillingArea" parent="." index="8" unique_id=1891922549]
|
|
||||||
collision_mask = 128
|
|
||||||
@@ -5,6 +5,7 @@ extends Area2D
|
|||||||
enum Type {
|
enum Type {
|
||||||
None,
|
None,
|
||||||
Water,
|
Water,
|
||||||
|
Cultist,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+19
-10
@@ -21,8 +21,7 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://d330w1ygg6uxy" path="res://game/objects/decorative/painting_v_l.tscn" id="19_l40pv"]
|
[ext_resource type="PackedScene" uid="uid://d330w1ygg6uxy" path="res://game/objects/decorative/painting_v_l.tscn" id="19_l40pv"]
|
||||||
[ext_resource type="PackedScene" uid="uid://ciubf1ttwc133" path="res://game/pickups/square_key_pickup.tscn" id="20_uffr2"]
|
[ext_resource type="PackedScene" uid="uid://ciubf1ttwc133" path="res://game/pickups/square_key_pickup.tscn" id="20_uffr2"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dqgmfpv2mhdpn" path="res://game/pickups/triangle_key_pickup.tscn" id="21_jk2b3"]
|
[ext_resource type="PackedScene" uid="uid://dqgmfpv2mhdpn" path="res://game/pickups/triangle_key_pickup.tscn" id="21_jk2b3"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cutjutvd8dqqc" path="res://game/characters/enemies/black_cultist.tscn" id="22_b1xny"]
|
[ext_resource type="PackedScene" uid="uid://bx0luh4vdob3q" path="res://game/characters/enemies/cultist.tscn" id="22_3svqx"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bv2gahb4wxgb1" path="res://game/characters/enemies/white_cultist.tscn" id="23_8555i"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://dike8xgbqdut2" path="res://game/killing_area.tscn" id="24_te27h"]
|
[ext_resource type="PackedScene" uid="uid://dike8xgbqdut2" path="res://game/killing_area.tscn" id="24_te27h"]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cjy8w"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cjy8w"]
|
||||||
@@ -315,17 +314,27 @@ position = Vector2(1113, 344)
|
|||||||
[node name="TriangleKeyPickup" parent="Pickups" parent_id_path=PackedInt32Array(1113969064) index="1" unique_id=85412946 instance=ExtResource("21_jk2b3")]
|
[node name="TriangleKeyPickup" parent="Pickups" parent_id_path=PackedInt32Array(1113969064) index="1" unique_id=85412946 instance=ExtResource("21_jk2b3")]
|
||||||
position = Vector2(857, 136)
|
position = Vector2(857, 136)
|
||||||
|
|
||||||
[node name="BlackCultist1" parent="Enemies" parent_id_path=PackedInt32Array(857989772) index="0" unique_id=129671926 instance=ExtResource("22_b1xny")]
|
[node name="Cultist1" parent="Enemies" parent_id_path=PackedInt32Array(857989772) index="0" unique_id=1676614852 instance=ExtResource("22_3svqx")]
|
||||||
position = Vector2(1041, 352)
|
|
||||||
|
|
||||||
[node name="BlackCultist2" parent="Enemies" parent_id_path=PackedInt32Array(857989772) index="1" unique_id=1222909487 instance=ExtResource("22_b1xny")]
|
|
||||||
position = Vector2(403, 160)
|
|
||||||
|
|
||||||
[node name="WhiteCultist1" parent="Enemies" parent_id_path=PackedInt32Array(857989772) index="2" unique_id=503464276 instance=ExtResource("23_8555i")]
|
|
||||||
position = Vector2(587, 368)
|
position = Vector2(587, 368)
|
||||||
|
collision_layer = 64
|
||||||
|
collision_mask = 33
|
||||||
|
|
||||||
[node name="WhiteCultist2" parent="Enemies" parent_id_path=PackedInt32Array(857989772) index="3" unique_id=624398972 instance=ExtResource("23_8555i")]
|
[node name="Cultist2" parent="Enemies" parent_id_path=PackedInt32Array(857989772) index="1" unique_id=102912907 instance=ExtResource("22_3svqx")]
|
||||||
|
position = Vector2(1041, 352)
|
||||||
|
collision_layer = 4
|
||||||
|
collision_mask = 3
|
||||||
|
type = 1
|
||||||
|
|
||||||
|
[node name="Cultist3" parent="Enemies" parent_id_path=PackedInt32Array(857989772) index="2" unique_id=996992141 instance=ExtResource("22_3svqx")]
|
||||||
|
position = Vector2(403, 160)
|
||||||
|
collision_layer = 4
|
||||||
|
collision_mask = 3
|
||||||
|
type = 1
|
||||||
|
|
||||||
|
[node name="Cultist4" parent="Enemies" parent_id_path=PackedInt32Array(857989772) index="3" unique_id=422993920 instance=ExtResource("22_3svqx")]
|
||||||
position = Vector2(549, 160)
|
position = Vector2(549, 160)
|
||||||
|
collision_layer = 64
|
||||||
|
collision_mask = 33
|
||||||
|
|
||||||
[node name="Player" parent="." index="6" unique_id=1058744997]
|
[node name="Player" parent="." index="6" unique_id=1058744997]
|
||||||
position = Vector2(208, -162)
|
position = Vector2(208, -162)
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ const ANIMATION_NAME = "final_cutscene"
|
|||||||
|
|
||||||
@onready var animation_player : AnimationPlayer = $AnimationPlayer
|
@onready var animation_player : AnimationPlayer = $AnimationPlayer
|
||||||
@onready var fake_player : PlayerSprite = $Cutscene/FakePlayer
|
@onready var fake_player : PlayerSprite = $Cutscene/FakePlayer
|
||||||
|
@onready var fake_cultist : CultistSprite = $Cutscene/FakeCultist
|
||||||
@onready var cutscene_camera : Camera2D = $Cutscene/Camera2D
|
@onready var cutscene_camera : Camera2D = $Cutscene/Camera2D
|
||||||
|
|
||||||
@onready var cutscene_room_center : Vector2 = $Cutscene/RoomCenter.position
|
@onready var cutscene_room_center : Vector2 = $Cutscene/RoomCenter.position
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
$CanvasLayer/MarginContainer/ThanksLabel.hide()
|
||||||
animation_player.play("hide_cutscene_elements")
|
animation_player.play("hide_cutscene_elements")
|
||||||
super._ready()
|
super._ready()
|
||||||
|
|
||||||
@@ -42,6 +44,15 @@ func _play_cutscene_boop() -> void:
|
|||||||
SoundManager.play_sfx_stream(SoundManager.sfx_stream_haze, cutscene_room_center)
|
SoundManager.play_sfx_stream(SoundManager.sfx_stream_haze, cutscene_room_center)
|
||||||
|
|
||||||
|
|
||||||
|
func _play_fake_cultist_animation() -> void:
|
||||||
|
fake_cultist.animated_sprite.play(CultistSprite.ANIMATION_LOOK_AROUND, 0.5)
|
||||||
|
|
||||||
|
|
||||||
|
func _make_fake_cultist_grey() -> void:
|
||||||
|
var tween := create_tween()
|
||||||
|
tween.tween_property(fake_cultist.material, CultistSprite.SHADER_INTENSITY, 0.5, 5)
|
||||||
|
|
||||||
|
|
||||||
func _on_animation_player_animation_finished(anim_name: StringName) -> void:
|
func _on_animation_player_animation_finished(anim_name: StringName) -> void:
|
||||||
if anim_name == "final_cutscene":
|
if anim_name == "final_cutscene":
|
||||||
_complete_level(cutscene_room_center)
|
_complete_level(cutscene_room_center)
|
||||||
|
|||||||
+561
-100
File diff suppressed because one or more lines are too long
+20
-14
@@ -23,18 +23,16 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://b0pxe00dlyx7t" path="res://game/objects/informative/switch_action_tip.tscn" id="12_r01v2"]
|
[ext_resource type="PackedScene" uid="uid://b0pxe00dlyx7t" path="res://game/objects/informative/switch_action_tip.tscn" id="12_r01v2"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dsww084wps0d0" path="res://game/objects/interactive/lever.tscn" id="13_00l78"]
|
[ext_resource type="PackedScene" uid="uid://dsww084wps0d0" path="res://game/objects/interactive/lever.tscn" id="13_00l78"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dx1yasi8wlaye" path="res://game/objects/decorative/bookstand.tscn" id="13_g3b4m"]
|
[ext_resource type="PackedScene" uid="uid://dx1yasi8wlaye" path="res://game/objects/decorative/bookstand.tscn" id="13_g3b4m"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cb0w6mt8g4mer" path="res://game/characters/enemies/gray_cultist.tscn" id="18_blgb8"]
|
[ext_resource type="PackedScene" uid="uid://bx0luh4vdob3q" path="res://game/characters/enemies/cultist.tscn" id="27_te8eb"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cutjutvd8dqqc" path="res://game/characters/enemies/black_cultist.tscn" id="19_ohfy3"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bv2gahb4wxgb1" path="res://game/characters/enemies/white_cultist.tscn" id="20_rt0xo"]
|
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_lxcjr"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_h1708"]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
shader = ExtResource("4_lxcjr")
|
shader = ExtResource("4_lxcjr")
|
||||||
shader_parameter/glow_interval = 1.0
|
shader_parameter/glow_interval = 1.0
|
||||||
shader_parameter/glow_radius = 1.0
|
shader_parameter/glow_radius = 1.0
|
||||||
shader_parameter/travel_time = 5.0
|
shader_parameter/travel_time = 5.0
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_te8eb"]
|
[sub_resource type="ShaderMaterial" id="ShaderMaterial_a50fq"]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
shader = ExtResource("4_lxcjr")
|
shader = ExtResource("4_lxcjr")
|
||||||
shader_parameter/glow_interval = 1.0
|
shader_parameter/glow_interval = 1.0
|
||||||
@@ -51,12 +49,12 @@ point_count = 2
|
|||||||
script = ExtResource("2_a2sw7")
|
script = ExtResource("2_a2sw7")
|
||||||
|
|
||||||
[node name="ConnectionCableDoor" parent="ConnectionCables" parent_id_path=PackedInt32Array(279521385) index="0" unique_id=1234500644 instance=ExtResource("3_a50fq")]
|
[node name="ConnectionCableDoor" parent="ConnectionCables" parent_id_path=PackedInt32Array(279521385) index="0" unique_id=1234500644 instance=ExtResource("3_a50fq")]
|
||||||
material = SubResource("ShaderMaterial_lxcjr")
|
material = SubResource("ShaderMaterial_h1708")
|
||||||
position = Vector2(208, 13)
|
position = Vector2(208, 13)
|
||||||
points = PackedVector2Array(0, 0, 92, 0, 92, -49, 199, -49)
|
points = PackedVector2Array(0, 0, 92, 0, 92, -49, 199, -49)
|
||||||
|
|
||||||
[node name="ConnectionCablePlatform" parent="ConnectionCables" parent_id_path=PackedInt32Array(279521385) index="1" unique_id=561577961 instance=ExtResource("3_a50fq")]
|
[node name="ConnectionCablePlatform" parent="ConnectionCables" parent_id_path=PackedInt32Array(279521385) index="1" unique_id=561577961 instance=ExtResource("3_a50fq")]
|
||||||
material = SubResource("ShaderMaterial_te8eb")
|
material = SubResource("ShaderMaterial_a50fq")
|
||||||
position = Vector2(520, -35)
|
position = Vector2(520, -35)
|
||||||
points = PackedVector2Array(0, 0, 0, -76, -454, -76, -454, 3)
|
points = PackedVector2Array(0, 0, 0, -76, -454, -76, -454, 3)
|
||||||
|
|
||||||
@@ -142,14 +140,22 @@ position = Vector2(306, -56)
|
|||||||
[node name="TriangleKeyPickup" parent="Pickups" parent_id_path=PackedInt32Array(1113969064) index="3" unique_id=465768166 instance=ExtResource("10_dea75")]
|
[node name="TriangleKeyPickup" parent="Pickups" parent_id_path=PackedInt32Array(1113969064) index="3" unique_id=465768166 instance=ExtResource("10_dea75")]
|
||||||
position = Vector2(803, -56)
|
position = Vector2(803, -56)
|
||||||
|
|
||||||
[node name="GrayEnemy" parent="Enemies" parent_id_path=PackedInt32Array(857989772) index="0" unique_id=2016246874 instance=ExtResource("18_blgb8")]
|
[node name="Cultist1" parent="Enemies" parent_id_path=PackedInt32Array(857989772) index="0" unique_id=1676614852 instance=ExtResource("27_te8eb")]
|
||||||
position = Vector2(1552, 96)
|
|
||||||
|
|
||||||
[node name="BlackEnemy" parent="Enemies" parent_id_path=PackedInt32Array(857989772) index="1" unique_id=1849216089 instance=ExtResource("19_ohfy3")]
|
|
||||||
position = Vector2(936, -48)
|
|
||||||
|
|
||||||
[node name="WhiteEnemy" parent="Enemies" parent_id_path=PackedInt32Array(857989772) index="2" unique_id=1447247338 instance=ExtResource("20_rt0xo")]
|
|
||||||
position = Vector2(743, -48)
|
position = Vector2(743, -48)
|
||||||
|
collision_layer = 64
|
||||||
|
collision_mask = 33
|
||||||
|
|
||||||
|
[node name="Cultist2" parent="Enemies" parent_id_path=PackedInt32Array(857989772) index="1" unique_id=1025404981 instance=ExtResource("27_te8eb")]
|
||||||
|
position = Vector2(936, -48)
|
||||||
|
collision_layer = 4
|
||||||
|
collision_mask = 3
|
||||||
|
type = 1
|
||||||
|
|
||||||
|
[node name="Cultist3" parent="Enemies" parent_id_path=PackedInt32Array(857989772) index="2" unique_id=1444846763 instance=ExtResource("27_te8eb")]
|
||||||
|
position = Vector2(1552, 96)
|
||||||
|
collision_layer = 16
|
||||||
|
collision_mask = 35
|
||||||
|
type = 2
|
||||||
|
|
||||||
[node name="Player" parent="." index="6" unique_id=1058744997]
|
[node name="Player" parent="." index="6" unique_id=1058744997]
|
||||||
position = Vector2(-13, 0)
|
position = Vector2(-13, 0)
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
[gd_resource type="ShaderMaterial" format=3 uid="uid://ci7xuso12af5"]
|
[gd_resource type="ShaderMaterial" format=3 uid="uid://dwgqr50guokxg"]
|
||||||
|
|
||||||
[ext_resource type="Shader" uid="uid://lqq1mg6l1qqe" path="res://game/shaders/black_n_white.gdshader" id="1_xngo8"]
|
[ext_resource type="Shader" uid="uid://lqq1mg6l1qqe" path="res://game/shaders/black_n_white.gdshader" id="1_3bx4l"]
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
resource_local_to_scene = true
|
resource_local_to_scene = true
|
||||||
shader = ExtResource("1_xngo8")
|
shader = ExtResource("1_3bx4l")
|
||||||
shader_parameter/black_color = Color(0, 0, 0, 1)
|
shader_parameter/black_color = Color(0, 0, 0, 1)
|
||||||
shader_parameter/white_color = Color(1, 1, 1, 1)
|
shader_parameter/white_color = Color(1, 1, 1, 1)
|
||||||
shader_parameter/switch_colors = false
|
shader_parameter/switch_colors = false
|
||||||
shader_parameter/threshold = 0.5
|
shader_parameter/threshold = 0.5
|
||||||
shader_parameter/speed = 3.0
|
shader_parameter/speed = 3.0000001425
|
||||||
shader_parameter/intensity = 1.0
|
shader_parameter/intensity = 1.0
|
||||||
shader_parameter/scale = 5.0
|
shader_parameter/scale = 5.0
|
||||||
|
shader_parameter/seed = 0.0
|
||||||
|
shader_parameter/direction = Vector2(0, 1)
|
||||||
shader_parameter/use_world_pos = false
|
shader_parameter/use_world_pos = false
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
[gd_resource type="ShaderMaterial" format=3 uid="uid://dggr8t4b30e3n"]
|
|
||||||
|
|
||||||
[ext_resource type="Shader" uid="uid://lqq1mg6l1qqe" path="res://game/shaders/black_n_white.gdshader" id="1_61jua"]
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
resource_local_to_scene = true
|
|
||||||
shader = ExtResource("1_61jua")
|
|
||||||
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 = 3.0
|
|
||||||
shader_parameter/intensity = 1.0
|
|
||||||
shader_parameter/scale = 5.0
|
|
||||||
shader_parameter/use_world_pos = false
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[gd_resource type="ShaderMaterial" format=3 uid="uid://dbkn3k0batj5w"]
|
|
||||||
|
|
||||||
[ext_resource type="Shader" uid="uid://lqq1mg6l1qqe" path="res://game/shaders/black_n_white.gdshader" id="1_b0yyf"]
|
|
||||||
|
|
||||||
[resource]
|
|
||||||
shader = ExtResource("1_b0yyf")
|
|
||||||
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 = 3.0
|
|
||||||
shader_parameter/intensity = 0.5
|
|
||||||
shader_parameter/scale = 5.0
|
|
||||||
shader_parameter/use_world_pos = false
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
shader = ExtResource("1_p23e2")
|
shader = ExtResource("1_p23e2")
|
||||||
shader_parameter/black_color = Color(0, 0, 0, 1)
|
shader_parameter/black_color = Color(0, 0, 0, 1)
|
||||||
shader_parameter/white_color = Color(1, 1, 1, 1)
|
shader_parameter/white_color = Color(1, 1, 1, 1)
|
||||||
shader_parameter/switch_colors = false
|
shader_parameter/switch_colors = true
|
||||||
shader_parameter/threshold = 0.5
|
shader_parameter/threshold = 0.5
|
||||||
shader_parameter/speed = 1.0
|
shader_parameter/speed = 1.0
|
||||||
shader_parameter/intensity = 1.0
|
shader_parameter/intensity = 1.0
|
||||||
|
|||||||
@@ -9,12 +9,14 @@ uniform float threshold : hint_range(0.0, 1.0) = 0.5;
|
|||||||
uniform float speed : hint_range(0.0, 10.0) = 0.5;
|
uniform float speed : hint_range(0.0, 10.0) = 0.5;
|
||||||
uniform float intensity : hint_range(0.0, 1.0) = 1.0;
|
uniform float intensity : hint_range(0.0, 1.0) = 1.0;
|
||||||
uniform float scale : hint_range(0.0, 100.0) = 20.0;
|
uniform float scale : hint_range(0.0, 100.0) = 20.0;
|
||||||
|
uniform float seed : hint_range(0.0, 1.0) = 0.0;
|
||||||
|
uniform vec2 direction = vec2(1.0, 1.0);
|
||||||
uniform bool use_world_pos = false;
|
uniform bool use_world_pos = false;
|
||||||
|
|
||||||
vec2 random(vec2 uv){
|
vec2 random(vec2 uv){
|
||||||
uv = vec2( dot(uv, vec2(127.1,311.7) ),
|
uv = vec2( dot(uv, vec2(127.1,311.7) ),
|
||||||
dot(uv, vec2(269.5,183.3) ) );
|
dot(uv, vec2(269.5,183.3) ) );
|
||||||
return -1.0 + 2.0 * fract(sin(uv) * 43758.5453123);
|
return -1.0 + 2.0 * fract((sin(uv) + seed) * 43758.5453123);
|
||||||
}
|
}
|
||||||
|
|
||||||
float noise(vec2 uv) {
|
float noise(vec2 uv) {
|
||||||
@@ -47,7 +49,7 @@ void fragment() {
|
|||||||
is_black = !is_black;
|
is_black = !is_black;
|
||||||
}
|
}
|
||||||
if (intensity < 1.0) {
|
if (intensity < 1.0) {
|
||||||
vec2 coord = noise_uv * scale + TIME * speed;
|
vec2 coord = noise_uv * scale + TIME * speed * normalize(direction);
|
||||||
|
|
||||||
if (noise(coord) > intensity) {
|
if (noise(coord) > intensity) {
|
||||||
is_black = !is_black;
|
is_black = !is_black;
|
||||||
|
|||||||
Reference in New Issue
Block a user