Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
202 changes: 202 additions & 0 deletions scenes/dev/grapple/grapple_gym_1/grapple_gym_1.tscn

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions scenes/dev/grapple/grapple_gym_1/grapple_string_changer.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
extends Node2D

var _player: CharacterBody2D


func _on_area_2d_body_entered(body: Node2D) -> void:
if body.is_in_group("player"):
_player = body
var hook: PlayerHook = _player.get_node("%PlayerHook")
if hook:
hook.hook_string_texture = preload(
"res://scenes/game_elements/characters/player/components/hook-string-2.png"
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cgxplvvlehoge
12 changes: 12 additions & 0 deletions scenes/dev/grapple/grapple_gym_1/quest.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="Quest" format=3 uid="uid://dspqccopq05wq"]

[ext_resource type="Script" uid="uid://dts1hwdy3phin" path="res://scenes/menus/storybook/components/quest.gd" id="1_05e6l"]

[resource]
script = ExtResource("1_05e6l")
status = 1
title = "Grapple Gym (Basics)"
description = "Learn some of the basics of the grappling mechanic. Crossing gaps, chaining hookable needles, and changing the string's color."
first_scene = "uid://cueeug8yf18gg"
threads_to_collect = 0
metadata/_custom_type_script = "uid://dts1hwdy3phin"
31 changes: 31 additions & 0 deletions scenes/dev/grapple/grapple_gym_2/grapple_gym_2.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# SPDX-FileCopyrightText: The Threadbare Authors
# SPDX-License-Identifier: MPL-2.0
extends Node2D

var zoom_tween: Tween

@onready var bridges_unlocked: TileMapLayer = $TileMapLayers/BridgesUnlocked
@onready var water_unlocked: TileMapLayer = $TileMapLayers/WaterUnlocked
@onready var camera_2d: Camera2D = $OnTheGround/Player/Camera2D


func _ready() -> void:
GameState.player.abilities_changed.connect(_on_abilities_changed)
_on_abilities_changed()


func _on_abilities_changed() -> void:
var has_longer_thread := GameState.player.has_ability(
Enums.PlayerAbilities.ABILITY_B_MODIFIER_1
)
var camera_zoom := Vector2(0.5, 0.5) if has_longer_thread else Vector2(1.0, 1.0)
# Zoom out when the player can throw a longer thread:
if zoom_tween:
zoom_tween.kill()
zoom_tween = create_tween()
zoom_tween.tween_property(camera_2d, "zoom", camera_zoom, 1.0)


func _on_all_hooked_all_hooked() -> void:
bridges_unlocked.enabled = true
water_unlocked.enabled = false
1 change: 1 addition & 0 deletions scenes/dev/grapple/grapple_gym_2/grapple_gym_2.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cn5jcolx2cs0v
482 changes: 482 additions & 0 deletions scenes/dev/grapple/grapple_gym_2/grapple_gym_2.tscn

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions scenes/dev/grapple/grapple_gym_2/quest.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="Quest" format=3 uid="uid://dyirjx23pi3vt"]

[ext_resource type="Script" uid="uid://dts1hwdy3phin" path="res://scenes/menus/storybook/components/quest.gd" id="1_ylnfa"]

[resource]
script = ExtResource("1_ylnfa")
status = 1
title = "Grapple Gym (Reach and Longer Thread)"
description = "Learn how far the grapple can reach with and without the Longer Thread ability. Chain together sets of needles to trigger events. See how a needle changes the reach of the grapple."
first_scene = "uid://bc0bp7e5y10ki"
threads_to_collect = 0
metadata/_custom_type_script = "uid://dts1hwdy3phin"