cutscenes

This commit is contained in:
Page Asgardius 2024-05-12 12:54:52 -07:00
parent 662da6fe1c
commit 599fc5f5ef
10 changed files with 255 additions and 77 deletions

View file

@ -9,6 +9,8 @@ var wait
var bossready = false
var playerx
var playery
var ccutscene
const cutscenes = [["res://levels/Cutscenes/opening.tscn", "res://levels/ui/gameplay.tscn", "res://music/scholartrip.wav", true]]
const pcnames = ["Midori Asgardius", "Diana Asgardius", null, "Kimberly Arch", null, null, null, null, null, "Natasha Dostoyevsky"]
const npcnames = ["Lily", null, null, "Kimberly Arch", null, null, null, null, null, "Natasha Dostoyevsky"]
const pcfaces = [["res://sprites/common/midori/face.png"], ["res://sprites/common/tuna/face.png"], [null], ["res://sprites/common/kimberly/face.png"], [null], [null], [null], [null], [null], ["res://sprites/common/natasha/face.png"]]

View file

@ -13,96 +13,78 @@ var ishud = true
func _ready():
add_child(bgsound)
add_child(sfx1)
if Global.debug:
level = load(Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][0]).instantiate()
#player = load(Global.pchars[Global.dcpchar]).instantiate()
musictrack = Global.musictracks[Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][1]]
isboss = Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][2]
else:
level = load(Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][0]).instantiate()
# player = load(Global.pchars[Global.cpchar]).instantiate()
musictrack = Global.musictracks[Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][1]]
isboss = Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][2]
#if Global.cspawnarea[0] != null && Global.cspawnarea[0] != null:
# player.position.x = Global.cspawnarea[0]
# player.position.y = Global.cspawnarea[1]
#elif Global.debug:
# player.position.x = Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][1]
# player.position.y = Global.places[Global.dplace[0]][Global.dplace[1]][Global.dplace[2]][2]
#else:
# player.position.x = Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][1]
# player.position.y = Global.places[Global.cplace[0]][Global.cplace[1]][Global.cplace[2]][2]
level = load(Global.cutscenes[Global.ccutscene][0]).instantiate()
musictrack = Global.cutscenes[Global.ccutscene][2]
music = load(musictrack)
get_tree().root.add_child.call_deferred(level)
get_tree().root.add_child.call_deferred(bhud)
#get_tree().root.add_child.call_deferred(player)
bgsound.stream = music
if !isboss:
bgsound.play(0)
bgsound.play(0)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
Global.xm = 0
Global.ym = 0
var velocity = Vector2.ZERO
if Global.live == 1 && !Input.is_key_pressed(KEY_V) && !Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER):
if Input.get_joy_axis(0,JOY_AXIS_LEFT_X) > 0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) > 0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_X) < -0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) < -0.2:
Global.xm = Input.get_joy_axis(0,JOY_AXIS_LEFT_X)
Global.ym = Input.get_joy_axis(0,JOY_AXIS_LEFT_Y)
else:
if Input.is_action_pressed("ui_left"):
Global.xm = -1
if Input.is_action_pressed("ui_right"):
Global.xm = 1
if Input.is_action_pressed("ui_up"):
Global.ym = -1
if Input.is_action_pressed("ui_down"):
Global.ym = 1
#func _process(delta):
#Global.xm = 0
#Global.ym = 0
#var velocity = Vector2.ZERO
#if Global.live == 1 && !Input.is_key_pressed(KEY_V) && !Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER):
# if Input.get_joy_axis(0,JOY_AXIS_LEFT_X) > 0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) > 0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_X) < -0.2 || Input.get_joy_axis(0,JOY_AXIS_LEFT_Y) < -0.2:
# Global.xm = Input.get_joy_axis(0,JOY_AXIS_LEFT_X)
# Global.ym = Input.get_joy_axis(0,JOY_AXIS_LEFT_Y)
# else:
# if Input.is_action_pressed("ui_left"):
# Global.xm = -1
# if Input.is_action_pressed("ui_right"):
# Global.xm = 1
# if Input.is_action_pressed("ui_up"):
# Global.ym = -1
# if Input.is_action_pressed("ui_down"):
# Global.ym = 1
#velocity = (Vector2.RIGHT.rotated(rotation) * -100 * Global.xm * delta)-Vector2.UP.rotated(rotation) * -100 * Global.ym * delta
func _input(event):
if (Input.is_key_pressed(KEY_ESCAPE) || Input.is_joy_button_pressed(0,JOY_BUTTON_BACK)) && Global.cdialog == []:
if (Input.is_key_pressed(KEY_ESCAPE) || Input.is_joy_button_pressed(0,JOY_BUTTON_BACK)) && Global.debug:
Global.live = 0
Global.bossready = false
get_tree().root.remove_child(bhud)
get_tree().root.remove_child(player)
#get_tree().root.remove_child(player)
get_tree().root.remove_child(level)
if Global.debug:
get_tree().change_scene_to_file("res://levels/ui/scene.tscn")
else:
get_tree().change_scene_to_file("res://title.tscn")
if (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_UP)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_UP))):
if Global.debug:
if Global.dparty[0][0] != null:
Global.dcpchar = 0
else:
if Global.party[0][0] != null:
Global.cpchar = 0
elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_RIGHT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_RIGHT))):
if Global.debug:
if Global.dparty[1][0] != null:
Global.dcpchar = 1
else:
if Global.party[1][0] != null:
Global.cpchar = 1
elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_DOWN)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_DOWN))):
if Global.debug:
if Global.dparty[2][0] != null:
Global.dcpchar = 2
else:
if Global.party[2][0] != null:
Global.cpchar = 2
elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_LEFT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_LEFT))):
if Global.debug:
if Global.dparty[3][0] != null:
Global.dcpchar = 3
else:
if Global.party[3][0] != null:
Global.cpchar = 3
if Global.bossready:
Global.bossready = false
sfx1.stream = load(Global.sfxtracks[1])
sfx1.play(0)
bgsound.play(0)
#if (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_UP)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_UP))):
# if Global.debug:
# if Global.dparty[0][0] != null:
# Global.dcpchar = 0
# else:
# if Global.party[0][0] != null:
# Global.cpchar = 0
#elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_RIGHT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_RIGHT))):
# if Global.debug:
# if Global.dparty[1][0] != null:
# Global.dcpchar = 1
# else:
# if Global.party[1][0] != null:
# Global.cpchar = 1
#elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_DOWN)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_DOWN))):
# if Global.debug:
# if Global.dparty[2][0] != null:
# Global.dcpchar = 2
# else:
# if Global.party[2][0] != null:
# Global.cpchar = 2
#elif (Global.live == 1 && (Input.is_key_pressed(KEY_V) && Input.is_key_pressed(KEY_LEFT)) ||(Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) && Input.is_joy_button_pressed(0,JOY_BUTTON_DPAD_LEFT))):
# if Global.debug:
# if Global.dparty[3][0] != null:
# Global.dcpchar = 3
# else:
# if Global.party[3][0] != null:
# Global.cpchar = 3
#if Global.bossready:
# Global.bossready = false
# sfx1.stream = load(Global.sfxtracks[1])
# sfx1.play(0)
# bgsound.play(0)

76
levels/ui/cscene.gd Normal file
View file

@ -0,0 +1,76 @@
extends Control
func _ready():
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
$"VBoxContainer/Disclaimer".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/debug.tscn")
func _on_credits_pressed():
#get_tree().change_scene_to_file("res://levels/ui/credits.tscn")
pass
func _on_wip_pressed():
#get_tree().change_scene_to_file("res://backgounds/wip.tscn")
pass
func _on_results_pressed():
#get_tree().change_scene_to_file("res://backgounds/result.tscn")
pass
func _on_disclaimer_pressed():
#Global.debug = false
Global.ccutscene = 0
get_tree().change_scene_to_file("res://levels/ui/Cutscenes.tscn")
func _on_testrooms_pressed():
#get_tree().change_scene_to_file("res://levels/ui/testrooms.tscn")
pass
func _on_ceres_pressed():
#get_tree().change_scene_to_file("res://levels/ui/ceres.tscn")
pass

102
levels/ui/cscene.tscn Normal file
View file

@ -0,0 +1,102 @@
[gd_scene load_steps=6 format=3 uid="uid://bk7btffr6w0sw"]
[ext_resource type="Script" path="res://levels/ui/cscene.gd" id="1_ka10y"]
[ext_resource type="Texture2D" uid="uid://bxa27c7gnivwx" path="res://backgounds/night-sky-at-ceres.jpg" id="2_745if"]
[ext_resource type="PackedScene" uid="uid://d31udhuuwrajn" path="res://levels/bottomhud.tscn" id="3_rvvbf"]
[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="Cscene" 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_ka10y")
[node name="Night Sky" type="TextureRect" parent="."]
layout_mode = 0
offset_right = 1280.0
offset_bottom = 720.0
texture = ExtResource("2_745if")
[node name="Game name" type="Label" parent="."]
layout_mode = 0
offset_left = 49.0
offset_top = 3.0
offset_right = 1224.0
offset_bottom = 73.0
theme_override_font_sizes/font_size = 40
text = "BUTTON_CUTSCENES"
horizontal_alignment = 1
[node name="Bottomhud" parent="." instance=ExtResource("3_rvvbf")]
layout_mode = 1
[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 = -238.5
offset_top = -395.0
offset_right = 238.5
grow_horizontal = 2
grow_vertical = 0
[node name="Disclaimer" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "CUTSCENE_0_NAME"
[node name="Testrooms" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "BUTTON_PLACEHOLDER"
[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 = "BUTTON_PLACEHOLDER"
[node name="Results" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "BUTTON_PLACEHOLDER"
[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 = "BUTTON_PLACEHOLDER"
[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 = "BUTTON_PLACEHOLDER"
[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"
[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"]
[connection signal="pressed" from="VBoxContainer/Back" to="." method="_on_back_pressed"]

View file

@ -68,3 +68,7 @@ func _on_testrooms_pressed():
func _on_ceres_pressed():
get_tree().change_scene_to_file("res://levels/ui/ceres.tscn")
func _on_cutscene_pressed():
get_tree().change_scene_to_file("res://levels/ui/cscene.tscn")

View file

@ -87,6 +87,12 @@ theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "BUTTON_WIP"
[node name="Cutscene" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
theme_override_styles/focus = SubResource("StyleBoxFlat_6u0xs")
text = "BUTTON_CUTSCENES"
[node name="Back" type="Button" parent="VBoxContainer"]
layout_mode = 2
theme_override_font_sizes/font_size = 32
@ -99,4 +105,5 @@ text = "BUTTON_RETURN"
[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"]
[connection signal="pressed" from="VBoxContainer/Cutscene" to="." method="_on_cutscene_pressed"]
[connection signal="pressed" from="VBoxContainer/Back" to="." method="_on_back_pressed"]

View file

@ -11,7 +11,10 @@ func _ready():
speciality = Global.pcspecialities[Global.dparty[Global.dcpchar][0]]
isvisible = $VisibleOnScreenNotifier2D
add_to_group(btype)
rotation = velocity.angle()
if direction == null:
rotation = velocity.angle()
else:
rotation = direction.angle()
#pass # Replace with function body.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View file

@ -4,7 +4,7 @@
[ext_resource type="Texture2D" uid="uid://bxbokpmpq22mg" path="res://sprites/common/bullet/arrow.png" id="2_1l581"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_g125y"]
size = Vector2(129, 60)
size = Vector2(129, 20)
[node name="Arrow" type="Area2D"]
script = ExtResource("1_xh7h3")
@ -18,8 +18,8 @@ position = Vector2(0.5, 0)
shape = SubResource("RectangleShape2D_g125y")
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
position = Vector2(-7.15256e-07, -1.43051e-06)
scale = Vector2(3, 3)
position = Vector2(0.5, 0)
scale = Vector2(6.45, 1)
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View file

@ -24,6 +24,7 @@ BUTTON_CERES;Ceres;Ceres;ケレス
BUTTON_SCORESCREEN;Result Screen;Pantalla de resultados;結果を表示
BUTTON_CREDITS;Credits;Creditos;クレジット画面
BUTTON_WIP;Work in Progress;Aún en desarrollo;まだ開発中
BUTTON_CUTSCENES;Cutscenes;Escenas;カットシーン
BUTTON_SPAWNTEST;Spawn Test;Prueba de generación;スポーンテスト
BUTTOM_TESTBOSS;Test Boss (Lily);Jefe de prueba (Lily);テストボス(リリー)
BUTTON_DIALOGTEST;Dialog Test;Prueba de diálogos;ダイアログテスト
@ -86,4 +87,5 @@ DIALOG_CERES_L20_0;I wont be a healer;No seré una sanadora;私はヒーラ
DIALOG_CERES_L20_1;I want a friendly challenge, loser will obey the winner;Haremos un reto amistoso, El perdedor obedecerá al ganador;友好的な挑戦をしたい、負けた者は勝者に従う
DIALOG_CERES_L20_2;My magic wand VS your bow;Mi vara mágica contra tu arco;私の魔法の杖 VS あなたの弓
CERES_L20_DESC;Kimberlys Challenge;Reto de Kimberly;キンバリーの挑戦
CUTSCENE_0_NAME;Prologue;Prólogo;プロローグ
CUTSCENE_0_0;most underrated children will be the best magicians\nFalcighol Arch, Kaizo Magic School founder;Los niños más subestimados serán los mejores magos\nFalcighol Arch, fundador de la Escuela de Magia Kaizo;最も過小評価されている子供たちが最高のマジシャンになるだろう\nファルシゴール・アーチ、カイゾー・マジック・スクール創設者

1 en es ja
24 BUTTON_SCORESCREEN Result Screen Pantalla de resultados 結果を表示
25 BUTTON_CREDITS Credits Creditos クレジット画面
26 BUTTON_WIP Work in Progress Aún en desarrollo まだ開発中
27 BUTTON_CUTSCENES Cutscenes Escenas カットシーン
28 BUTTON_SPAWNTEST Spawn Test Prueba de generación スポーンテスト
29 BUTTOM_TESTBOSS Test Boss (Lily) Jefe de prueba (Lily) テストボス(リリー)
30 BUTTON_DIALOGTEST Dialog Test Prueba de diálogos ダイアログテスト
87 DIALOG_CERES_L20_1 I want a friendly challenge, loser will obey the winner Haremos un reto amistoso, El perdedor obedecerá al ganador 友好的な挑戦をしたい、負けた者は勝者に従う
88 DIALOG_CERES_L20_2 My magic wand VS your bow Mi vara mágica contra tu arco 私の魔法の杖 VS あなたの弓
89 CERES_L20_DESC Kimberly’s Challenge Reto de Kimberly キンバリーの挑戦
90 CUTSCENE_0_NAME Prologue Prólogo プロローグ
91 CUTSCENE_0_0 most underrated children will be the best magicians\nFalcighol Arch, Kaizo Magic School founder Los niños más subestimados serán los mejores magos\nFalcighol Arch, fundador de la Escuela de Magia Kaizo 最も過小評価されている子供たちが最高のマジシャンになるだろう\nファルシゴール・アーチ、カイゾー・マジック・スクール創設者