cutscenes
This commit is contained in:
parent
662da6fe1c
commit
599fc5f5ef
10 changed files with 255 additions and 77 deletions
|
@ -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
76
levels/ui/cscene.gd
Normal 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
102
levels/ui/cscene.tscn
Normal 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"]
|
|
@ -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")
|
||||
|
|
|
@ -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"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue