...
 
Commits (3)
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://fonts/lato-bold.ttf" type="DynamicFontData" id=1]
[resource]
size = 80
outline_size = 2
outline_color = Color( 0, 0, 0, 1 )
use_filter = true
font_data = ExtResource( 1 )
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://fonts/lato-bold.ttf" type="DynamicFontData" id=1]
[resource]
size = 20
use_filter = true
font_data = ExtResource( 1 )
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://fonts/lato-semibold.ttf" type="DynamicFontData" id=1]
[resource]
size = 20
use_filter = true
font_data = ExtResource( 1 )
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/title-background.png-015f6a86084ad3f6370df8f7859bfbd6.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://gfx/title-background.png"
dest_files=[ "res://.import/title-background.png-015f6a86084ad3f6370df8f7859bfbd6.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
......@@ -51,7 +51,7 @@ _global_script_class_icons={
[application]
config/name="LD44: Minter"
run/main_scene="res://screens/GameScreen.tscn"
run/main_scene="res://screens/TitleScreen.tscn"
boot_splash/image="res://splash.png"
config/icon="res://icon.png"
......
extends Node2D
var _canGo := false
func _ready() -> void:
$ScoreLabel.text = "Your score was %s" % Globals.gameState.score
yield(get_tree().create_timer(2.0), "timeout")
_canGo = true
func _input(event) -> void:
if _canGo && event is InputEventKey or event is InputEventJoypadButton:
get_tree().change_scene("res://screens/TitleScreen.tscn")
[gd_scene load_steps=4 format=2]
[ext_resource path="res://screens/GameOverScreen.gd" type="Script" id=1]
[ext_resource path="res://fonts/game-over-font.tres" type="DynamicFont" id=2]
[ext_resource path="res://fonts/toast-font.tres" type="DynamicFont" id=3]
[node name="GameOverScreen" type="Node2D"]
script = ExtResource( 1 )
[node name="ColorRect" type="ColorRect" parent="."]
margin_right = 1270.0
margin_bottom = 720.0
color = Color( 0.168627, 0.0823529, 0.054902, 1 )
[node name="Label" type="Label" parent="."]
margin_top = 220.0
margin_right = 1270.0
margin_bottom = 380.0
custom_fonts/font = ExtResource( 2 )
text = "Game Over"
align = 1
[node name="ScoreLabel" type="Label" parent="."]
margin_top = 380.0
margin_right = 1270.0
margin_bottom = 394.0
custom_fonts/font = ExtResource( 3 )
text = "Your score is"
align = 1
extends Node2D
var _canGo := false
func _ready() -> void:
yield(get_tree().create_timer(1.0), "timeout")
_canGo = true
func _input(event) -> void:
if _canGo && event is InputEventKey or event is InputEventJoypadButton:
get_tree().change_scene("res://screens/GameScreen.tscn")
[gd_scene load_steps=10 format=2]
[ext_resource path="res://screens/TitleScreen.gd" type="Script" id=1]
[ext_resource path="res://gfx/title-background.png" type="Texture" id=2]
[ext_resource path="res://fonts/title-text.tres" type="DynamicFont" id=3]
[ext_resource path="res://fonts/title-text-bold.tres" type="DynamicFont" id=4]
[ext_resource path="res://gfx/raw-metal.png" type="Texture" id=5]
[ext_resource path="res://gfx/molten-metal.png" type="Texture" id=6]
[ext_resource path="res://gfx/wet-planchet.png" type="Texture" id=7]
[ext_resource path="res://gfx/planchet.png" type="Texture" id=8]
[ext_resource path="res://gfx/coin.png" type="Texture" id=9]
[node name="TitleScreen" type="Node2D"]
script = ExtResource( 1 )
[node name="TextureRect" type="TextureRect" parent="."]
margin_right = 40.0
margin_bottom = 40.0
texture = ExtResource( 2 )
__meta__ = {
"_edit_lock_": true
}
[node name="Label1" type="Label" parent="."]
margin_left = 919.0
margin_top = 643.0
margin_right = 1241.0
margin_bottom = 668.0
custom_fonts/font = ExtResource( 3 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "By Leandro Motta Barros, May 2019"
[node name="Label2" type="Label" parent="."]
margin_left = 919.0
margin_top = 667.0
margin_right = 1263.0
margin_bottom = 692.0
custom_fonts/font = ExtResource( 3 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Ludum Dare 44 (\"Your life is currency\")"
[node name="Label4" type="Label" parent="."]
margin_left = 30.0
margin_top = 480.0
margin_right = 530.0
margin_bottom = 700.0
custom_fonts/font = ExtResource( 3 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "You must keep the mint working. If your \"coins per second\" drops to zero, it's game over. Use tools to fix broken machinery and weapons to deal with undesired visitors.
You can buy upgrades, but they will reduce your \"coins per seconds\" for some some time. You know, things cost money."
autowrap = true
[node name="Label5" type="Label" parent="."]
margin_left = 1000.0
margin_top = 110.0
margin_right = 1241.0
margin_bottom = 191.0
custom_fonts/font = ExtResource( 3 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Raw metal. In the furnace it is molten into....
"
autowrap = true
[node name="Label7" type="Label" parent="."]
margin_left = 1000.0
margin_top = 196.0
margin_right = 1250.0
margin_bottom = 305.0
custom_fonts/font = ExtResource( 3 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Molten metal. In the molding room it is turned into....
"
autowrap = true
[node name="Label8" type="Label" parent="."]
margin_left = 1000.0
margin_top = 312.0
margin_right = 1250.0
margin_bottom = 393.0
custom_fonts/font = ExtResource( 3 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Wet planchet. In the drying room it dries to become...
"
autowrap = true
[node name="Label9" type="Label" parent="."]
margin_left = 1000.0
margin_top = 412.0
margin_right = 1250.0
margin_bottom = 493.0
custom_fonts/font = ExtResource( 3 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Planchet. The press finally turns it into...
"
autowrap = true
[node name="Label10" type="Label" parent="."]
margin_left = 1000.0
margin_top = 498.0
margin_right = 1250.0
margin_bottom = 607.0
custom_fonts/font = ExtResource( 3 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Coin! Keep making those to fuel the economy and keep your job!
"
autowrap = true
[node name="Label3" type="Label" parent="."]
margin_left = 30.0
margin_top = 450.0
margin_right = 374.0
margin_bottom = 475.0
custom_fonts/font = ExtResource( 4 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "Instructions"
[node name="Label6" type="Label" parent="."]
margin_left = 100.0
margin_top = 240.0
margin_right = 870.0
margin_bottom = 349.0
custom_fonts/font = ExtResource( 4 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
text = "You have been working in the mint for decades. You love this place. You love this job.
You are the minter.
Your life is currency.
"
autowrap = true
[node name="Sprite1" type="Sprite" parent="."]
position = Vector2( 960, 140 )
texture = ExtResource( 5 )
[node name="Sprite2" type="Sprite" parent="."]
position = Vector2( 960, 240 )
texture = ExtResource( 6 )
[node name="Sprite3" type="Sprite" parent="."]
position = Vector2( 960, 340 )
texture = ExtResource( 7 )
[node name="Sprite4" type="Sprite" parent="."]
position = Vector2( 960, 440 )
texture = ExtResource( 8 )
[node name="Sprite5" type="Sprite" parent="."]
position = Vector2( 959, 540 )
texture = ExtResource( 9 )
......@@ -126,7 +126,8 @@ func showToast(text: String) -> void:
tween.start()
yield(get_tree().create_timer(5.0), "timeout")
parent.remove_child(label)
if is_instance_valid(parent):
parent.remove_child(label)
func getPointInGroup(group: String) -> Vector2:
......
extends Node2D
var _isGamingOver := false
func _process(delta: float) -> void:
$Panel/Score/Value.text = str(Globals.gameState.score)
......@@ -24,9 +25,16 @@ func _on_OneTickPerSecondTimer_timeout() -> void:
var gs := Globals.gameState
gs.coinsPerSec = gs.coinsPerSecStats.front() * perMinuteAdjustmentFactor
gs.coinsPerSec += Globals.getCurrentCoinRateModifier()
gs.coinsPerSec = max(gs.coinsPerSec, 0)
gs.coinsPerSecStats.pop_front()
gs.coinsPerSecStats.push_back(0)
$Panel/CoinsRate/Value.text = str(gs.coinsPerSec)
Globals.generateRandomEventMaybe($OneTickPerSecondTimer.wait_time)
if Globals.gameState.coinsPerSec <= 0 and !_isGamingOver:
_isGamingOver = true
Globals.showToast("Augh! You let the coins per second drop to zero! This is...")
yield(get_tree().create_timer(5.0), "timeout")
get_tree().change_scene("res://screens/GameOverScreen.tscn")