Skip to content

Commit

Permalink
implemented cutscenes, but the hub is broken, so they come back to sp…
Browse files Browse the repository at this point in the history
…ace scene start
  • Loading branch information
kednar committed May 4, 2017
1 parent eea912f commit 3dadff5
Show file tree
Hide file tree
Showing 15 changed files with 196 additions and 41 deletions.
3 changes: 3 additions & 0 deletions rooms/space/bag.esc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
say player "I need some way to aim my thrust!"
stop

> [has_bag,has_pedals,has_screw,has_seat]
change_scene "res://rooms/space/cutscene_pipe.tscn"

:look

> [!bag_line1]
Expand Down
26 changes: 26 additions & 0 deletions rooms/space/cutscene_final.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
extends Node2D

var seconds = 0
var space_scene
var has_dialogue = true

func skip_dialogue():
if has_dialogue:
get_node("text").set_bbcode("And despite all the excitement, the best room is still a restroom.")
has_dialogue = false

func _input(event):
if event.type == InputEvent.MOUSE_BUTTON && event.pressed && has_dialogue == false:
get_tree().change_scene_to(space_scene)

func _ready():
# Preload main scene
space_scene = preload("res://rooms/space/space_1.tscn")
set_process_input(true)
set_process(true)

func _process(delta):
# Add up seconds passed
seconds += delta
if (seconds >= 5 && has_dialogue) || seconds >= 10:
skip_dialogue()
49 changes: 49 additions & 0 deletions rooms/space/cutscene_final.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[gd_scene load_steps=6 format=1]

[ext_resource path="res://globals/scene.gd" type="Script" id=1]
[ext_resource path="res://rooms/space/cutscene_final.gd" type="Script" id=2]
[ext_resource path="res://rooms/space/sprites/cutscene_final.png" type="Texture" id=3]
[ext_resource path="res://fonts/opensans72.fnt" type="BitmapFont" id=4]
[ext_resource path="res://globals/game.scn" type="PackedScene" id=5]

[node name="space_intro" type="Node2D"]

script/script = ExtResource( 1 )

[node name="Node2D" type="Node2D" parent="."]

script/script = ExtResource( 2 )

[node name="TextureFrame" type="TextureFrame" parent="Node2D"]

focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 1920.0
margin/bottom = 1080.0
texture = ExtResource( 3 )
expand = true
stretch_mode = 0

[node name="text" type="RichTextLabel" parent="Node2D"]

rect/scale = Vector2( 0.5, 0.5 )
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 660.0
margin/top = 950.0
margin/right = 1884.0
margin/bottom = 1180.0
custom_fonts/normal_font = ExtResource( 4 )
bbcode/enabled = true
bbcode/bbcode = "Well, the toilet flushed me out, but it also rushed me back in."
visible_characters = -1

[node name="game" parent="." instance=ExtResource( 5 )]


14 changes: 6 additions & 8 deletions rooms/space/cutscene_pipe.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@ var has_dialogue = true

func skip_dialogue():
if has_dialogue:
get_node("text").set_bbcode("")
get_node("text").set_bbcode("Why did I even take this?")
has_dialogue = false
else:
get_tree().change_scene_to(space_scene)


func _input(event):
if event.type == InputEvent.MOUSE_BUTTON && event.pressed:
skip_dialogue()
if event.type == InputEvent.MOUSE_BUTTON && event.pressed && has_dialogue == false:
get_tree().change_scene_to(space_scene)

func _ready():
# Preload main scene
space_scene = preload("res://rooms/space/space_1.tscn")
space_scene = preload("res://rooms/space/cutscene_wee.tscn")
set_process_input(true)
set_process(true)

func _process(delta):
# Add up seconds passed
seconds += delta
if (seconds >= 5 && has_dialogue) || seconds >= 10:
if (seconds >= 2 && has_dialogue) || seconds >= 10:
skip_dialogue()
53 changes: 20 additions & 33 deletions rooms/space/cutscene_pipe.tscn
Original file line number Diff line number Diff line change
@@ -1,48 +1,35 @@
[gd_scene load_steps=8 format=1]
[gd_scene load_steps=6 format=1]

[ext_resource path="res://globals/scene.gd" type="Script" id=1]
[ext_resource path="res://rooms/space/cutscene_pipe.gd" type="Script" id=2]
[ext_resource path="res://rooms/space/sprites/intro_bg.png" type="Texture" id=3]
[ext_resource path="res://rooms/space/video/assembly.ogv" type="VideoStream" id=2]
[ext_resource path="res://rooms/space/cutscene_pipe.gd" type="Script" id=3]
[ext_resource path="res://fonts/opensans72.fnt" type="BitmapFont" id=4]
[ext_resource path="res://globals/game.scn" type="PackedScene" id=5]

[sub_resource type="CanvasItemShader" id=1]

_code = {
"fragment": "",
"fragment_ofs": 0,
"light": "",
"light_ofs": 0,
"vertex": "",
"vertex_ofs": 0
}

[sub_resource type="CanvasItemMaterial" id=2]

shader/shader = SubResource( 1 )
shader/shading_mode = 0

[node name="space_intro" type="Node2D"]

script/script = ExtResource( 1 )

[node name="Node2D" type="Node2D" parent="."]

script/script = ExtResource( 2 )
[node name="VideoPlayer" type="VideoPlayer" parent="."]

[node name="TextureFrame" type="TextureFrame" parent="Node2D"]

material/material = SubResource( 2 )
focus/ignore_mouse = true
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 1920.0
margin/bottom = 1080.0
texture = ExtResource( 3 )
stretch_mode = 0
stream/audio_track = 0
stream/stream = ExtResource( 2 )
stream/volume_db = 0.0
stream/autoplay = true
stream/paused = false
expand = true

[node name="Node2D" type="Node2D" parent="."]

script/script = ExtResource( 3 )

[node name="text" type="RichTextLabel" parent="Node2D"]

Expand All @@ -51,13 +38,13 @@ focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 747.0
margin/top = 930.0
margin/right = 1971.0
margin/bottom = 1160.0
margin/left = 670.0
margin/top = 960.0
margin/right = 1894.0
margin/bottom = 1190.0
custom_fonts/normal_font = ExtResource( 4 )
bbcode/enabled = true
bbcode/bbcode = "Thank to USPee standardization, I can plug this into anything!"
bbcode/bbcode = "I present to you: THE FLUSHDRIVE"
visible_characters = -1

[node name="game" parent="." instance=ExtResource( 5 )]
Expand Down
26 changes: 26 additions & 0 deletions rooms/space/cutscene_wee.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
extends Node2D

var seconds = 0
var space_scene
var has_dialogue = true

func skip_dialogue():
if has_dialogue:
get_node("text").set_bbcode("")
has_dialogue = false

func _input(event):
if event.type == InputEvent.MOUSE_BUTTON && event.pressed && has_dialogue == false:
get_tree().change_scene_to(space_scene)

func _ready():
# Preload main scene
space_scene = preload("res://rooms/space/cutscene_final.tscn")
set_process_input(true)
set_process(true)

func _process(delta):
# Add up seconds passed
seconds += delta
if (seconds >= 2 && has_dialogue) || seconds >= 10:
skip_dialogue()
49 changes: 49 additions & 0 deletions rooms/space/cutscene_wee.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[gd_scene load_steps=6 format=1]

[ext_resource path="res://globals/scene.gd" type="Script" id=1]
[ext_resource path="res://rooms/space/cutscene_wee.gd" type="Script" id=2]
[ext_resource path="res://rooms/space/sprites/cutscene_flying.png" type="Texture" id=3]
[ext_resource path="res://fonts/opensans72.fnt" type="BitmapFont" id=4]
[ext_resource path="res://globals/game.scn" type="PackedScene" id=5]

[node name="space_intro" type="Node2D"]

script/script = ExtResource( 1 )

[node name="Node2D" type="Node2D" parent="."]

script/script = ExtResource( 2 )

[node name="TextureFrame" type="TextureFrame" parent="Node2D"]

focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 1920.0
margin/bottom = 1080.0
texture = ExtResource( 3 )
expand = true
stretch_mode = 0

[node name="text" type="RichTextLabel" parent="Node2D"]

rect/scale = Vector2( 0.5, 0.5 )
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 870.0
margin/top = 990.0
margin/right = 2094.0
margin/bottom = 1220.0
custom_fonts/normal_font = ExtResource( 4 )
bbcode/enabled = true
bbcode/bbcode = "WEEEEEEEEEEEEEE!"
visible_characters = -1

[node name="game" parent="." instance=ExtResource( 5 )]


3 changes: 3 additions & 0 deletions rooms/space/pedals.esc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
say player "I need some way to aim my thrust!"
stop

> [has_bag,has_pedals,has_screw,has_seat]
change_scene "res://rooms/space/cutscene_pipe.tscn"

:look

> [!pedals_line1]
Expand Down
3 changes: 3 additions & 0 deletions rooms/space/pipe.esc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ set_active pipe false
set_global has_pipe true
set_global start_moving true

> [has_bag,has_pedals,has_screw,has_seat]
change_scene "res://rooms/space/cutscene_pipe.tscn"

:look
say player "That’s my number one fluid evacuation hose!"
3 changes: 3 additions & 0 deletions rooms/space/screw.esc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
say player "I need some way to aim my thrust!"
stop

> [has_bag,has_pedals,has_screw,has_seat]
change_scene "res://rooms/space/cutscene_pipe.tscn"

:look

> [!screw_line1]
Expand Down
3 changes: 3 additions & 0 deletions rooms/space/seat.esc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
say player "I need some way to aim my thrust!"
stop

> [has_bag,has_pedals,has_screw,has_seat]
change_scene "res://rooms/space/cutscene_pipe.tscn"

:look

> [!seat_line1]
Expand Down
5 changes: 5 additions & 0 deletions rooms/space/space_1.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ stretch_mode = 0

[node name="seat" parent="." instance=ExtResource( 7 )]

editor/display_folded = true
rect/rotation = -44.9999
margin/left = 1145.0
margin/top = 727.0
Expand All @@ -84,6 +85,7 @@ transform/pos = Vector2( -40.4012, 132.746 )

[node name="ship" parent="." instance=ExtResource( 8 )]

editor/display_folded = true
margin/left = 106.0
margin/top = 739.0
margin/right = 406.0
Expand All @@ -96,6 +98,7 @@ transform/rot = -44.9999

[node name="bag" parent="." instance=ExtResource( 9 )]

editor/display_folded = true
rect/rotation = -30.0
margin/left = 1556.0
margin/top = 777.0
Expand All @@ -110,6 +113,7 @@ transform/rot = -14.9999

[node name="pedals" parent="." instance=ExtResource( 10 )]

editor/display_folded = true
rect/rotation = -30.0
margin/left = 1569.0
margin/top = 267.0
Expand All @@ -124,6 +128,7 @@ transform/rot = -14.9999

[node name="screw" parent="." instance=ExtResource( 11 )]

editor/display_folded = true
margin/left = 1172.0
margin/top = 267.0
margin/right = 1272.0
Expand Down
Binary file added rooms/space/sprites/cutscene_flying.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified rooms/space/sprites/scene_kednar_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rooms/space/video/assembly.ogv
Binary file not shown.

0 comments on commit 3dadff5

Please sign in to comment.