Built a simple 'World 1-1' level to test platforming
@@ -1,6 +1,5 @@
|
||||
class_name ArrowGirl extends Area2D
|
||||
|
||||
@onready var _dialogController = $/root/Scene/DialogController
|
||||
@onready var _sprite = $AnimatedSprite2D
|
||||
|
||||
#boilerplate
|
||||
@@ -16,8 +15,8 @@ func _on_animation_finished() -> void:
|
||||
|
||||
func _on_body_entered(body) -> void:
|
||||
if body is BoxBoy:
|
||||
_dialogController.set_dialog("Hello.", 0.2)
|
||||
%DialogController.set_dialog("Hello flowers!", 0.2)
|
||||
|
||||
func _on_body_exited(body) -> void:
|
||||
if body is BoxBoy:
|
||||
_dialogController.set_dialog("")
|
||||
%DialogController.set_dialog("")
|
||||
|
||||
@@ -49,6 +49,7 @@ animation = &"idle_glance"
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1190138841]
|
||||
visible = false
|
||||
shape = SubResource("RectangleShape2D_53v1e")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
class_name BoxBoy extends CharacterBody2D
|
||||
|
||||
@onready var _gameplayController = $/root/Scene/GameplayController
|
||||
@onready var _sprite = $AnimatedSprite2D
|
||||
|
||||
const MOVE_FORCE: int = 150
|
||||
@@ -40,7 +39,7 @@ func _physics_process(_delta) -> void:
|
||||
buffer_jumping -= 1
|
||||
|
||||
#process coyote and jump buffers
|
||||
if buffer_grounded > 0 and buffer_jumping > 0 and just_bounced == false:
|
||||
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
|
||||
@@ -66,13 +65,12 @@ 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:
|
||||
if %GameplayController.godmode and velocity.y > 0:
|
||||
velocity.y = 0
|
||||
|
||||
|
||||
#do the thing
|
||||
move_and_slide()
|
||||
|
||||
|
||||
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://Controllers/DialogController.gd" id="2_ec8g2"]
|
||||
[ext_resource type="PackedScene" uid="uid://xmes6cyca17" path="res://Controllers/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,7 +15,7 @@ compatibility/default_parent_skeleton_in_mesh_instance_3d=true
|
||||
[application]
|
||||
|
||||
config/name="colorvania"
|
||||
run/main_scene="res://Workspace.tscn"
|
||||
run/main_scene="uid://xensvnomjpi8"
|
||||
config/features=PackedStringArray("4.6", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
|
||||