First Level Test

This commit is contained in:
Page Asgardius 2024-04-17 11:33:27 -07:00
parent c12c4be394
commit d7fab32f44
16 changed files with 549 additions and 26 deletions

31
levels/Ceres/L20.gd Normal file
View file

@ -0,0 +1,31 @@
extends Node2D
var talk = load("res://levels/ui/talk.tscn").instantiate()
var boss
var player
# Called when the node enters the scene tree for the first time.
func _ready():
boss = $Kimberly
player = $Player
boss.add_to_group("boss")
Global.cdialog = [[tr("DIALOG_CERES_L20_0"), true, 0, 0], [tr("DIALOG_CERES_L20_1"), false, 3], [tr("DIALOG_CERES_L20_2"), true, 0, 0]]
Global.live = 0
get_tree().root.add_child.call(talk)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _physics_process(delta):
if player.velocity.x >= 0 && player.velocity.y >= 0:
if player.position.y < boss.position.y && player.get_index() > boss.get_index():
move_child(player, boss.get_index() - 1)
print("move up")
elif player.position.y > boss.position.y && player.get_index() < boss.get_index():
move_child(player, boss.get_index() + 1)
print("move down")
func _input(event):
if Global.cdialog.size() == 0:
get_tree().root.remove_child(talk)

60
levels/Ceres/L20.tscn Normal file
View file

@ -0,0 +1,60 @@
[gd_scene load_steps=7 format=3 uid="uid://c8hmum2w6aygy"]
[ext_resource type="Script" path="res://levels/Ceres/L20.gd" id="1_cjbjq"]
[ext_resource type="Texture2D" uid="uid://dursxelwwxe8u" path="res://sprites/common/placeholder/player.png" id="1_g5hs8"]
[ext_resource type="PackedScene" uid="uid://wo77i5ql2esb" path="res://sprites/common/kimberly/kimberly.tscn" id="2_5cnwp"]
[ext_resource type="PackedScene" uid="uid://cehe6sm8ly06u" path="res://sprites/common/player/player.tscn" id="3_slxde"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1jr1w"]
size = Vector2(20, 761)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_iptg6"]
size = Vector2(1283, 20)
[node name="L20" type="Node2D"]
script = ExtResource("1_cjbjq")
[node name="TextureRect" type="TextureRect" parent="."]
offset_left = 583.0
offset_top = 4.0
offset_right = 711.0
offset_bottom = 260.0
texture = ExtResource("1_g5hs8")
[node name="Label" type="Label" parent="."]
offset_left = 327.0
offset_top = 354.0
offset_right = 957.0
offset_bottom = 409.0
theme_override_font_sizes/font_size = 40
text = "Boss spawns at EBU pattern area"
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2(-11, 361.5)
shape = SubResource("RectangleShape2D_1jr1w")
[node name="StaticBody2D2" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D2"]
position = Vector2(1293, 358)
shape = SubResource("RectangleShape2D_1jr1w")
[node name="StaticBody2D3" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D3"]
position = Vector2(641.5, -9)
shape = SubResource("RectangleShape2D_iptg6")
[node name="StaticBody2D4" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D4"]
position = Vector2(644, 731)
shape = SubResource("RectangleShape2D_iptg6")
[node name="Kimberly" parent="." instance=ExtResource("2_5cnwp")]
position = Vector2(644, 133)
[node name="Player" parent="." instance=ExtResource("3_slxde")]
position = Vector2(652, 590)

52
levels/ui/ceres.gd Normal file
View file

@ -0,0 +1,52 @@
extends Control
func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
$VBoxContainer/L20.grab_focus()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _level():
# This is like autoloading the scene, only
# it happens after already loading the main scene.
get_tree().change_scene_to_file("res://backgounds/disclaimer.tscn")
#Global.live = 1
#Global.gamelevel = randi() % 3
#if Global.gamelevel == 0:
# get_tree().change_scene_to_file("res://backgounds/galaxy.tscn")
#elif Global.gamelevel == 1:
# get_tree().change_scene_to_file("res://backgounds/wormhole.tscn")
#else:
# get_tree().change_scene_to_file("res://backgounds/abstract.tscn")
#get_tree().root.add_child(title)
#get_tree().root.remove_child(boot)
#boot.queue_free()
func _input(event):
# Mouse in viewport coordinates.
if Input.is_action_just_pressed("ui_cancel"):
_on_back_pressed()
#print("Mouse Click/Unclick at: ", event.position)
# if highlighted == 1:
# _on_debug_pressed()
# if highlighted == 2:
# _on_exit_pressed()
# else:
# _on_start_pressed()
# elif Input.is_action_pressed("ui_up"):
# focus_next
func _on_back_pressed():
get_tree().change_scene_to_file("res://levels/ui/scene.tscn")
func _on_l_20_pressed():
Global.dplace = [1, 11, 19]
Global.live = 1
get_tree().change_scene_to_file("res://levels/ui/gameplay.tscn")

98
levels/ui/ceres.tscn Normal file
View file

@ -0,0 +1,98 @@
[gd_scene load_steps=6 format=3 uid="uid://bafdmqwba2oop"]
[ext_resource type="Script" path="res://levels/ui/ceres.gd" id="1_tox8g"]
[ext_resource type="Texture2D" uid="uid://bxa27c7gnivwx" path="res://backgounds/night-sky-at-ceres.jpg" id="2_2li8v"]
[ext_resource type="PackedScene" uid="uid://d31udhuuwrajn" path="res://levels/bottomhud.tscn" id="3_uojcp"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6u0xs"]
bg_color = Color(0, 0.8, 0, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_r2qrn"]
bg_color = Color(0, 0.8, 0, 1)
[node name="Ceres" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_tox8g")
[node name="Night Sky" type="TextureRect" parent="."]
layout_mode = 0
offset_right = 1280.0
offset_bottom = 720.0
texture = ExtResource("2_2li8v")
[node name="Game name" type="Label" parent="."]
layout_mode = 0
offset_left = 496.0
offset_top = 3.0
offset_right = 790.0
offset_bottom = 73.0
theme_override_font_sizes/font_size = 40
text = "Shrine of the doomed souls"
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -129.5
offset_top = -362.0
offset_right = 129.5
grow_horizontal = 2
grow_vertical = 0
[node name="L20" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "CERES_L20_DESC"
[node name="Lilytest" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "Unused
"
[node name="Dialogtest" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "Unused
"
[node name="Bullethell" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "Unused"
[node name="Credits" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "Unused"
[node name="WIP" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "Unused"
[node name="Back" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_r2qrn")
text = "BUTTON_RETURN"
[node name="Bottomhud" parent="." instance=ExtResource("3_uojcp")]
layout_mode = 1
[connection signal="pressed" from="VBoxContainer/L20" to="." method="_on_l_20_pressed"]
[connection signal="pressed" from="VBoxContainer/Back" to="." method="_on_back_pressed"]

View file

@ -30,12 +30,16 @@ texture = ExtResource("2_1w2er")
[node name="Game name" type="Label" parent="."]
layout_mode = 0
offset_left = 339.0
offset_left = 44.0
offset_top = 61.0
offset_right = 991.0
offset_right = 1234.0
offset_bottom = 207.0
theme_override_font_sizes/font_size = 106
text = "Debug Menu"
text = "MENU_DEBUG"
horizontal_alignment = 1
[node name="Bottomhud" parent="." instance=ExtResource("4_ogmre")]
layout_mode = 1
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
@ -44,9 +48,9 @@ anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -129.5
offset_top = -362.0
offset_right = 129.5
offset_left = -342.0
offset_top = -484.0
offset_right = 342.0
grow_horizontal = 2
grow_vertical = 0
@ -72,10 +76,7 @@ text = "Sound Test"
layout_mode = 2
theme_override_font_sizes/font_size = 80
theme_override_styles/focus = SubResource("StyleBoxFlat_r2qrn")
text = "Back"
[node name="Bottomhud" parent="." instance=ExtResource("4_ogmre")]
layout_mode = 1
text = "BUTTON_RETURN"
[connection signal="pressed" from="VBoxContainer/Gamepad Test" to="." method="_on_gamepad_test_pressed"]
[connection signal="pressed" from="VBoxContainer/Scene Selector2" to="." method="_on_scene_selector_pressed"]

View file

@ -207,7 +207,7 @@ text = "Boss Fight (Earth)"
layout_mode = 2
theme_override_font_sizes/font_size = 25
theme_override_styles/focus = SubResource("StyleBoxFlat_0dqsq")
text = "Back"
text = "BUTTON_RETURN"
[node name="Bottomhud" parent="." instance=ExtResource("4_a1ux8")]
layout_mode = 1

View file

@ -64,3 +64,7 @@ func _on_disclaimer_pressed():
func _on_testrooms_pressed():
get_tree().change_scene_to_file("res://levels/ui/testrooms.tscn")
func _on_ceres_pressed():
get_tree().change_scene_to_file("res://levels/ui/ceres.tscn")

View file

@ -59,6 +59,12 @@ theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "Shrine of the doomed souls"
[node name="Ceres" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "Ceres"
[node name="Results" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
@ -81,13 +87,14 @@ text = "Work in Progress"
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_r2qrn")
text = "Back"
text = "BUTTON_RETURN"
[node name="Bottomhud" parent="." instance=ExtResource("4_2y7h7")]
layout_mode = 1
[connection signal="pressed" from="VBoxContainer/Disclaimer" to="." method="_on_disclaimer_pressed"]
[connection signal="pressed" from="VBoxContainer/Testrooms" to="." method="_on_testrooms_pressed"]
[connection signal="pressed" from="VBoxContainer/Ceres" to="." method="_on_ceres_pressed"]
[connection signal="pressed" from="VBoxContainer/Results" to="." method="_on_results_pressed"]
[connection signal="pressed" from="VBoxContainer/Credits" to="." method="_on_credits_pressed"]
[connection signal="pressed" from="VBoxContainer/WIP" to="." method="_on_wip_pressed"]

View file

@ -83,7 +83,7 @@ text = "Explosion"
layout_mode = 2
theme_override_font_sizes/font_size = 25
theme_override_styles/focus = SubResource("StyleBoxFlat_0dqsq")
text = "Back"
text = "BUTTON_RETURN"
[node name="Bottomhud" parent="." instance=ExtResource("4_xxv3m")]
layout_mode = 1

View file

@ -23,6 +23,7 @@ grow_vertical = 2
script = ExtResource("1_3bg6p")
[node name="Night Sky" type="TextureRect" parent="."]
layout_mode = 0
offset_right = 1280.0
offset_bottom = 720.0
texture = ExtResource("2_x41qm")
@ -65,7 +66,7 @@ text = "Sound Effects"
layout_mode = 2
theme_override_font_sizes/font_size = 80
theme_override_styles/focus = SubResource("StyleBoxFlat_wro6j")
text = "Back"
text = "BUTTON_RETURN"
[node name="Bottomhud" parent="." instance=ExtResource("4_2a53a")]
layout_mode = 1

View file

@ -89,7 +89,7 @@ text = "Unused"
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_r2qrn")
text = "Back"
text = "BUTTON_RETURN"
[node name="Bottomhud" parent="." instance=ExtResource("4_jvl8w")]
layout_mode = 1

View file

@ -38,6 +38,9 @@ theme_override_font_sizes/font_size = 95
text = "GAME_NAME"
horizontal_alignment = 1
[node name="Bottomhud" parent="." instance=ExtResource("4_0qcfw")]
layout_mode = 1
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 7
@ -45,9 +48,9 @@ anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -129.5
offset_left = -322.0
offset_top = -362.0
offset_right = 129.5
offset_right = 322.0
grow_horizontal = 2
grow_vertical = 0
@ -55,22 +58,19 @@ grow_vertical = 0
layout_mode = 2
theme_override_font_sizes/font_size = 80
theme_override_styles/focus = SubResource("StyleBoxFlat_821nm")
text = "Start"
text = "BUTTON_START"
[node name="Debug" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 80
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "Debug"
text = "BUTTON_DEBUG"
[node name="Exit" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 80
theme_override_styles/focus = SubResource("StyleBoxFlat_r2qrn")
text = "Exit"
[node name="Bottomhud" parent="." instance=ExtResource("4_0qcfw")]
layout_mode = 1
text = "BUTTON_EXIT"
[connection signal="pressed" from="VBoxContainer/Start" to="." method="_on_start_pressed"]
[connection signal="pressed" from="VBoxContainer/Debug" to="." method="_on_debug_pressed"]