Main title music, in game flatfish control indicator, tileset update, remove start tiles

This commit is contained in:
Alice Gaudon 2020-08-20 16:19:53 +02:00
parent 800de8be5c
commit 6ce7d1ef92
11 changed files with 84 additions and 4 deletions

View File

@ -0,0 +1,9 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://fonts/EnterCommand-Bold.ttf" type="DynamicFontData" id=1]
[resource]
size = 32
outline_color = Color( 0, 0, 0, 1 )
extra_spacing_bottom = -6
font_data = ExtResource( 1 )

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,10 +1,11 @@
[gd_scene load_steps=6 format=2] [gd_scene load_steps=7 format=2]
[ext_resource path="res://scripts/campfire2.gd" type="Script" id=1] [ext_resource path="res://scripts/campfire2.gd" type="Script" id=1]
[ext_resource path="res://scenes/campfire/Herbert.tscn" type="PackedScene" id=2] [ext_resource path="res://scenes/campfire/Herbert.tscn" type="PackedScene" id=2]
[ext_resource path="res://scenes/campfire/CampfireBackground.tscn" type="PackedScene" id=3] [ext_resource path="res://scenes/campfire/CampfireBackground.tscn" type="PackedScene" id=3]
[ext_resource path="res://scenes/dialogue.tscn" type="PackedScene" id=4] [ext_resource path="res://scenes/dialogue.tscn" type="PackedScene" id=4]
[ext_resource path="res://images/campfire/thechoice.tres" type="SpriteFrames" id=5] [ext_resource path="res://images/campfire/thechoice.tres" type="SpriteFrames" id=5]
[ext_resource path="res://fonts/dialog_default_font_bold.tres" type="DynamicFont" id=6]
[node name="Node2D" type="Node2D"] [node name="Node2D" type="Node2D"]
script = ExtResource( 1 ) script = ExtResource( 1 )
@ -28,7 +29,29 @@ __meta__ = {
[node name="Dialogue" parent="UI" instance=ExtResource( 4 )] [node name="Dialogue" parent="UI" instance=ExtResource( 4 )]
[node name="TheChoice" type="AnimatedSprite" parent="."] [node name="TheChoice" type="AnimatedSprite" parent="."]
visible = false
frames = ExtResource( 5 ) frames = ExtResource( 5 )
animation = "lie" animation = "lie"
centered = false centered = false
[node name="Lie" type="Label" parent="TheChoice"]
margin_left = 127.633
margin_top = 75.0
margin_right = 167.633
margin_bottom = 97.0
custom_fonts/font = ExtResource( 6 )
text = "Lie"
align = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Tell the truth" type="Label" parent="TheChoice"]
margin_top = 3.71011
margin_right = 84.0
margin_bottom = 25.7101
custom_fonts/font = ExtResource( 6 )
text = "Truth"
align = 1
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -109,6 +109,10 @@ dialogue = "res://dialogues/game1.json"
[node name="Game" type="Node2D" parent="."] [node name="Game" type="Node2D" parent="."]
[node name="GameControlIndicator" type="AnimatedSprite" parent="."]
position = Vector2( 96, 70 )
script = ExtResource( 8 )
[node name="Opening2" type="Node2D" parent="."] [node name="Opening2" type="Node2D" parent="."]
[node name="Opening2Bg" type="AnimatedSprite" parent="Opening2"] [node name="Opening2Bg" type="AnimatedSprite" parent="Opening2"]

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=2] [gd_scene load_steps=12 format=2]
[ext_resource path="res://scripts/menu/title_background.gd" type="Script" id=1] [ext_resource path="res://scripts/menu/title_background.gd" type="Script" id=1]
[ext_resource path="res://fonts/dialog_default_font.tres" type="DynamicFont" id=2] [ext_resource path="res://fonts/dialog_default_font.tres" type="DynamicFont" id=2]
@ -7,12 +7,15 @@
[ext_resource path="res://scripts/menu/MainMenu.gd" type="Script" id=5] [ext_resource path="res://scripts/menu/MainMenu.gd" type="Script" id=5]
[ext_resource path="res://images/main_menu/title_background_campfire.tres" type="SpriteFrames" id=6] [ext_resource path="res://images/main_menu/title_background_campfire.tres" type="SpriteFrames" id=6]
[ext_resource path="res://images/main_menu/titleWithoutEly_loop.tres" type="SpriteFrames" id=7] [ext_resource path="res://images/main_menu/titleWithoutEly_loop.tres" type="SpriteFrames" id=7]
[ext_resource path="res://sounds/main_title.ogg" type="AudioStream" id=8]
[ext_resource path="res://scripts/main_menu.gd" type="Script" id=9]
[sub_resource type="StyleBoxEmpty" id=1] [sub_resource type="StyleBoxEmpty" id=1]
[sub_resource type="StyleBoxEmpty" id=2] [sub_resource type="StyleBoxEmpty" id=2]
[node name="Node2D" type="Node2D"] [node name="Node2D" type="Node2D"]
script = ExtResource( 9 )
[node name="background" type="AnimatedSprite" parent="."] [node name="background" type="AnimatedSprite" parent="."]
frames = ExtResource( 7 ) frames = ExtResource( 7 )
@ -90,5 +93,8 @@ script = ExtResource( 3 )
__meta__ = { __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="MainMusic" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 8 )
[connection signal="animation_finished" from="ely" to="ely" method="_on_background_animation_finished"] [connection signal="animation_finished" from="ely" to="ely" method="_on_background_animation_finished"]
[connection signal="animation_finished" from="fire" to="fire" method="_on_background_animation_finished"] [connection signal="animation_finished" from="fire" to="fire" method="_on_background_animation_finished"]

View File

@ -11,7 +11,7 @@ const press_right = preload("res://images/Controls/PressRight.tres")
var last_is_joy = false var last_is_joy = false
func show_press(action : String): func show_press(action : String):
if action == 'ui_accept': if action == 'ui_accept' || action == 'interact':
frames = press_a if last_is_joy else press_space frames = press_a if last_is_joy else press_space
if action == 'right': if action == 'right':
frames = press_right frames = press_right

View File

@ -1,3 +1,4 @@
extends Node extends Node
var ui_accept_tip = false var ui_accept_tip = false
var ui_interact_flatfish_tip = false

View File

@ -110,6 +110,7 @@ func spawn_entities(level : Node):
# Spawn point # Spawn point
for cell in tm.get_used_cells_by_id(tileset.find_tile_by_name('start')): for cell in tm.get_used_cells_by_id(tileset.find_tile_by_name('start')):
spawn_pos = cell spawn_pos = cell
tm.set_cell(cell.x, cell.y, -1)
# Exit points # Exit points
for cell in tm.get_used_cells_by_id(tileset.find_tile_by_name('finish')): for cell in tm.get_used_cells_by_id(tileset.find_tile_by_name('finish')):
@ -217,6 +218,19 @@ func move_left():
func check_exit() -> bool: func check_exit() -> bool:
var player_pos = (player.position - Vector2(8, 8)) / 16 var player_pos = (player.position - Vector2(8, 8)) / 16
if !Globals.ui_interact_flatfish_tip:
var level = $Game.get_node(levels[current_level])
var shown = false
for e in level.get_node('Entities').get_children():
if e is Flatfish && e.position == player.position:
$GameControlIndicator.show_press('interact')
$GameControlIndicator.position = player.position + Vector2(0, 8 + 16)
shown = true
break
if !shown:
$GameControlIndicator.hide()
print(player_pos) print(player_pos)
for exit in exit_points: for exit in exit_points:
if player_pos == exit: if player_pos == exit:
@ -255,6 +269,9 @@ func interact():
break break
if fish != null: if fish != null:
Globals.ui_interact_flatfish_tip = true
$GameControlIndicator.hide()
fish.appear() fish.appear()
yield(get_tree().create_timer(0.2), "timeout") yield(get_tree().create_timer(0.2), "timeout")

5
scripts/main_menu.gd Normal file
View File

@ -0,0 +1,5 @@
extends Node2D
func _ready():
$MainMusic.play()

BIN
sounds/main_title.ogg Normal file

Binary file not shown.

View File

@ -0,0 +1,15 @@
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/main_title.ogg-ccd8b7af008d3af3848694e6df920f8a.oggstr"
[deps]
source_file="res://sounds/main_title.ogg"
dest_files=[ "res://.import/main_title.ogg-ccd8b7af008d3af3848694e6df920f8a.oggstr" ]
[params]
loop=true
loop_offset=0