summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.import/blauuu.png-22949d4eb9161508bb9aa3294d24b7e6.stexbin1436 -> 0 bytes
-rw-r--r--.import/rooot.png-53269f53a9eb787988926f90e6b542fb.stexbin1431 -> 0 bytes
-rw-r--r--components/HackButton.gd27
-rw-r--r--components/HackButton.tscn37
-rw-r--r--components/button.gd2
-rw-r--r--components/button.tscn1
-rw-r--r--components/textreveal.gd46
-rw-r--r--components/textreveal.tscn19
-rw-r--r--scenes/introduction.gd11
-rw-r--r--scenes/introduction.tscn13
-rw-r--r--scenes/menu.gd9
-rw-r--r--scenes/menu.tscn7
-rw-r--r--textures/blauuu.pngbin1534 -> 0 bytes
-rw-r--r--textures/blauuu.png.import34
-rw-r--r--textures/rooot.pngbin1529 -> 0 bytes
-rw-r--r--textures/rooot.png.import34
16 files changed, 105 insertions, 135 deletions
diff --git a/.import/blauuu.png-22949d4eb9161508bb9aa3294d24b7e6.stex b/.import/blauuu.png-22949d4eb9161508bb9aa3294d24b7e6.stex
deleted file mode 100644
index 11c4463..0000000
--- a/.import/blauuu.png-22949d4eb9161508bb9aa3294d24b7e6.stex
+++ /dev/null
Binary files differ
diff --git a/.import/rooot.png-53269f53a9eb787988926f90e6b542fb.stex b/.import/rooot.png-53269f53a9eb787988926f90e6b542fb.stex
deleted file mode 100644
index 74f4e36..0000000
--- a/.import/rooot.png-53269f53a9eb787988926f90e6b542fb.stex
+++ /dev/null
Binary files differ
diff --git a/components/HackButton.gd b/components/HackButton.gd
deleted file mode 100644
index 9dc1b30..0000000
--- a/components/HackButton.gd
+++ /dev/null
@@ -1,27 +0,0 @@
-extends Area2D
-
-signal on_click()
-
-var is_hovered = false
-
-onready var sprite : Sprite = $Sprite
-export(String, FILE, '*.png') var hovered_texture = "res://textures/blauuu.png"
-onready var _hovered_texture : Texture = load(hovered_texture)
-onready var _default_texture : Texture = sprite.texture
-
-func _on_HackButton_mouse_entered():
- is_hovered = true
- sprite.texture = _hovered_texture
-
-func _on_HackButton_mouse_exited():
- is_hovered = false
- sprite.texture = _default_texture
-
-
-func _on_HackButton_input_event(viewport, event, shape_idx):
- if not (event is InputEventMouseButton):
- return
- if not event.pressed:
- return
- emit_signal("on_click")
-
diff --git a/components/HackButton.tscn b/components/HackButton.tscn
deleted file mode 100644
index dd665f3..0000000
--- a/components/HackButton.tscn
+++ /dev/null
@@ -1,37 +0,0 @@
-[gd_scene load_steps=6 format=2]
-
-[ext_resource path="res://textures/rooot.png" type="Texture" id=1]
-[ext_resource path="res://components/HackButton.gd" type="Script" id=2]
-
-[sub_resource type="Shader" id=1]
-code = "shader_type canvas_item;
-uniform vec4 glow_color : hint_color = vec4(1,1,1,1);
-
-void fragment() {
- COLOR = texture(TEXTURE, UV) + glow_color;
-}
-"
-
-[sub_resource type="ShaderMaterial" id=2]
-shader = SubResource( 1 )
-shader_param/glow_color = Color( 0.254902, 0, 0, 1 )
-
-[sub_resource type="RectangleShape2D" id=3]
-extents = Vector2( 100, 100 )
-
-[node name="HackButton" type="Area2D"]
-monitoring = false
-monitorable = false
-script = ExtResource( 2 )
-
-[node name="Sprite" type="Sprite" parent="."]
-material = SubResource( 2 )
-scale = Vector2( 0.5, 0.5 )
-texture = ExtResource( 1 )
-
-[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
-shape = SubResource( 3 )
-
-[connection signal="input_event" from="." to="." method="_on_HackButton_input_event"]
-[connection signal="mouse_entered" from="." to="." method="_on_HackButton_mouse_entered"]
-[connection signal="mouse_exited" from="." to="." method="_on_HackButton_mouse_exited"]
diff --git a/components/button.gd b/components/button.gd
index 4bce086..1171cbd 100644
--- a/components/button.gd
+++ b/components/button.gd
@@ -55,6 +55,8 @@ func _on_ButtonTest_input_event(viewport, event, shape_idx):
_set_pressed(false)
return
_set_pressed(true)
+ if not (event.button_index == BUTTON_LEFT):
+ return
emit_signal("on_click")
func _set_all_textures(l, m, r):
diff --git a/components/button.tscn b/components/button.tscn
index f7d0cea..6248b45 100644
--- a/components/button.tscn
+++ b/components/button.tscn
@@ -48,7 +48,6 @@ __meta__ = {
[node name="Hitbox" type="CollisionShape2D" parent="."]
shape = SubResource( 3 )
-
[connection signal="input_event" from="." to="." method="_on_ButtonTest_input_event"]
[connection signal="mouse_entered" from="." to="." method="_on_ButtonTest_mouse_entered"]
[connection signal="mouse_exited" from="." to="." method="_on_ButtonTest_mouse_exited"]
diff --git a/components/textreveal.gd b/components/textreveal.gd
new file mode 100644
index 0000000..0d9004c
--- /dev/null
+++ b/components/textreveal.gd
@@ -0,0 +1,46 @@
+extends Node2D
+
+onready var font_source : RichTextLabel = $FontSource
+signal finished_reveal()
+
+export var text = "Text"
+export var speed = 100.0
+
+var revealed = 0
+var started = false
+var finished = false
+
+var label
+
+# Called when the node enters the scene tree for the first time.
+func _ready():
+ label = RichTextLabel.new()
+ label.theme = font_source.theme
+ add_child(label)
+ label.rect_position = -label.rect_size / 2
+
+
+func _show_text(text):
+ label.add_text(text)
+ label.rect_position = -label.rect_size / 2
+
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+func _process(delta):
+ if started:
+ var reveal = speed * delta
+ var oldreveal = revealed
+ revealed += reveal
+ var t = text.substr(oldreveal, revealed)
+ _show_text(t)
+ if text.length() <= revealed:
+ started = false
+ finished = true
+ emit_signal("finished_reveal")
+
+func start():
+ started = true
+ finished = false
+
+
+func has_finished():
+ return finished
diff --git a/components/textreveal.tscn b/components/textreveal.tscn
new file mode 100644
index 0000000..19a1833
--- /dev/null
+++ b/components/textreveal.tscn
@@ -0,0 +1,19 @@
+[gd_scene load_steps=5 format=2]
+
+[ext_resource path="res://components/textreveal.gd" type="Script" id=1]
+[ext_resource path="res://fonts/Fipps-Regular.otf" type="DynamicFontData" id=2]
+
+[sub_resource type="DynamicFont" id=1]
+font_data = ExtResource( 2 )
+
+[sub_resource type="Theme" id=2]
+default_font = SubResource( 1 )
+
+[node name="Node2D" type="Node2D"]
+script = ExtResource( 1 )
+
+[node name="FontSource" type="RichTextLabel" parent="."]
+theme = SubResource( 2 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
diff --git a/scenes/introduction.gd b/scenes/introduction.gd
new file mode 100644
index 0000000..09692b0
--- /dev/null
+++ b/scenes/introduction.gd
@@ -0,0 +1,11 @@
+extends CanvasLayer
+
+onready var textreveal = $Textreveal
+
+# Called when the node enters the scene tree for the first time.
+func _ready():
+ textreveal.start()
+
+
+func _on_Textreveal_finished_reveal():
+ pass
diff --git a/scenes/introduction.tscn b/scenes/introduction.tscn
new file mode 100644
index 0000000..42a4bfc
--- /dev/null
+++ b/scenes/introduction.tscn
@@ -0,0 +1,13 @@
+[gd_scene load_steps=3 format=2]
+
+[ext_resource path="res://components/textreveal.tscn" type="PackedScene" id=1]
+[ext_resource path="res://scenes/introduction.gd" type="Script" id=2]
+
+[node name="CanvasLayer" type="CanvasLayer"]
+script = ExtResource( 2 )
+
+[node name="Textreveal" parent="." instance=ExtResource( 1 )]
+position = Vector2( 653.942, 242.431 )
+text = "Long long time ago"
+speed = 10.0
+[connection signal="finished_reveal" from="Textreveal" to="." method="_on_Textreveal_finished_reveal"]
diff --git a/scenes/menu.gd b/scenes/menu.gd
new file mode 100644
index 0000000..c0c6f6b
--- /dev/null
+++ b/scenes/menu.gd
@@ -0,0 +1,9 @@
+extends Node2D
+
+
+func _ready():
+ pass
+
+
+func _on_Exit_on_click():
+ get_tree().quit()
diff --git a/scenes/menu.tscn b/scenes/menu.tscn
index adb7754..0a69c87 100644
--- a/scenes/menu.tscn
+++ b/scenes/menu.tscn
@@ -1,11 +1,13 @@
-[gd_scene load_steps=5 format=2]
+[gd_scene load_steps=6 format=2]
[ext_resource path="res://components/Logo.tscn" type="PackedScene" id=1]
[ext_resource path="res://components/button.tscn" type="PackedScene" id=2]
[ext_resource path="res://textures/backgrounds/background_grey.png" type="Texture" id=3]
-[ext_resource path="res://textures/backgrounds/background_black.png" type="Texture" id=4]
+[ext_resource path="res://textures/backgrounds/background_blue.png" type="Texture" id=4]
+[ext_resource path="res://scenes/menu.gd" type="Script" id=5]
[node name="Node2D" type="Node2D"]
+script = ExtResource( 5 )
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 640, 360 )
@@ -30,3 +32,4 @@ fixed_width = 150
[node name="Logo" parent="." instance=ExtResource( 1 )]
position = Vector2( 640, 250 )
rotation = -1.74846e-07
+[connection signal="on_click" from="Exit" to="." method="_on_Exit_on_click"]
diff --git a/textures/blauuu.png b/textures/blauuu.png
deleted file mode 100644
index 416d933..0000000
--- a/textures/blauuu.png
+++ /dev/null
Binary files differ
diff --git a/textures/blauuu.png.import b/textures/blauuu.png.import
deleted file mode 100644
index da56a0d..0000000
--- a/textures/blauuu.png.import
+++ /dev/null
@@ -1,34 +0,0 @@
-[remap]
-
-importer="texture"
-type="StreamTexture"
-path="res://.import/blauuu.png-22949d4eb9161508bb9aa3294d24b7e6.stex"
-metadata={
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://textures/blauuu.png"
-dest_files=[ "res://.import/blauuu.png-22949d4eb9161508bb9aa3294d24b7e6.stex" ]
-
-[params]
-
-compress/mode=0
-compress/lossy_quality=0.7
-compress/hdr_mode=0
-compress/bptc_ldr=0
-compress/normal_map=0
-flags/repeat=0
-flags/filter=true
-flags/mipmaps=false
-flags/anisotropic=false
-flags/srgb=2
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/HDR_as_SRGB=false
-process/invert_color=false
-stream=false
-size_limit=0
-detect_3d=true
-svg/scale=1.0
diff --git a/textures/rooot.png b/textures/rooot.png
deleted file mode 100644
index 55a0732..0000000
--- a/textures/rooot.png
+++ /dev/null
Binary files differ
diff --git a/textures/rooot.png.import b/textures/rooot.png.import
deleted file mode 100644
index 0a8a9c4..0000000
--- a/textures/rooot.png.import
+++ /dev/null
@@ -1,34 +0,0 @@
-[remap]
-
-importer="texture"
-type="StreamTexture"
-path="res://.import/rooot.png-53269f53a9eb787988926f90e6b542fb.stex"
-metadata={
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://textures/rooot.png"
-dest_files=[ "res://.import/rooot.png-53269f53a9eb787988926f90e6b542fb.stex" ]
-
-[params]
-
-compress/mode=0
-compress/lossy_quality=0.7
-compress/hdr_mode=0
-compress/bptc_ldr=0
-compress/normal_map=0
-flags/repeat=0
-flags/filter=true
-flags/mipmaps=false
-flags/anisotropic=false
-flags/srgb=2
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/HDR_as_SRGB=false
-process/invert_color=false
-stream=false
-size_limit=0
-detect_3d=true
-svg/scale=1.0