Skip to content

Commit

Permalink
Atualizando Game
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiago Treter authored and Tiago Treter committed Jun 6, 2022
1 parent 7963133 commit 03cc1b6
Show file tree
Hide file tree
Showing 28 changed files with 1,124 additions and 4 deletions.
4 changes: 4 additions & 0 deletions dialogs/Dialog.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends Resource
class_name Dialog

export(Array, String) var msg_queue: Array
5 changes: 5 additions & 0 deletions dialogs/jsons/npc1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{"name": "Figura Oculta", "text": "Este será seu novo mundo! Hahahahahaha..."},
{"name": "Figura Oculta", "text": "Tudo que você precisa saber está diante de seus olhos. Hehehehe..."},
{"name": "Figura Oculta", "text": "Boa sorte na sua jornada. Hehe"}
]
7 changes: 7 additions & 0 deletions dialogs/master_of_the_game.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[gd_resource type="Resource" load_steps=2 format=2]

[ext_resource path="res://dialogs/Dialog.gd" type="Script" id=1]

[resource]
script = ExtResource( 1 )
msg_queue = [ "Seja muito bem vindo ao seu novo mundo! Hahahahaha..", "Tudo que você precisa saber está diante de seus olhos! Hahahahahahaha.", "Boa sorte na sua jornada. Hehe" ]
Binary file added images/enemy/master_of_the_game/master.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions images/enemy/master_of_the_game/master.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/master.png-09f75ee96069732eb98ae3bbd4f15ed2.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://images/enemy/master_of_the_game/master.png"
dest_files=[ "res://.import/master.png-09f75ee96069732eb98ae3bbd4f15ed2.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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added images/fonts/game_over.ttf
Binary file not shown.
Binary file added images/fx/dialog/dialogbox_tile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions images/fx/dialog/dialogbox_tile.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/dialogbox_tile.png-5fbd0a69b414d15d956dafd730a6f34a.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://images/fx/dialog/dialogbox_tile.png"
dest_files=[ "res://.import/dialogbox_tile.png-5fbd0a69b414d15d956dafd730a6f34a.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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added images/fx/light/white_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions images/fx/light/white_light.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/white_light.png-0c6e06ae9fcea6cd863811b5e5781e47.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://images/fx/light/white_light.png"
dest_files=[ "res://.import/white_light.png-0c6e06ae9fcea6cd863811b5e5781e47.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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added images/menu/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions images/menu/bg.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/bg.png-d660b645975eca2240ee5d5d87bab26b.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://images/menu/bg.png"
dest_files=[ "res://.import/bg.png-d660b645975eca2240ee5d5d87bab26b.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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added images/menu/pzero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions images/menu/pzero.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/pzero.png-86e3dd26249912da8b3b21f3a1c3b7d7.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://images/menu/pzero.png"
dest_files=[ "res://.import/pzero.png-86e3dd26249912da8b3b21f3a1c3b7d7.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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
16 changes: 15 additions & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,26 @@

config_version=4

_global_script_classes=[ {
"base": "Resource",
"class": "Dialog",
"language": "GDScript",
"path": "res://dialogs/Dialog.gd"
} ]
_global_script_class_icons={
"Dialog": ""
}

[application]

config/name="Portal Zero"
run/main_scene="res://scenes/Levels.tscn"
run/main_scene="res://scenes/Menu.tscn"
config/icon="res://images/icon.png"

[autoload]

DialogBox="*res://scenes/DialogBox.tscn"

[input]

move_right={
Expand Down
43 changes: 43 additions & 0 deletions scenes/Dialog.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[gd_scene load_steps=6 format=2]

[ext_resource path="res://images/fx/dialog/dialogbox_tile.png" type="Texture" id=1]
[ext_resource path="res://images/fonts/game_over.ttf" type="DynamicFontData" id=2]
[ext_resource path="res://scripts/Dialog.gd" type="Script" id=3]

[sub_resource type="DynamicFont" id=1]
size = 50
font_data = ExtResource( 2 )

[sub_resource type="DynamicFont" id=2]
size = 50
font_data = ExtResource( 2 )

[node name="Dialog" type="CanvasLayer"]
script = ExtResource( 3 )

[node name="NinePatchRect" type="NinePatchRect" parent="."]
margin_left = 128.0
margin_top = 51.0
margin_right = 896.0
margin_bottom = 179.0
texture = ExtResource( 1 )
patch_margin_left = 16
patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16

[node name="Name" type="RichTextLabel" parent="NinePatchRect"]
margin_left = 7.0
margin_top = -1.0
margin_right = 192.0
margin_bottom = 34.0
custom_fonts/normal_font = SubResource( 1 )
text = "Name"

[node name="Message" type="RichTextLabel" parent="NinePatchRect"]
margin_left = 17.0
margin_top = 26.0
margin_right = 751.0
margin_bottom = 152.0
custom_fonts/normal_font = SubResource( 2 )
text = "Message"
45 changes: 45 additions & 0 deletions scenes/DialogBox.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
extends NinePatchRect

onready var text := $Text
onready var timer := $Timer

var msg_queue: Array = []

func _ready() -> void:
text.bbcode_text = ""


func _input(event):
if event is InputEventKey and event.is_action_pressed("ui_accept"):
show_message()


func add_message(_msg: Array) -> void:
if not visible:
show()
msg_queue.append_array(_msg)
show_message()


func show_message() -> void:
if not timer.is_stopped():
text.visible_characters = text.bbcode_text.length()
return

if msg_queue.size() == 0:
hide()
return

var _msg: String = msg_queue.pop_front()
print(_msg)

text.visible_characters = 0
text.bbcode_text = _msg
timer.start()


func _on_Timer_timeout():
if text.visible_characters == text.bbcode_text.length():
timer.stop()
pass
text.visible_characters += 1
40 changes: 40 additions & 0 deletions scenes/DialogBox.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[gd_scene load_steps=6 format=2]

[ext_resource path="res://scenes/DialogBox.gd" type="Script" id=1]
[ext_resource path="res://images/fx/dialog/dialogbox_tile.png" type="Texture" id=2]
[ext_resource path="res://images/fonts/game_over.ttf" type="DynamicFontData" id=3]

[sub_resource type="DynamicFont" id=1]
font_data = ExtResource( 3 )

[sub_resource type="DynamicFont" id=2]
size = 72
font_data = ExtResource( 3 )

[node name="DialogBox" type="NinePatchRect"]
margin_left = 128.0
margin_top = 384.0
margin_right = 903.0
margin_bottom = 512.0
texture = ExtResource( 2 )
patch_margin_left = 16
patch_margin_top = 16
patch_margin_right = 16
patch_margin_bottom = 16
script = ExtResource( 1 )

[node name="Text" type="RichTextLabel" parent="."]
margin_left = 29.0
margin_top = 20.0
margin_right = 736.0
margin_bottom = 178.0
custom_fonts/mono_font = SubResource( 1 )
custom_fonts/normal_font = SubResource( 2 )
visible_characters = 0
tab_size = 6
scroll_following = true

[node name="Timer" type="Timer" parent="."]
wait_time = 0.1

[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]
Loading

0 comments on commit 03cc1b6

Please sign in to comment.