Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b146504830 | ||
|
|
8b304304db | ||
|
|
b433c31261 | ||
|
|
336dd59dbb | ||
|
|
84cb13e717 | ||
|
|
aea1b4a97d | ||
|
|
94b810e4f1 | ||
|
|
21141376d2 | ||
|
|
935125de83 | ||
|
|
a9f1fd48c9 |
19
ArrowGirl/ArrowGirl.gd
Normal file
@@ -0,0 +1,19 @@
|
||||
class_name ArrowGirl extends Area2D
|
||||
|
||||
@onready var _sprite = $AnimatedSprite2D
|
||||
var dialog_text: DialogText = preload("res://DialogContent/DialogDebug_1.tres")
|
||||
|
||||
#boilerplate
|
||||
func _ready():
|
||||
_sprite.play("idle", 1)
|
||||
|
||||
#animation stuff
|
||||
func _on_animation_finished() -> void:
|
||||
if randf() < 0.2:
|
||||
_sprite.play("idle_glance", 2)
|
||||
else:
|
||||
_sprite.play("idle", 2)
|
||||
|
||||
func _on_body_entered(body) -> void:
|
||||
if body is BoxBoy:
|
||||
%DialogController.set_dialog_text(dialog_text, 0.2)
|
||||
1
ArrowGirl/ArrowGirl.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dqnhd2oej7xbw
|
||||
BIN
ArrowGirl/ArrowGirl.png
Normal file
|
After Width: | Height: | Size: 762 B |
40
ArrowGirl/ArrowGirl.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dvuvwdk6nr4nb"
|
||||
path="res://.godot/imported/ArrowGirl.png-d4d75df81e356cd6ff3873d27dc6b64f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ArrowGirl/ArrowGirl.png"
|
||||
dest_files=["res://.godot/imported/ArrowGirl.png-d4d75df81e356cd6ff3873d27dc6b64f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
58
ArrowGirl/ArrowGirl.tscn
Normal file
@@ -0,0 +1,58 @@
|
||||
[gd_scene format=3 uid="uid://cn8srrkyt4h8e"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dvuvwdk6nr4nb" path="res://ArrowGirl/ArrowGirl.png" id="1_5i1ac"]
|
||||
[ext_resource type="Script" uid="uid://dqnhd2oej7xbw" path="res://ArrowGirl/ArrowGirl.gd" id="1_53v1e"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_y2354"]
|
||||
atlas = ExtResource("1_5i1ac")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ni31j"]
|
||||
atlas = ExtResource("1_5i1ac")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xlvrw"]
|
||||
atlas = ExtResource("1_5i1ac")
|
||||
region = Rect2(32, 0, 32, 32)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_73fnb"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_y2354")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"idle",
|
||||
"speed": 1.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ni31j")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xlvrw")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"idle_glance",
|
||||
"speed": 1.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_53v1e"]
|
||||
size = Vector2(32, 96)
|
||||
|
||||
[node name="ArrowGirl" type="Area2D" unique_id=869288979]
|
||||
script = ExtResource("1_53v1e")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1672878033]
|
||||
sprite_frames = SubResource("SpriteFrames_73fnb")
|
||||
animation = &"idle_glance"
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1190138841]
|
||||
visible = false
|
||||
position = Vector2(0, -32)
|
||||
shape = SubResource("RectangleShape2D_53v1e")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animation_finished"]
|
||||
BIN
ArrowGirl/ArrowGirl.xcf
Normal file
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://b1hpr05b5sgww"]
|
||||
[gd_scene format=3 uid="uid://b1hpr05b5sgww"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cx77xahl8btw5" path="res://Bouncy/Bouncy.png" id="1_ljpgq"]
|
||||
[ext_resource type="Script" uid="uid://b11al8kjnoveh" path="res://Bouncy/Bouncy.gd" id="1_uccqy"]
|
||||
@@ -17,15 +17,14 @@ animations = [{
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_qqmjc"]
|
||||
size = Vector2(32, 16)
|
||||
|
||||
[node name="Bouncy" type="Area2D"]
|
||||
[node name="Bouncy" type="Area2D" unique_id=530183031]
|
||||
script = ExtResource("1_uccqy")
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1147267436]
|
||||
sprite_frames = SubResource("SpriteFrames_npa0g")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1371643518]
|
||||
shape = SubResource("RectangleShape2D_qqmjc")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
|
||||
@@ -2,18 +2,18 @@ class_name BoxBoy extends CharacterBody2D
|
||||
|
||||
@onready var _sprite = $AnimatedSprite2D
|
||||
|
||||
const MOVE_FORCE: int = 300 #about 10 tiles horizontally (airborne arc)
|
||||
const JUMP_FORCE: int = 500 #about 4 tiles vertically
|
||||
const MOVE_FORCE: int = 150
|
||||
const JUMP_FORCE: int = 380 #about 2 tiles
|
||||
|
||||
const GRAVITY_RISING: int = 15
|
||||
const GRAVITY_FALLING: int = 30
|
||||
|
||||
#bouncy platform
|
||||
const BOUNCE_FORCE: int = -820 #about 10 tiles vertically
|
||||
const BOUNCE_FORCE: int = -500 #about 4 tiles
|
||||
var just_bounced: bool = false #allow max bounce height (i.e. ignore jump input)
|
||||
|
||||
#limits
|
||||
const MAX_MOVE_SPEED: int = 300
|
||||
const MAX_MOVE_SPEED: int = 200 #about 6 tiles when airborne
|
||||
const MAX_FALL_SPEED: int = 800
|
||||
|
||||
#game-feel
|
||||
@@ -33,19 +33,19 @@ func _physics_process(_delta) -> void:
|
||||
buffer_grounded -= 1
|
||||
|
||||
#jump buffering
|
||||
if Input.is_action_just_pressed("input_jump"):
|
||||
if %GameplayController.input_enabled and Input.is_action_just_pressed("input_jump"):
|
||||
buffer_jumping = 6
|
||||
else:
|
||||
buffer_jumping -= 1
|
||||
|
||||
#process coyote and jump buffers
|
||||
if buffer_grounded > 0 and buffer_jumping > 0:
|
||||
if (buffer_grounded > 0 or %GameplayController.godmode) and buffer_jumping > 0 and just_bounced == false:
|
||||
velocity.y = -JUMP_FORCE
|
||||
buffer_grounded = 0
|
||||
buffer_jumping = 0
|
||||
|
||||
#normally, fall faster than you rise
|
||||
elif velocity.y < 0 and (Input.is_action_pressed("input_jump") or just_bounced):
|
||||
elif ((%GameplayController.input_enabled and Input.is_action_pressed("input_jump")) or just_bounced) and velocity.y < 0:
|
||||
velocity.y += GRAVITY_RISING
|
||||
else:
|
||||
velocity.y += GRAVITY_FALLING
|
||||
@@ -54,7 +54,7 @@ func _physics_process(_delta) -> void:
|
||||
#sideways movement
|
||||
var move_dir = Input.get_axis("input_left", "input_right")
|
||||
|
||||
if move_dir:
|
||||
if %GameplayController.input_enabled and move_dir:
|
||||
_sprite.flip_h = move_dir < 0 #fancy HD 4K graphics
|
||||
velocity.x += MOVE_FORCE * move_dir
|
||||
|
||||
@@ -65,12 +65,14 @@ func _physics_process(_delta) -> void:
|
||||
#terminal velocity (in all directions)
|
||||
if velocity.y > MAX_FALL_SPEED:
|
||||
velocity.y = MAX_FALL_SPEED
|
||||
if abs(velocity.x) > MAX_MOVE_SPEED:
|
||||
velocity.x = MAX_MOVE_SPEED * sign(velocity.x)
|
||||
if abs(velocity.x) > MAX_MOVE_SPEED * (10 if %GameplayController.godmode else 1):
|
||||
velocity.x = sign(velocity.x) * MAX_MOVE_SPEED * (10 if %GameplayController.godmode else 1)
|
||||
|
||||
if %GameplayController.godmode and velocity.y > 0:
|
||||
velocity.y = 0
|
||||
|
||||
#do the thing
|
||||
move_and_slide()
|
||||
print(velocity.y)
|
||||
|
||||
#animation stuff
|
||||
func _on_animation_finished() -> void:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dndbf44fkm2ww"]
|
||||
[gd_scene format=3 uid="uid://dndbf44fkm2ww"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c2x51mppxugpn" path="res://BoxBoy/BoxBoy.gd" id="1_av86f"]
|
||||
[ext_resource type="Texture2D" uid="uid://bpjhq0b2dae1d" path="res://BoxBoy/BoxBoy.png" id="2_0yqgk"]
|
||||
@@ -32,17 +32,17 @@ animations = [{
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ulcgi"]
|
||||
radius = 14.0
|
||||
height = 32.0
|
||||
height = 31.0
|
||||
|
||||
[node name="BoxBoy" type="CharacterBody2D"]
|
||||
[node name="BoxBoy" type="CharacterBody2D" unique_id=904940283]
|
||||
script = ExtResource("1_av86f")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=660463739]
|
||||
sprite_frames = SubResource("SpriteFrames_y2354")
|
||||
animation = &"idle"
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1250358515]
|
||||
shape = SubResource("CapsuleShape2D_ulcgi")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
|
||||
27
Controllers/GameplayController.gd
Normal file
@@ -0,0 +1,27 @@
|
||||
extends Node
|
||||
|
||||
const LOREM_IPSUM = [
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut nisl justo, malesuada sed gravida ut, elementum in sem. Etiam consequat turpis justo, vel egestas sapien iaculis sed. Sed consequat vel tellus ornare lobortis. Maecenas dapibus, sapien in dictum accumsan, quam ligula eleifend turpis, vel tincidunt magna enim sit amet arcu. Praesent augue dolor, tempus eget varius in, tristique at ligula. Sed imperdiet vehicula est sit amet scelerisque. Morbi sit amet diam nibh. Curabitur ipsum velit, feugiat lacinia libero sed, lobortis ullamcorper lorem.",
|
||||
"Ut hendrerit placerat tempus. Phasellus iaculis lacus eget magna commodo, ac porttitor massa fermentum. Integer non pellentesque risus, ac dictum ipsum. Cras rhoncus sed nisl at consequat. Fusce ac sagittis dolor. Mauris lobortis risus quis risus aliquet, vel mattis felis semper. Cras ut nisi blandit, consequat felis id, laoreet sapien. Suspendisse ut volutpat nisl, et auctor nunc. Sed fringilla, nibh eu luctus sagittis, risus mi egestas lorem, ac vestibulum massa tellus malesuada tellus. Suspendisse ut turpis euismod, pulvinar nibh in, lacinia sapien. Pellentesque posuere bibendum rutrum. Maecenas at ante venenatis, tempus elit quis, rhoncus arcu. Curabitur viverra lorem vel nunc tempus imperdiet. Phasellus ac elit ornare, porta metus non, pellentesque neque. Donec sagittis aliquam ante ac ornare.",
|
||||
"Etiam id imperdiet massa. Aenean blandit eget mi id vulputate. Pellentesque at mollis eros. Mauris eu tortor aliquam, pulvinar urna ac, sollicitudin ipsum. In tincidunt dui ac consectetur gravida. Phasellus sed nulla vel tortor congue molestie in quis urna. Nulla non libero venenatis, lacinia nibh id, cursus nisl. In placerat mi mi, in pharetra velit porta vel. Vivamus in urna id metus accumsan pellentesque. Morbi commodo lacus dictum est vulputate, quis egestas sapien fringilla. Integer felis enim, dapibus vel blandit in, gravida at enim. Pellentesque ultricies congue mauris, vitae rhoncus tellus placerat sed. Nunc volutpat finibus libero at venenatis.",
|
||||
"Sed tempus posuere magna eget venenatis. Quisque rutrum porta tellus, vitae sagittis nisi commodo vitae. Proin a pretium nunc, ut suscipit augue. Vivamus placerat, urna non gravida sagittis, ipsum enim vehicula nulla, ac venenatis nisl nunc at nunc. Quisque vehicula nunc nec pellentesque iaculis. Fusce ullamcorper placerat varius. Morbi ullamcorper blandit porta. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Integer porttitor a neque eu vulputate. Mauris ultricies neque augue. Proin iaculis mauris at venenatis bibendum. Sed eget mi lobortis, fringilla est a, vehicula lorem. Vestibulum porta venenatis massa, non ullamcorper nibh lacinia eu. Curabitur placerat euismod congue. Proin gravida pulvinar purus, in iaculis nisl ultricies sit amet.",
|
||||
"Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse condimentum ex vitae mi lacinia, id dignissim nibh mattis. Ut sapien sapien, hendrerit id magna vel, ornare faucibus felis. Cras vel dictum justo. Curabitur eros orci, scelerisque suscipit nibh non, cursus porttitor lorem. Vestibulum imperdiet justo non nulla interdum, ac placerat mi rhoncus. Pellentesque at faucibus purus, vel tempor sem. Nullam eget sem tristique erat congue pretium. Ut quis accumsan dui, vitae dapibus nunc. Suspendisse erat urna, lacinia eu tincidunt nec, semper nec metus. Sed euismod erat in nisi iaculis aliquam. Duis auctor pellentesque purus at egestas. Nulla eget ligula faucibus, sagittis elit vel, lacinia leo.",
|
||||
"",
|
||||
]
|
||||
|
||||
static var input_enabled: bool = true:
|
||||
get():
|
||||
return input_enabled
|
||||
set(value):
|
||||
input_enabled = value
|
||||
|
||||
static var godmode: bool = false:
|
||||
get():
|
||||
return godmode
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if Input.is_action_just_pressed("controller_godmode"):
|
||||
godmode = !godmode
|
||||
|
||||
if Input.is_action_just_pressed("controller_dialog"):
|
||||
%DialogController.set_dialog(LOREM_IPSUM[ randi() % LOREM_IPSUM.size()])
|
||||
1
Controllers/GameplayController.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b4nlbrxto0tjp
|
||||
10
DialogContent/DialogDebug_1.tres
Normal file
@@ -0,0 +1,10 @@
|
||||
[gd_resource type="Resource" script_class="DialogText" format=3 uid="uid://iprmiuvbd0pj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d1wmy2e1qhr5h" path="res://DialogSystem/DialogText.gd" id="1_d2twj"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_d2twj")
|
||||
text = "She smiles.
|
||||
|
||||
\"Hello flowers!\""
|
||||
metadata/_custom_type_script = "uid://d1wmy2e1qhr5h"
|
||||
49
DialogSystem/DialogContainer.tscn
Normal file
@@ -0,0 +1,49 @@
|
||||
[gd_scene format=3 uid="uid://xmes6cyca17"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_66br4"]
|
||||
content_margin_left = 50.0
|
||||
bg_color = Color(0.4373566, 0.12280094, 0.2996518, 1)
|
||||
border_width_left = 10
|
||||
border_width_top = 10
|
||||
border_width_right = 10
|
||||
border_width_bottom = 10
|
||||
border_color = Color(0.7138311, 0.75896835, 1, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[node name="DialogContainer" type="MarginContainer" unique_id=988261899]
|
||||
anchors_preset = 12
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = -240.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
theme_override_constants/margin_left = 20
|
||||
theme_override_constants/margin_right = 20
|
||||
theme_override_constants/margin_bottom = 20
|
||||
|
||||
[node name="DialogBackground" type="Panel" parent="." unique_id=865458038]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_66br4")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=1763747003]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 20
|
||||
theme_override_constants/margin_right = 20
|
||||
theme_override_constants/margin_bottom = 20
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="MarginContainer" unique_id=53979081]
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/normal_font_size = 30
|
||||
theme_override_font_sizes/bold_font_size = 30
|
||||
theme_override_font_sizes/bold_italics_font_size = 30
|
||||
theme_override_font_sizes/italics_font_size = 30
|
||||
theme_override_font_sizes/mono_font_size = 30
|
||||
text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dictum aliquet arcu, vel tristique ligula dictum id. Mauris ac libero ut enim ultrices aliquam vel eget lacus. Nam ultricies dapibus erat. In lacus sapien, porttitor at purus blandit, sagittis euismod augue."
|
||||
scroll_active = false
|
||||
autowrap_mode = 2
|
||||
vertical_alignment = 1
|
||||
justification_flags = 227
|
||||
46
DialogSystem/DialogController.gd
Normal file
@@ -0,0 +1,46 @@
|
||||
extends Node
|
||||
|
||||
@export var dialogContainer: MarginContainer
|
||||
@export var dialogTextLabel: RichTextLabel
|
||||
|
||||
var _current_dialog_counter: int = 0
|
||||
var _current_dialog_text: DialogText = null
|
||||
var _current_dialog_seconds: float = 1
|
||||
|
||||
func set_dialog_text(dialog_text: DialogText, seconds: float = 1) -> void:
|
||||
_current_dialog_counter = -1
|
||||
_current_dialog_text = dialog_text
|
||||
_current_dialog_seconds = seconds
|
||||
_next_dialog_line()
|
||||
|
||||
func _next_dialog_line() -> void:
|
||||
_current_dialog_counter += 1
|
||||
set_dialog_line(_current_dialog_text.get_line_raw(_current_dialog_counter), _current_dialog_seconds)
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if Input.is_action_just_pressed("ui_accept") and _current_dialog_text:
|
||||
_next_dialog_line()
|
||||
|
||||
func set_dialog_line(text: String, seconds: float = 1) -> void:
|
||||
dialogTextLabel.text = text
|
||||
dialogTextLabel.visible_ratio = 0
|
||||
var ratio: float = 0
|
||||
|
||||
if text.length() == 0:
|
||||
dialogContainer.visible = false
|
||||
%GameplayController.input_enabled = true
|
||||
_current_dialog_text = null
|
||||
return #a hacky way to clear the dialog box
|
||||
else:
|
||||
dialogContainer.visible = true
|
||||
%GameplayController.input_enabled = false
|
||||
|
||||
var increment: float = (1 / seconds)/ 60.0
|
||||
|
||||
while true:
|
||||
#don't interfere with other timers
|
||||
if dialogTextLabel.visible_ratio < ratio or dialogTextLabel.visible_ratio >= 1:
|
||||
return
|
||||
dialogTextLabel.visible_ratio += increment
|
||||
ratio = dialogTextLabel.visible_ratio
|
||||
await get_tree().create_timer(1.0/60.0).timeout #update proportional to 60 FPS
|
||||
1
DialogSystem/DialogController.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://crdpf275pa70b
|
||||
21
DialogSystem/DialogText.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
class_name DialogText extends Resource
|
||||
|
||||
##Contains raw text for dialog boxes, and allows you to iterate through it line-by-line.
|
||||
|
||||
@export_multiline() var text: String
|
||||
var _content: Array = []
|
||||
|
||||
func get_line_raw(line: int) -> String:
|
||||
if _content.size() == 0 and text.length() > 0:
|
||||
_parse_text()
|
||||
if line >= _content.size():
|
||||
return ""
|
||||
return _content[line]
|
||||
|
||||
func get_line_count() -> int:
|
||||
if _content.size() == 0 and text.length() > 0:
|
||||
_parse_text()
|
||||
return _content.size()
|
||||
|
||||
func _parse_text() -> void:
|
||||
_content = Array(text.split("\n")).filter(func(line): return line.length() > 0)
|
||||
1
DialogSystem/DialogText.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://d1wmy2e1qhr5h
|
||||
45
Scenes/OneOne.tscn
Normal file
38
Scenes/Template.tscn
Normal file
@@ -0,0 +1,38 @@
|
||||
[gd_scene format=4 uid="uid://c3plh6bpeq0hs"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b4nlbrxto0tjp" path="res://Controllers/GameplayController.gd" id="1_ik3yq"]
|
||||
[ext_resource type="Script" uid="uid://crdpf275pa70b" path="res://DialogSystem/DialogController.gd" id="2_ec8g2"]
|
||||
[ext_resource type="PackedScene" uid="uid://xmes6cyca17" path="res://DialogSystem/DialogContainer.tscn" id="3_fcd3m"]
|
||||
[ext_resource type="TileSet" uid="uid://blw0jlvdxyhwl" path="res://Tilesets/delve.tres" id="4_ekmwr"]
|
||||
[ext_resource type="PackedScene" uid="uid://dndbf44fkm2ww" path="res://BoxBoy/BoxBoy.tscn" id="5_rej16"]
|
||||
|
||||
[node name="OneOne" type="Node2D" unique_id=1460902338]
|
||||
|
||||
[node name="GameplayController" type="Node" parent="." unique_id=970621718]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("1_ik3yq")
|
||||
|
||||
[node name="DialogController" type="Node" parent="." unique_id=1801014879 node_paths=PackedStringArray("dialogContainer", "dialogTextLabel")]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("2_ec8g2")
|
||||
dialogContainer = NodePath("../CanvasLayer/DialogContainer")
|
||||
dialogTextLabel = NodePath("../CanvasLayer/DialogContainer/MarginContainer/RichTextLabel")
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="." unique_id=642566280]
|
||||
|
||||
[node name="DialogContainer" parent="CanvasLayer" unique_id=988261899 instance=ExtResource("3_fcd3m")]
|
||||
visible = false
|
||||
|
||||
[node name="TileMapLayer" type="TileMapLayer" parent="." unique_id=346622014]
|
||||
tile_map_data = PackedByteArray("AAAAAAkABAABAAAAAAABAAkABAABAAAAAAACAAkABAABAAAAAAADAAkABAABAAAAAAAEAAkABAABAAAAAAAFAAkABAABAAAAAAAGAAkABAABAAAAAAAHAAkABAABAAAAAAA=")
|
||||
tile_set = ExtResource("4_ekmwr")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="BoxBoy" parent="." unique_id=904940283 instance=ExtResource("5_rej16")]
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="BoxBoy" unique_id=140571303]
|
||||
zoom = Vector2(2, 2)
|
||||
position_smoothing_enabled = true
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[editable path="CanvasLayer/DialogContainer"]
|
||||
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
@@ -3,15 +3,15 @@
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ddl0kxl0inw6r"
|
||||
path="res://.godot/imported/atlas.png-de846864170f09ea6ceb33f64a3c347a.ctex"
|
||||
path="res://.godot/imported/delve.png-40e6026d1cf9afeae402eb999ee408d1.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Tileset/atlas.png"
|
||||
dest_files=["res://.godot/imported/atlas.png-de846864170f09ea6ceb33f64a3c347a.ctex"]
|
||||
source_file="res://Tilesets/delve.png"
|
||||
dest_files=["res://.godot/imported/delve.png-40e6026d1cf9afeae402eb999ee408d1.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
21
Tilesets/delve.tres
Normal file
@@ -0,0 +1,21 @@
|
||||
[gd_resource type="TileSet" format=3 uid="uid://blw0jlvdxyhwl"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ddl0kxl0inw6r" path="res://Tilesets/delve.png" id="1_rr07d"]
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_u3cyc"]
|
||||
texture = ExtResource("1_rr07d")
|
||||
texture_region_size = Vector2i(32, 32)
|
||||
0:0/0 = 0
|
||||
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
1:0/0 = 0
|
||||
1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
2:0/0 = 0
|
||||
2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
3:0/0 = 0
|
||||
3:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||
|
||||
[resource]
|
||||
tile_size = Vector2i(32, 32)
|
||||
physics_layer_0/collision_layer = 1
|
||||
sources/4 = SubResource("TileSetAtlasSource_u3cyc")
|
||||
tile_proxies/coords_level = [[0, Vector2i(0, 0)], [4, Vector2i(0, 0)], [1, Vector2i(0, 0)], [4, Vector2i(1, 0)], [2, Vector2i(0, 0)], [4, Vector2i(2, 0)], [3, Vector2i(0, 0)], [4, Vector2i(3, 0)]]
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@@ -3,15 +3,15 @@
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cieabtlhmftbl"
|
||||
path="res://.godot/imported/dirt.png-698fe62dc2b33200d045ae9723f637e2.ctex"
|
||||
path="res://.godot/imported/dirt.png-ff175a3e6b1e0d87d0f80d5ca7a3d29e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Tileset/dirt.png"
|
||||
dest_files=["res://.godot/imported/dirt.png-698fe62dc2b33200d045ae9723f637e2.ctex"]
|
||||
source_file="res://Tilesets/dirt.png"
|
||||
dest_files=["res://.godot/imported/dirt.png-ff175a3e6b1e0d87d0f80d5ca7a3d29e.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
@@ -3,15 +3,15 @@
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c2r2gwnidyq4v"
|
||||
path="res://.godot/imported/flowers.png-aa3a251c5b7375cd55b079f4830ada75.ctex"
|
||||
path="res://.godot/imported/flowers.png-3b2a0cb3e9456a3ae7858b10d3c5311a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Tileset/flowers.png"
|
||||
dest_files=["res://.godot/imported/flowers.png-aa3a251c5b7375cd55b079f4830ada75.ctex"]
|
||||
source_file="res://Tilesets/flowers.png"
|
||||
dest_files=["res://.godot/imported/flowers.png-3b2a0cb3e9456a3ae7858b10d3c5311a.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
@@ -3,15 +3,15 @@
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c0arwivh81qcc"
|
||||
path="res://.godot/imported/grass.png-fa155d631ab8bc8203964f3dcfd0089a.ctex"
|
||||
path="res://.godot/imported/grass.png-ebb29b2864d12698590ebedd095d35e5.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Tileset/grass.png"
|
||||
dest_files=["res://.godot/imported/grass.png-fa155d631ab8bc8203964f3dcfd0089a.ctex"]
|
||||
source_file="res://Tilesets/grass.png"
|
||||
dest_files=["res://.godot/imported/grass.png-ebb29b2864d12698590ebedd095d35e5.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -3,15 +3,15 @@
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bujpi8tkb46a7"
|
||||
path="res://.godot/imported/rock.png-624ff5e7cdee3a2a061958ced92ea8a9.ctex"
|
||||
path="res://.godot/imported/rock.png-e67c29acf7922836cae72f7c64ce4086.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Tileset/rock.png"
|
||||
dest_files=["res://.godot/imported/rock.png-624ff5e7cdee3a2a061958ced92ea8a9.ctex"]
|
||||
source_file="res://Tilesets/rock.png"
|
||||
dest_files=["res://.godot/imported/rock.png-e67c29acf7922836cae72f7c64ce4086.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
@@ -15,32 +15,48 @@ compatibility/default_parent_skeleton_in_mesh_instance_3d=true
|
||||
[application]
|
||||
|
||||
config/name="colorvania"
|
||||
run/main_scene="res://scene.tscn"
|
||||
run/main_scene="uid://xensvnomjpi8"
|
||||
config/features=PackedStringArray("4.6", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=1280
|
||||
window/size/viewport_height=720
|
||||
window/subwindows/embed_subwindows=false
|
||||
|
||||
[input]
|
||||
|
||||
input_right={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194321,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":68,"physical_keycode":0,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
input_left={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194319,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":65,"physical_keycode":0,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
input_jump={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
controller_godmode={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"command_or_control_autoremap":true,"alt_pressed":false,"shift_pressed":false,"pressed":false,"keycode":71,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
controller_dialog={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"command_or_control_autoremap":true,"alt_pressed":false,"shift_pressed":false,"pressed":false,"keycode":68,"physical_keycode":0,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[rendering]
|
||||
|
||||
textures/canvas_textures/default_texture_filter=0
|
||||
renderer/rendering_method="mobile"
|
||||
2d/snap/snap_2d_transforms_to_pixel=true
|
||||
renderer/rendering_method="gl_compatibility"
|
||||
renderer/rendering_method.mobile="gl_compatibility"
|
||||
|
||||