Lots more work on the actual game map and new MIDI grave jingles

master
Wynd 2024-09-20 22:50:26 +03:00
parent c06e5a6ada
commit 13a1e445b9
29 changed files with 486 additions and 53 deletions

View File

@ -11,6 +11,7 @@ config_version=5
[application]
config/name="GBJAM12"
config/tags=PackedStringArray("gamejam", "tilemap")
run/main_scene="res://scenes/main.tscn"
config/features=PackedStringArray("4.3", "GL Compatibility")

View File

@ -9,6 +9,10 @@ var _speed: int = 50
func _ready():
if _direction.x > 0:
sprite.flip_h = true
if _direction.y < 0:
rotation_degrees = 90
if _direction.y > 0:
rotation_degrees = -90
func shoot(dir: Vector2i, speed: int):
_direction = dir

View File

@ -1,3 +1,4 @@
class_name ArrowShooter
extends RayCast2D
@onready var arrow: PackedScene = preload("res://puzzles/arrow/arrow.tscn")
@ -6,14 +7,33 @@ extends RayCast2D
@export var arrow_speed: int = 400
@export var shoot_timer: float = 3.0
@export var offset_start_time: float = 0.0
var _default_offset: float = 0.0
var is_stopped = false
var _arrows_shot: Array[Arrow] = []
func _ready():
timer.start(shoot_timer)
_default_offset = offset_start_time
func _process(delta):
pass
if is_stopped:
timer.stop()
if offset_start_time > 0:
offset_start_time -= 1
elif offset_start_time <= 0 and timer.is_stopped():
timer.start(shoot_timer)
func _on_shoot_timer_timeout():
var inst: Arrow = arrow.instantiate()
inst.shoot(shoot_dir, arrow_speed)
add_child(inst)
_arrows_shot.push_back(inst)
func _on_visibility_changed():
for arrow in _arrows_shot:
if arrow != null:
arrow.queue_free()
offset_start_time = _default_offset
is_stopped = !visible

View File

@ -8,4 +8,5 @@ script = ExtResource("1_tk6ny")
[node name="ShootTimer" type="Timer" parent="."]
[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]
[connection signal="timeout" from="ShootTimer" to="." method="_on_shoot_timer_timeout"]

View File

@ -1,4 +1,2 @@
class_name BoxSwitch
extends Area2D
@export var start_point: BoxReset

View File

@ -1,5 +1,4 @@
class_name BoxPuzzle
extends Puzzle
@export var boxes: Array[Box] = []

View File

@ -1,16 +1,21 @@
class_name GroundButton
extends Area2D
@onready var sprite = $Sprite2D
@export var nodes: Array[Node2D]
var state = false
var is_active = false
func _on_body_entered(body):
if body is Player:
state = not state
is_active = not is_active
sprite.frame = 1 if is_active else 0
for node in nodes:
if node is TileMapLayer:
var layer = node as TileMapLayer
layer.enabled = !layer.enabled
sprite.frame = 1 if state else 0
else:
node.visible = false if is_active else true
node.process_mode = PROCESS_MODE_DISABLED if is_active else PROCESS_MODE_INHERIT
node.set_physics_process(!is_active)

View File

@ -15,3 +15,5 @@ hframes = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_xj0k4")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@ -0,0 +1,15 @@
class_name ButtonPuzzle
extends Puzzle
@export var buttons: Array[GroundButton] = []
func _process(delta):
var is_finished = true
for button in buttons:
if !button.is_active:
is_finished = false
break;
if is_finished:
complete()

View File

@ -3,7 +3,6 @@ extends PuzzleElement
@export var pair: Grave
@export var jingle: AudioStream
@export var id: int
@onready var animation_player: AnimationPlayer = $AnimationPlayer
@onready var audio_player: AudioStreamPlayer2D = $AudioStreamPlayer2D

View File

@ -4,12 +4,10 @@ extends PuzzleManager
@export var next_room_fog: TileMapLayer
@export var next_room_fog_2: TileMapLayer
var mark_as_finished = false
func _process(delta):
if is_room_finished() and not mark_as_finished:
next_room_fog_2.queue_free()
mark_as_finished = true
#if is_room_finished() and not mark_as_finished:
#next_room_fog_2.queue_free()
#mark_as_finished = true
pass
func _on_demo_grave_puzzle_complete():

View File

@ -0,0 +1,6 @@
extends PuzzleManager
@export var next_room_wall: Node2D
func _on_finish_room():
next_room_wall.queue_free()

View File

@ -6,11 +6,20 @@ signal finish_room
@export var mandatory_puzzles: Array[Puzzle]
@export var optional_puzzles: Array[Puzzle]
var mark_as_finished = false
func _process(delta):
check_is_room_finished()
pass
func is_room_finished() -> bool:
func check_is_room_finished() -> bool:
if mark_as_finished:
return true
for puzzle in mandatory_puzzles:
if !puzzle.is_complete:
return false
finish_room.emit()
mark_as_finished = true
return true

View File

@ -1 +1 @@
3,0,0,0,120,16,4,2,0,0,0,128,0,256,221,0,5,128,0,256,3,0,0,0,0,4,63,1,0,0,64,1,3,0,65,1,1,0,68,1,2,0,0,0,0,0,0,0,0,0,0,1,0,4,41,1,0,0,43,1,3,0,44,1,1,0,46,1,2,0,0,1,0,1,2,-1,-1,-1,-1,-1,-1,-1,
3,0,0,0,120,16,4,1,9,0,3,128,0,256,1,0,0,0,0,4,63,1,0,0,64,1,3,0,65,1,1,0,68,1,2,0,0,1,0,1,0,-1,-1,-1,-1,-1,-1,-1,

View File

@ -1 +1 @@
3,0,0,0,120,16,4,2,0,0,0,128,0,256,221,0,5,128,0,256,3,0,0,0,0,4,63,1,0,0,64,1,3,0,65,1,1,0,68,1,2,0,0,0,0,0,0,0,0,0,0,1,0,4,39,1,1,0,43,1,2,0,45,1,3,0,46,1,0,0,0,1,0,1,2,-1,-1,-1,-1,-1,-1,-1,
3,0,0,0,120,16,4,1,9,0,3,128,0,256,1,0,0,0,0,4,63,1,1,0,67,1,2,0,69,1,3,0,70,1,0,0,0,1,0,1,0,-1,-1,-1,-1,-1,-1,-1,

View File

@ -1 +1 @@
3,0,0,0,120,16,4,2,0,0,0,128,0,256,221,0,5,128,0,256,3,0,0,0,0,4,63,1,0,0,64,1,3,0,65,1,1,0,68,1,2,0,0,0,0,0,0,0,0,0,0,1,0,4,39,1,0,0,39,1,2,0,40,1,1,0,40,1,3,0,0,1,0,1,2,-1,-1,-1,-1,-1,-1,-1,
3,0,0,0,120,16,4,1,9,0,3,128,0,256,1,0,0,0,0,4,63,1,0,0,63,1,2,0,64,1,1,0,64,1,3,0,0,1,0,1,0,-1,-1,-1,-1,-1,-1,-1,

View File

@ -1 +1 @@
3,0,0,0,120,16,4,2,0,0,0,128,0,256,221,0,5,128,0,256,3,0,0,0,0,4,63,1,0,0,64,1,3,0,65,1,1,0,68,1,2,0,0,0,0,0,0,0,0,0,0,1,0,4,38,1,5,0,39,1,7,0,45,1,2,0,47,1,0,0,0,1,0,1,2,-1,-1,-1,-1,-1,-1,-1,
3,0,0,0,120,16,4,1,9,0,3,128,0,256,1,0,0,0,0,4,62,1,5,0,64,1,7,0,69,1,2,0,71,1,0,0,0,1,0,1,0,-1,-1,-1,-1,-1,-1,-1,

View File

@ -1 +1 @@
3,0,0,0,120,16,4,2,0,0,0,128,0,256,221,0,5,128,0,256,3,0,0,0,0,4,63,1,0,0,64,1,3,0,65,1,1,0,68,1,2,0,0,0,0,0,0,0,0,0,0,1,0,4,36,1,7,0,38,1,0,0,39,1,2,0,45,1,5,0,0,1,0,1,2,-1,-1,-1,-1,-1,-1,-1,
3,0,0,0,120,16,4,1,9,0,3,128,0,256,1,0,0,0,0,4,62,1,3,0,67,1,2,0,68,1,0,0,68,1,4,0,0,1,0,1,0,-1,-1,-1,-1,-1,-1,-1,

View File

@ -0,0 +1 @@
3,0,0,0,120,16,4,1,9,0,3,128,0,256,1,0,0,0,0,4,60,1,6,0,62,1,0,0,64,1,4,0,68,1,2,0,0,1,0,1,0,-1,-1,-1,-1,-1,-1,-1,

Binary file not shown.

View File

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://b64hnp2tfby6x"
path="res://.godot/imported/grave_jingle6.wav-6502ea782a63a5356d8bf4fc0b7bdc95.sample"
[deps]
source_file="res://scenes/assets/jingles/grave_jingle6.wav"
dest_files=["res://.godot/imported/grave_jingle6.wav-6502ea782a63a5356d8bf4fc0b7bdc95.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

View File

@ -22,14 +22,12 @@ texture_region_size = Vector2i(8, 8)
6:1/0 = 0
6:1/0/custom_data_0 = true
7:1/0 = 0
7:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-4, -4, 4, -4, 4, 4, -4, 4)
7:0/0 = 0
7:0/0/custom_data_0 = true
1:1/0 = 0
0:1/animation_columns = 1
0:1/animation_speed = 2.0
0:1/animation_frame_0/duration = 1.0
0:1/animation_frame_1/duration = 1.0
0:1/0 = 0
1:1/0/probability = 0.5
1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-4, -4, 4, -4, 4, 4, -4, 4)
2:0/animation_mode = 1
2:0/0 = 0
2:0/0/probability = 0.2
@ -45,6 +43,21 @@ texture_region_size = Vector2i(8, 8)
6:2/0/physics_layer_1/polygon_0/points = PackedVector2Array(-4, -4, 4, -4, 4, 4, -4, 4)
7:2/0 = 0
7:2/0/physics_layer_1/polygon_0/points = PackedVector2Array(-4, -4, 4, -4, 4, 4, -4, 4)
7:3/0 = 0
6:3/0 = 0
2:1/0 = 0
2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-4, -4, 4, -4, 4, 4, -4, 4)
0:1/0 = 0
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-4, -4, 4, -4, 4, 4, -4, 4)
4:2/0 = 0
5:2/0 = 0
0:2/animation_columns = 1
0:2/animation_frame_0/duration = 0.2
0:2/animation_frame_1/duration = 0.3
0:2/animation_frame_2/duration = 0.2
0:2/animation_frame_3/duration = 0.3
0:2/0 = 0
0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-4, -4, 4, -4, 4, 4, -4, 4)
[resource]
tile_size = Vector2i(8, 8)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 645 B

After

Width:  |  Height:  |  Size: 986 B

File diff suppressed because one or more lines are too long