added picture flash and point
This commit is contained in:
parent
2eeedfc793
commit
cd8a46404e
9 changed files with 63 additions and 35 deletions
BIN
Florian/Audio/flash-camera.mp3
Normal file
BIN
Florian/Audio/flash-camera.mp3
Normal file
Binary file not shown.
|
|
@ -1,31 +1,31 @@
|
|||
[gd_scene load_steps=61 format=4 uid="uid://by5cq6m32hbor"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bhh76i4a51brf" path="res://Florian/Map/oktoberfest.gd" id="1_20xaa"]
|
||||
[ext_resource type="Texture2D" uid="uid://siyny4elk634" path="res://Amanda/medieval_tavern_props_pack/textures/tex_chair_wood.png" id="1_kmmfq"]
|
||||
[ext_resource type="Texture2D" uid="uid://8lntiwf30qqc" path="res://Amanda/medieval_tavern_props_pack/textures/tex_chair_wood.png" id="1_kmmfq"]
|
||||
[ext_resource type="PackedScene" uid="uid://crrco762ow56c" path="res://Florian/Player/PlayerRigidbody.tscn" id="2_82wr0"]
|
||||
[ext_resource type="Texture2D" uid="uid://dotcifqbq8dp2" path="res://Amanda/medieval_tavern_props_pack/textures/tex_barrel.png" id="2_o3vbn"]
|
||||
[ext_resource type="Texture2D" uid="uid://ch3nggq0gb5jf" path="res://Amanda/medieval_tavern_props_pack/textures/tex_table_wood_round.png" id="3_6t3lb"]
|
||||
[ext_resource type="Texture2D" uid="uid://d0jmvu4qbxn54" path="res://Amanda/medieval_tavern_props_pack/textures/tex_barrel.png" id="2_o3vbn"]
|
||||
[ext_resource type="Texture2D" uid="uid://b55s7kfqvm4we" path="res://Amanda/medieval_tavern_props_pack/textures/tex_table_wood_round.png" id="3_6t3lb"]
|
||||
[ext_resource type="PackedScene" uid="uid://bobfhgsydmmr2" path="res://Florian/pyro.tscn" id="4_h8052"]
|
||||
[ext_resource type="PackedScene" uid="uid://byhsp6ujjsh8m" path="res://Florian/Entity/interactable.tscn" id="5_ygtpi"]
|
||||
[ext_resource type="Script" path="res://Florian/Map/lights.gd" id="6_g561u"]
|
||||
[ext_resource type="Script" uid="uid://ddwcbl3nbt6j4" path="res://Florian/Map/lights.gd" id="6_g561u"]
|
||||
[ext_resource type="PackedScene" uid="uid://c8gnb0kut2n5h" path="res://Florian/PointsLogic/point_thing.tscn" id="6_miqpv"]
|
||||
[ext_resource type="PackedScene" uid="uid://bk4djtjemu7we" path="res://Florian/Entity/People/guitar.tscn" id="6_ptxqs"]
|
||||
[ext_resource type="PackedScene" uid="uid://c5552lenumx2j" path="res://Florian/Entity/People/saxophone.tscn" id="7_miqpv"]
|
||||
[ext_resource type="PackedScene" uid="uid://bybsn53hd1mge" path="res://Florian/Entity/People/guys.tscn" id="9_3box6"]
|
||||
[ext_resource type="PackedScene" uid="uid://bw73kprk7ptvn" path="res://Florian/PointsLogic/PictureSpot.tscn" id="10_28ddj"]
|
||||
[ext_resource type="Script" path="res://Florian/Map/dancing_people.gd" id="10_mbtuy"]
|
||||
[ext_resource type="Script" uid="uid://cu3fdbo1lelob" path="res://Florian/Map/dancing_people.gd" id="10_mbtuy"]
|
||||
[ext_resource type="PackedScene" uid="uid://k3ij7wrtwpms" path="res://Florian/table_0.tscn" id="10_ubr03"]
|
||||
[ext_resource type="PackedScene" uid="uid://m3sk1ustdixv" path="res://Florian/Props/tent.tscn" id="11_4etk5"]
|
||||
[ext_resource type="PackedScene" uid="uid://oxm6ufgip22u" path="res://Florian/Props/tent.tscn" id="11_4etk5"]
|
||||
[ext_resource type="Texture2D" uid="uid://cx783frd814e6" path="res://Florian/Decals/power.png" id="11_bsfgy"]
|
||||
[ext_resource type="PackedScene" uid="uid://lrf6ltd1wwg1" path="res://Florian/Entity/People/waitress_path.tscn" id="12_g561u"]
|
||||
[ext_resource type="PackedScene" uid="uid://ctcspqlxrw22q" path="res://Florian/PhysicsProps/PhysicsBarrel.tscn" id="13_ijkca"]
|
||||
[ext_resource type="Texture2D" uid="uid://oej528bt551q" path="res://Florian/Textures/bush.jpg" id="14_70e5e"]
|
||||
[ext_resource type="Texture2D" uid="uid://cssu4gijvm0t3" path="res://Amanda/medieval_tavern_props_pack/textures/tex_fireplace_2.png" id="17_sdh5o"]
|
||||
[ext_resource type="Texture2D" uid="uid://b668hlnork7jt" path="res://Florian/Textures/bush.jpg" id="14_70e5e"]
|
||||
[ext_resource type="Texture2D" uid="uid://bjqu1o6hbbmrf" path="res://Amanda/medieval_tavern_props_pack/textures/tex_fireplace_2.png" id="17_sdh5o"]
|
||||
[ext_resource type="PackedScene" uid="uid://ow35tpunk744" path="res://Florian/PhysicsProps/physics_beer.tscn" id="18_3uiso"]
|
||||
[ext_resource type="Texture2D" uid="uid://bmgydj38uhwoe" path="res://Amanda/skybox/Skydome_0.png" id="19_20xaa"]
|
||||
[ext_resource type="PackedScene" uid="uid://bxruw32nq7qfw" path="res://Florian/Props/beer_stand.tscn" id="19_d5eeg"]
|
||||
[ext_resource type="PackedScene" uid="uid://v86q0i25q2dj" path="res://Florian/PhysicsProps/DrunkFollow.tscn" id="20_20xaa"]
|
||||
[ext_resource type="AudioStream" uid="uid://b36jr8py078ma" path="res://Florian/Audio/oktoberfestambience.mp3.ogg" id="21_mmnkp"]
|
||||
[ext_resource type="AudioStream" uid="uid://bf4mxj37o7bh2" path="res://Florian/Audio/oktoberfestambience.mp3.ogg" id="21_mmnkp"]
|
||||
[ext_resource type="PackedScene" uid="uid://b85ujwx0p8gvn" path="res://Florian/Props/door.tscn" id="22_bv6bj"]
|
||||
[ext_resource type="PackedScene" uid="uid://c4fw8rjct7vms" path="res://Florian/Entity/People/accor.tscn" id="23_0a0yf"]
|
||||
[ext_resource type="Script" uid="uid://btok1rqmtms4o" path="res://Florian/Map/accor_animation.gd" id="24_ho8ja"]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
[gd_scene load_steps=67 format=3 uid="uid://b2rihishxk0on"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://4qygsglmdow6" path="res://Amanda/temple_gate/source/01door.FBX.fbx" id="1_dr64d"]
|
||||
[ext_resource type="Script" uid="uid://cwh8rgqflg34d" path="res://Florian/Map/chinese_ny.gd" id="1_yx28j"]
|
||||
[ext_resource type="Script" path="res://Florian/Map/chinese_ny.gd" id="1_yx28j"]
|
||||
[ext_resource type="Texture2D" uid="uid://bnrri5m5k1c1a" path="res://Amanda/grass.png" id="2_r0dy2"]
|
||||
[ext_resource type="PackedScene" uid="uid://cvhj68arfuxaq" path="res://Amanda/lion/lion-500k.fbx" id="2_yh5on"]
|
||||
[ext_resource type="Texture2D" uid="uid://dmi4dxocjeelu" path="res://Amanda/Sprite assets/body.png" id="4_bsgyk"]
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
[ext_resource type="Texture2D" uid="uid://dvat0w2k6bb78" path="res://Amanda/Sprite assets/Untitled_Artwork-1 18.png" id="15_hp67e"]
|
||||
[ext_resource type="Script" uid="uid://bgolfgrq66diw" path="res://npc_path_follower.gd" id="17_3f12g"]
|
||||
[ext_resource type="PackedScene" uid="uid://dggx2w2c8xojc" path="res://Florian/PhysicsProps/firework.tscn" id="19_qqao8"]
|
||||
[ext_resource type="AudioStream" uid="uid://dqomxq6g33eod" path="res://Florian/Audio/chineseAmbientMusicGame.ogg" id="20_72n5s"]
|
||||
[ext_resource type="AudioStream" uid="uid://yuv8dxd17p6s" path="res://Florian/Audio/chineseAmbientMusicGame.ogg" id="20_72n5s"]
|
||||
[ext_resource type="Script" uid="uid://b7m4mddm1165v" path="res://Florian/Map/firework_spawn_locations.gd" id="21_yd64k"]
|
||||
[ext_resource type="PackedScene" uid="uid://iky4i2bjknty" path="res://Florian/Props/gong.tscn" id="22_ppss2"]
|
||||
[ext_resource type="PackedScene" uid="uid://byhsp6ujjsh8m" path="res://Florian/Entity/interactable.tscn" id="23_4rmvb"]
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ func _ready() -> void:
|
|||
|
||||
func _process(delta: float) -> void:
|
||||
if Input.is_action_just_pressed("take_picture"):
|
||||
await PictureTakeablesArray.calcualtion_finished
|
||||
finish()
|
||||
if Input.is_action_just_pressed("pause"):
|
||||
pause_menu()
|
||||
|
|
|
|||
|
|
@ -1,15 +1,20 @@
|
|||
extends Node3D
|
||||
@onready var label: Label = $Control/Label
|
||||
#@onready var label: Label = $Control/Label
|
||||
@export var player : PlayerRB = null
|
||||
|
||||
|
||||
@onready var flash_camera: AudioStreamPlayer = $"Flash-camera"
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("take_picture"):
|
||||
_take_picture()
|
||||
|
||||
func _take_picture():
|
||||
flash_camera.play()
|
||||
|
||||
_calculate_points()
|
||||
await get_tree().create_timer(0.1).timeout
|
||||
PictureTakeablesArray.calcualtion_finished.emit()
|
||||
pass
|
||||
|
||||
var points_string = ""
|
||||
|
|
@ -23,7 +28,8 @@ func _calculate_points():
|
|||
print("Taking Picture!!!")
|
||||
_calculate_picture_objects()
|
||||
_calculate_picture_spots()
|
||||
label.text = "%s\nTotal points: %d x %.2f = %.2f" % [points_string, total_points, total_points_multipliers, total_points * total_points_multipliers]
|
||||
PictureTakeablesArray.points = total_points
|
||||
#label.text = "%s\nTotal points: %d x %.2f = %.2f" % [points_string, total_points, total_points_multipliers, total_points * total_points_multipliers]
|
||||
|
||||
var acceptable_length = 1
|
||||
|
||||
|
|
@ -54,18 +60,34 @@ func _calculate_picture_objects():
|
|||
raycast.queue_free()
|
||||
|
||||
var points = takeable.points_worth
|
||||
var label = Label3D.new()
|
||||
label.billboard = BaseMaterial3D.BILLBOARD_ENABLED
|
||||
label.fixed_size = true
|
||||
label.font_size = 100
|
||||
label.pixel_size = 0.001
|
||||
|
||||
if duplicates.get(takeable.points_name):
|
||||
points = int(points * 0.2)
|
||||
points_string += "Duplicate: {name} {points}\n".format(
|
||||
{"name" : takeable.points_name, "points": points}
|
||||
)
|
||||
#points_string += "Duplicate: {name} {points}\n".format(
|
||||
# {"name" : takeable.points_name, "points": points}
|
||||
# )
|
||||
else:
|
||||
duplicates[takeable.points_name] = true
|
||||
points_string += "{name} {points}\n".format(
|
||||
{"name" : takeable.points_name, "points": points}
|
||||
)
|
||||
|
||||
|
||||
label.font_size = 150
|
||||
label.modulate = "#ffff00"
|
||||
#points_string += "{name} {points}\n".format(
|
||||
# {"name" : takeable.points_name, "points": points}
|
||||
# )
|
||||
if takeable.points_multiplier != 1:
|
||||
label.text = "{points} + X{mult}".format(
|
||||
{"points": points, "mult":takeable.points_multiplier}
|
||||
)
|
||||
else:
|
||||
label.text = "{points}".format(
|
||||
{"points": points}
|
||||
)
|
||||
takeable.add_child(label)
|
||||
label.position += Vector3(0, 1, 0)
|
||||
total_points += points
|
||||
total_points_multipliers *= takeable.points_multiplier
|
||||
takeable.show_red_cicle()
|
||||
|
|
|
|||
|
|
@ -1,22 +1,13 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://4hac7s0wvoye"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://4hac7s0wvoye"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dff1mtnypemb4" path="res://Florian/Player/cool_camera.gd" id="1_87r7f"]
|
||||
[ext_resource type="AudioStream" uid="uid://b87evhnkm1hs" path="res://Florian/Audio/flash-camera.mp3" id="2_xbt26"]
|
||||
|
||||
[node name="CoolCamera" type="Node3D"]
|
||||
script = ExtResource("1_87r7f")
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
|
||||
[node name="Control" type="Control" parent="."]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Label" type="Label" parent="Control"]
|
||||
layout_mode = 0
|
||||
offset_right = 559.0
|
||||
offset_bottom = 250.0
|
||||
text = "Points worth: 0"
|
||||
[node name="Flash-camera" type="AudioStreamPlayer" parent="."]
|
||||
process_mode = 3
|
||||
stream = ExtResource("2_xbt26")
|
||||
|
|
|
|||
|
|
@ -84,5 +84,6 @@ theme_override_constants/outline_size = 2
|
|||
text = "Exit
|
||||
"
|
||||
|
||||
[connection signal="visibility_changed" from="." to="." method="_on_visibility_changed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/MarginContainer2/HBoxContainer2/Retry" to="." method="_on_retry_pressed"]
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/MarginContainer2/HBoxContainer2/Exit" to="." method="_on_exit_pressed"]
|
||||
|
|
|
|||
|
|
@ -3,9 +3,19 @@ extends Control
|
|||
signal retry
|
||||
signal exit
|
||||
|
||||
@onready var points: Label = $MarginContainer/VBoxContainer/MarginContainer/HBoxContainer/Points
|
||||
|
||||
|
||||
func _on_retry_pressed() -> void:
|
||||
emit_signal("retry")
|
||||
|
||||
|
||||
func _on_exit_pressed() -> void:
|
||||
emit_signal("exit")
|
||||
|
||||
|
||||
func _on_visibility_changed() -> void:
|
||||
if not points:
|
||||
return
|
||||
points.text = str(PictureTakeablesArray.points)
|
||||
pass # Replace with function body.
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@ extends Node
|
|||
|
||||
var picture_takables : Array[PointPicture] = []
|
||||
var picture_spots: Array[PictureSpot] = []
|
||||
var points = 1
|
||||
|
||||
signal calcualtion_finished
|
||||
|
||||
func _add_point_picture(point_picture: PointPicture):
|
||||
print("Adding picture takeable")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue