added beer stand that spawns physics in and duplicate oobjects give half points
This commit is contained in:
parent
4c6260f7f1
commit
ae30f91abb
10 changed files with 117 additions and 20 deletions
|
|
@ -4,11 +4,12 @@ importer="scene"
|
|||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://ddnwvcwa6drqi"
|
||||
valid=false
|
||||
path="res://.godot/imported/barrel.blend-d55ef0f77e7a5f2e77ecca4be941021a.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Amanda/furni/tent/barrel.blend"
|
||||
dest_files=["res://.godot/imported/barrel.blend-d55ef0f77e7a5f2e77ecca4be941021a.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,12 @@ importer="scene"
|
|||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://ptwannnym6kc"
|
||||
valid=false
|
||||
path="res://.godot/imported/tent.blend-c2e4a2ad0442aa1c9be7f4044876a350.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Amanda/furni/tent/tent.blend"
|
||||
dest_files=["res://.godot/imported/tent.blend-c2e4a2ad0442aa1c9be7f4044876a350.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
|||
BIN
Amanda/skybox/Skydome_0.png
Normal file
BIN
Amanda/skybox/Skydome_0.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
|
|
@ -4,11 +4,12 @@ importer="scene"
|
|||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://bywn575nv8tm8"
|
||||
valid=false
|
||||
path="res://.godot/imported/merchant_tent3.blend-6089b79591e5b9fc9fb6643f66087c87.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Florian/Entity/People/merchant_tent3.blend"
|
||||
dest_files=["res://.godot/imported/merchant_tent3.blend-6089b79591e5b9fc9fb6643f66087c87.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
[gd_scene load_steps=27 format=3 uid="uid://by5cq6m32hbor"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dv401srtwuvtg" path="res://icon.svg" id="1_6v0xc"]
|
||||
[ext_resource type="Texture2D" uid="uid://cd1v04y3nf1dv" path="res://Amanda/furni/Images/table_diffuse.jpg" id="1_tre0f"]
|
||||
[ext_resource type="PackedScene" uid="uid://crrco762ow56c" path="res://Florian/Player/PlayerRigidbody.tscn" id="2_82wr0"]
|
||||
[ext_resource type="PackedScene" uid="uid://bobfhgsydmmr2" path="res://Florian/pyro.tscn" id="4_h8052"]
|
||||
|
|
@ -18,15 +17,14 @@
|
|||
[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="PackedScene" uid="uid://ow35tpunk744" path="res://Florian/PhysicsProps/physics_beer.tscn" id="18_3uiso"]
|
||||
[ext_resource type="PackedScene" uid="uid://bxruw32nq7qfw" path="res://Florian/Props/beer_stand.tscn" id="19_d5eeg"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_g561u"]
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_3uiso"]
|
||||
albedo_texture = ExtResource("1_tre0f")
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_eral8"]
|
||||
albedo_texture = ExtResource("1_6v0xc")
|
||||
uv1_scale = Vector3(50, 50, 50)
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_82wr0"]
|
||||
material = SubResource("StandardMaterial3D_eral8")
|
||||
material = SubResource("StandardMaterial3D_3uiso")
|
||||
size = Vector2(500, 500)
|
||||
|
||||
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_tw6g5"]
|
||||
|
|
@ -47,20 +45,22 @@ point_count = 4
|
|||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_tre0f"]
|
||||
|
||||
[sub_resource type="Environment" id="Environment_d5eeg"]
|
||||
ambient_light_color = Color(1, 1, 1, 1)
|
||||
ambient_light_energy = 16.0
|
||||
|
||||
[node name="Oktoberfest" type="Node3D"]
|
||||
|
||||
[node name="Floor" type="MeshInstance3D" parent="."]
|
||||
material_override = SubResource("StandardMaterial3D_g561u")
|
||||
mesh = SubResource("PlaneMesh_82wr0")
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="Floor"]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Floor/StaticBody3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.378755, 0)
|
||||
shape = SubResource("WorldBoundaryShape3D_tw6g5")
|
||||
|
||||
[node name="PlayerRigidbody" parent="." instance=ExtResource("2_82wr0")]
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -20, 1, -9)
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -10, 1, -9)
|
||||
|
||||
[node name="Stage" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -8)
|
||||
|
|
@ -385,6 +385,12 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
|||
|
||||
[node name="Node3D2" type="Node3D" parent="."]
|
||||
|
||||
[node name="BeerStand" parent="." instance=ExtResource("19_d5eeg")]
|
||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -9, 0.399999, 8)
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_d5eeg")
|
||||
|
||||
[connection signal="interact" from="Stage/Interactable" to="Stage/Pyro" method="_turn_on_off"]
|
||||
[connection signal="interact" from="Stage/Interactable" to="Stage/Pyro2" method="_turn_on_off"]
|
||||
[connection signal="interact" from="Stage/Interactable" to="Stage/Pyro3" method="_turn_on_off"]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
[ext_resource type="PackedScene" uid="uid://d3ynlus2dwtle" path="res://Florian/Entity/People/beer.tscn" id="1_aypp7"]
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_aypp7"]
|
||||
height = 1.125
|
||||
height = 0.682813
|
||||
radius = 0.3
|
||||
|
||||
[node name="PhysicsBeer" type="RigidBody3D"]
|
||||
axis_lock_angular_x = true
|
||||
|
|
@ -12,5 +13,5 @@ axis_lock_angular_z = true
|
|||
[node name="beer" parent="." instance=ExtResource("1_aypp7")]
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0875, 0)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.0367187, 0)
|
||||
shape = SubResource("CylinderShape3D_aypp7")
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ extends Node3D
|
|||
@onready var label: Label = $Control/Label
|
||||
@export var player : PlayerRB = null
|
||||
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("take_picture"):
|
||||
_take_picture()
|
||||
|
|
@ -26,6 +28,7 @@ func _calculate_points():
|
|||
var acceptable_length = 1
|
||||
|
||||
func _calculate_picture_objects():
|
||||
var duplicates: Dictionary = {}
|
||||
for takeable in PictureTakeablesArray.picture_takables:
|
||||
#print("Checking takeable")
|
||||
if takeable.picture_taken():
|
||||
|
|
@ -39,23 +42,37 @@ func _calculate_picture_objects():
|
|||
raycast.collide_with_bodies = true
|
||||
raycast.debug_shape_thickness = 2
|
||||
if raycast.is_colliding():
|
||||
print("raycast hit")
|
||||
#print("raycast hit")
|
||||
var raycast_hit = raycast.get_collision_point()
|
||||
print(str((raycast_hit - takeable.global_position).length()))
|
||||
#print(str((raycast_hit - takeable.global_position).length()))
|
||||
if (raycast_hit - takeable.global_position).length() > acceptable_length:
|
||||
print("Not in range!")
|
||||
#print("Not in range!")
|
||||
raycast.queue_free()
|
||||
continue
|
||||
raycast.queue_free()
|
||||
|
||||
points_string += "{name} {points}\n".format({"name" : takeable.points_name, "points": str(takeable.points_worth)})
|
||||
total_points += takeable.points_worth
|
||||
var points = takeable.points_worth
|
||||
if duplicates.get(takeable.points_name):
|
||||
points = int(points * 0.5)
|
||||
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}
|
||||
)
|
||||
|
||||
|
||||
total_points += points
|
||||
total_points_multipliers *= takeable.points_multiplier
|
||||
takeable.show_red_cicle()
|
||||
|
||||
func _calculate_picture_spots():
|
||||
for spot in PictureTakeablesArray.picture_spots:
|
||||
if spot.picture_taken(player):
|
||||
points_string += "{name} {points}\n".format({"name" : spot.points_name, "points": str(spot.points_worth)})
|
||||
points_string += "{name} {points}\n".format(
|
||||
{"name" : spot.points_name, "points": spot.points_worth}
|
||||
)
|
||||
total_points += spot.points_worth
|
||||
total_points_multipliers *= spot.points_multiplier
|
||||
|
|
|
|||
29
Florian/Props/beer_stand.gd
Normal file
29
Florian/Props/beer_stand.gd
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
extends Node3D
|
||||
|
||||
@onready var sub_viewport: SubViewport = $CSGCombiner3D/SubViewport
|
||||
@onready var interactable: Interactable = $CSGCombiner3D/Interactable
|
||||
@onready var beer_spawner: Node3D = $CSGCombiner3D/BeerSpawner
|
||||
@onready var timer: Timer = $Timer
|
||||
|
||||
@export var beer_cooldown = 3
|
||||
var can_spawn = true
|
||||
|
||||
const PHYSICS_BEER = preload("res://Florian/PhysicsProps/physics_beer.tscn")
|
||||
func _ready() -> void:
|
||||
interactable.interact.connect(_spawn_beer)
|
||||
timer.timeout.connect(_can_spawn_beer_true)
|
||||
|
||||
|
||||
func _spawn_beer() -> void:
|
||||
if not can_spawn:
|
||||
return
|
||||
var beer = PHYSICS_BEER.instantiate()
|
||||
beer_spawner.add_child(beer)
|
||||
can_spawn=false
|
||||
timer.start(3)
|
||||
timer.paused = false
|
||||
pass
|
||||
|
||||
func _can_spawn_beer_true():
|
||||
|
||||
can_spawn = true
|
||||
1
Florian/Props/beer_stand.gd.uid
Normal file
1
Florian/Props/beer_stand.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dp2yujw0u1aox
|
||||
40
Florian/Props/beer_stand.tscn
Normal file
40
Florian/Props/beer_stand.tscn
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://bxruw32nq7qfw"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dp2yujw0u1aox" path="res://Florian/Props/beer_stand.gd" id="1_qpiuw"]
|
||||
[ext_resource type="PackedScene" uid="uid://byhsp6ujjsh8m" path="res://Florian/Entity/interactable.tscn" id="2_ftwn5"]
|
||||
[ext_resource type="PackedScene" uid="uid://dj13enetumsfm" path="res://Florian/Entity/People/waitress.tscn" id="3_ftwn5"]
|
||||
|
||||
[node name="BeerStand" type="Node3D"]
|
||||
script = ExtResource("1_qpiuw")
|
||||
|
||||
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="."]
|
||||
use_collision = true
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0)
|
||||
size = Vector3(3, 1, 1)
|
||||
|
||||
[node name="Interactable" parent="CSGCombiner3D" instance=ExtResource("2_ftwn5")]
|
||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0.4)
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="CSGCombiner3D"]
|
||||
|
||||
[node name="ProgressBar" type="ProgressBar" parent="CSGCombiner3D/SubViewport"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 2
|
||||
value = 50.0
|
||||
show_percentage = false
|
||||
|
||||
[node name="BeerSpawner" type="Node3D" parent="CSGCombiner3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 3.0
|
||||
|
||||
[node name="waitress" parent="." instance=ExtResource("3_ftwn5")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0.7, -1)
|
||||
Loading…
Add table
Reference in a new issue