Added trailer and ability to disable player

This commit is contained in:
Paul Black 2023-05-05 13:05:54 -06:00
parent 537c85d017
commit 580d0a75fc
7 changed files with 161 additions and 141 deletions

BIN
.DS_Store vendored

Binary file not shown.

View file

@ -48,6 +48,7 @@ func _ready():
menuScene.visible = false
func _unhandled_input(event):
if not Global.playerDisable:
if is_multiplayer_authority():
Global.selfTeddy = selfTeddy
if event is InputEventMouseButton:
@ -78,6 +79,7 @@ func _unhandled_input(event):
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
func _physics_process(delta):
if not Global.playerDisable:
if is_multiplayer_authority():
# This variable gets set my the death scene, so we know the player needs to be respawned
if Global.playerPleaseRespawn == true:

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=3 uid="uid://dkokyp5lwhks4"]
[gd_scene load_steps=11 format=3 uid="uid://dkokyp5lwhks4"]
[ext_resource type="Script" path="res://scripts/maps/tutorial.gd" id="1_40ws8"]
[ext_resource type="PackedScene" uid="uid://dp1q51kvd8uow" path="res://scenes/Teddy.tscn" id="1_081si"]
@ -6,6 +6,7 @@
[ext_resource type="PackedScene" uid="uid://y3fffh5cdbks" path="res://scenes/AI.tscn" id="4_fttoe"]
[ext_resource type="PackedScene" uid="uid://c1y6p4m0sktfj" path="res://scenes/farmland-map.tscn" id="5_imhi6"]
[ext_resource type="PackedScene" uid="uid://buyvavyuwmccw" path="res://joystick/virtual_joystick.tscn" id="6_p8th3"]
[ext_resource type="VideoStream" path="res://videos/trailer.ogv" id="7_4deue"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_i5hsu"]
sky_top_color = Color(1, 1, 1, 1)
@ -42,3 +43,12 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.21775, 1.22338, -28.4151)
[node name="Farmland" parent="." instance=ExtResource("5_imhi6")]
[node name="Virtual joystick" parent="." instance=ExtResource("6_p8th3")]
[node name="VideoStreamPlayer" type="VideoStreamPlayer" parent="."]
offset_right = 1152.0
offset_bottom = 648.0
mouse_filter = 2
mouse_force_pass_scroll_events = false
stream = ExtResource("7_4deue")
autoplay = true
expand = true

View file

@ -31,6 +31,7 @@ func _process(delta):
restart_round()
rpc("restart_round")
if Global.mapName == "Tutorial":
if not Global.playerDisable:
tutorial()
if not Global.tutorialComplete:
$musicPanel.visible = false

View file

@ -48,6 +48,7 @@ var iAmDeadAndInnocent = false # Used to keep track of when an innocent dies in
var spawnCotton = false # bullet will change this to true
var addedMenuScene = false # Used for teddy.gd, fixes multiple menu bug
var tutorialCompleted = false # Used in the save file, to know if a play should go to tutorial first
var playerDisable = false # Can be used to disable the player
func _process(delta):
#if not spawnCoordsInitalized:

View file

@ -11,6 +11,12 @@ func _ready():
func _process(delta):
if Input.is_action_just_released("menu"):
$VideoStreamPlayer.stop()
if $VideoStreamPlayer.is_playing():
Global.playerDisable = true
else:
Global.playerDisable = false
if Global.tutorialComplete:
if audio_stream_player.playing == false:
var randomnum = RandomNumberGenerator.new().randi_range(0, 6)

BIN
videos/trailer.ogv Normal file

Binary file not shown.