Disabled switching on the first level. Added switch particles. Fixed enemy sprite
This commit is contained in:
@@ -37,11 +37,11 @@ texture = SubResource("ViewportTexture_cqp7f")
|
|||||||
[node name="SubViewport" type="SubViewport" parent="." unique_id=903152885]
|
[node name="SubViewport" type="SubViewport" parent="." unique_id=903152885]
|
||||||
transparent_bg = true
|
transparent_bg = true
|
||||||
canvas_item_default_texture_filter = 0
|
canvas_item_default_texture_filter = 0
|
||||||
size = Vector2i(16, 32)
|
size = Vector2i(32, 32)
|
||||||
|
|
||||||
[node name="CultistSprite" parent="SubViewport" unique_id=1997264413 instance=ExtResource("2_tjvyk")]
|
[node name="CultistSprite" parent="SubViewport" unique_id=1997264413 instance=ExtResource("2_tjvyk")]
|
||||||
material = null
|
material = null
|
||||||
position = Vector2(8, 16)
|
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)
|
||||||
|
|||||||
@@ -18,12 +18,14 @@ const PICKUP_OFFSET = 16.0
|
|||||||
@export_range(0.0, 1.0) var passive_jump_factor := 0.5
|
@export_range(0.0, 1.0) var passive_jump_factor := 0.5
|
||||||
|
|
||||||
|
|
||||||
|
var can_switch_color: bool = true
|
||||||
var is_dead := false
|
var is_dead := false
|
||||||
var _is_switching_needed := false
|
var _is_switching_needed := false
|
||||||
|
|
||||||
|
|
||||||
@onready var camera : Camera2D = $Camera2D
|
@onready var camera : Camera2D = $Camera2D
|
||||||
@onready var sprite : AnimatedSprite2D = $PlayerSprite
|
@onready var sprite : AnimatedSprite2D = $PlayerSprite
|
||||||
|
@onready var particles : GPUParticles2D = $GPUParticles2D
|
||||||
@onready var collision_switcher : CollisionSwitcher = $CollisionSwitcher
|
@onready var collision_switcher : CollisionSwitcher = $CollisionSwitcher
|
||||||
@onready var pickups : Node2D = $Pickups
|
@onready var pickups : Node2D = $Pickups
|
||||||
@onready var jump_buffer_timer : Timer = $JumpBufferTimer
|
@onready var jump_buffer_timer : Timer = $JumpBufferTimer
|
||||||
@@ -82,7 +84,7 @@ func _physics_process(delta: float) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _input(event: InputEvent) -> void:
|
func _input(event: InputEvent) -> void:
|
||||||
if event.is_action_pressed("switch_color"):
|
if event.is_action_pressed("switch_color") and can_switch_color:
|
||||||
_switch()
|
_switch()
|
||||||
|
|
||||||
|
|
||||||
@@ -95,6 +97,7 @@ func _switch() -> void:
|
|||||||
if center_area.get_overlapping_bodies().size() == 0:
|
if center_area.get_overlapping_bodies().size() == 0:
|
||||||
SoundManager.play_sfx_stream(SoundManager.sfx_stream_switch, global_position)
|
SoundManager.play_sfx_stream(SoundManager.sfx_stream_switch, global_position)
|
||||||
collision_switcher.switch_color()
|
collision_switcher.switch_color()
|
||||||
|
particles.restart()
|
||||||
else:
|
else:
|
||||||
_is_switching_needed = true
|
_is_switching_needed = true
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,16 @@
|
|||||||
[ext_resource type="Script" uid="uid://cmimnl6jf78ao" path="res://game/characters/player/state_machine/falling_left_state.gd" id="14_2lnxg"]
|
[ext_resource type="Script" uid="uid://cmimnl6jf78ao" path="res://game/characters/player/state_machine/falling_left_state.gd" id="14_2lnxg"]
|
||||||
[ext_resource type="Script" uid="uid://5s7ko6pcqagy" path="res://game/characters/player/state_machine/falling_right_state.gd" id="15_bfpdl"]
|
[ext_resource type="Script" uid="uid://5s7ko6pcqagy" path="res://game/characters/player/state_machine/falling_right_state.gd" id="15_bfpdl"]
|
||||||
|
|
||||||
|
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_bfpdl"]
|
||||||
|
particle_flag_disable_z = true
|
||||||
|
emission_shape = 3
|
||||||
|
emission_box_extents = Vector3(4, 14, 1)
|
||||||
|
inherit_velocity_ratio = 0.25
|
||||||
|
direction = Vector3(0, -1, 0)
|
||||||
|
initial_velocity_min = 15.0
|
||||||
|
initial_velocity_max = 15.0
|
||||||
|
gravity = Vector3(0, 0, 0)
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_xln5q"]
|
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_xln5q"]
|
||||||
radius = 4.0
|
radius = 4.0
|
||||||
|
|
||||||
@@ -32,6 +42,15 @@ script = ExtResource("1_xln5q")
|
|||||||
[node name="PlayerSprite" parent="." unique_id=237719081 instance=ExtResource("2_n6ad3")]
|
[node name="PlayerSprite" parent="." unique_id=237719081 instance=ExtResource("2_n6ad3")]
|
||||||
animation = &"jump_right"
|
animation = &"jump_right"
|
||||||
|
|
||||||
|
[node name="GPUParticles2D" type="GPUParticles2D" parent="." unique_id=405618377]
|
||||||
|
emitting = false
|
||||||
|
amount = 16
|
||||||
|
lifetime = 0.25
|
||||||
|
one_shot = true
|
||||||
|
explosiveness = 0.5
|
||||||
|
fixed_fps = 10
|
||||||
|
process_material = SubResource("ParticleProcessMaterial_bfpdl")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1101386361]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1101386361]
|
||||||
position = Vector2(0, 1)
|
position = Vector2(0, 1)
|
||||||
shape = SubResource("CapsuleShape2D_xln5q")
|
shape = SubResource("CapsuleShape2D_xln5q")
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ extends Node2D
|
|||||||
|
|
||||||
|
|
||||||
@export var player_falling_at_start: bool = true
|
@export var player_falling_at_start: bool = true
|
||||||
|
@export var player_can_switch_color: bool = true
|
||||||
|
|
||||||
|
|
||||||
@onready var player : Player = $Player
|
@onready var player : Player = $Player
|
||||||
@@ -20,6 +21,8 @@ func _ready() -> void:
|
|||||||
|
|
||||||
SoundManager.play_music_stream(SoundManager.music_stream_gameplay)
|
SoundManager.play_music_stream(SoundManager.music_stream_gameplay)
|
||||||
|
|
||||||
|
player.can_switch_color = player_can_switch_color
|
||||||
|
|
||||||
if player_falling_at_start:
|
if player_falling_at_start:
|
||||||
player.velocity.y = player.max_fall_speed
|
player.velocity.y = player.max_fall_speed
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ size = Vector2(80, 12)
|
|||||||
|
|
||||||
[node name="Level1" unique_id=586585189 instance=ExtResource("1_15okj")]
|
[node name="Level1" unique_id=586585189 instance=ExtResource("1_15okj")]
|
||||||
player_falling_at_start = false
|
player_falling_at_start = false
|
||||||
|
player_can_switch_color = false
|
||||||
|
|
||||||
[node name="Parallax2D" type="Parallax2D" parent="." index="0" unique_id=713207635]
|
[node name="Parallax2D" type="Parallax2D" parent="." index="0" unique_id=713207635]
|
||||||
scroll_scale = Vector2(0, 0)
|
scroll_scale = Vector2(0, 0)
|
||||||
@@ -236,5 +237,5 @@ position = Vector2(1976, 410)
|
|||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="KillingAreas/KillingArea2" index="0" unique_id=335586472]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="KillingAreas/KillingArea2" index="0" unique_id=335586472]
|
||||||
shape = SubResource("RectangleShape2D_2gpk1")
|
shape = SubResource("RectangleShape2D_2gpk1")
|
||||||
|
|
||||||
[node name="LevelEnd" parent="." index="11" unique_id=1018767708]
|
[node name="LevelEnd" parent="." index="12" unique_id=1018767708]
|
||||||
position = Vector2(2416, 471)
|
position = Vector2(2416, 471)
|
||||||
|
|||||||
Reference in New Issue
Block a user