Improved tutorial

This commit is contained in:
Paul Black 2023-05-27 16:49:09 -06:00
parent 00472a781d
commit c296cc608f
13 changed files with 59 additions and 9 deletions

View file

@ -1,7 +1,6 @@
[gd_scene load_steps=11 format=3 uid="uid://dkokyp5lwhks4"] [gd_scene load_steps=10 format=3 uid="uid://dkokyp5lwhks4"]
[ext_resource type="Script" path="res://scripts/maps/tutorial.gd" id="1_40ws8"] [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"]
[ext_resource type="PackedScene" uid="uid://ytbacsuahxie" path="res://scenes/HUD.tscn" id="2_s3v8n"] [ext_resource type="PackedScene" uid="uid://ytbacsuahxie" path="res://scenes/HUD.tscn" id="2_s3v8n"]
[ext_resource type="PackedScene" uid="uid://y3fffh5cdbks" path="res://scenes/AI.tscn" id="4_fttoe"] [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://c1y6p4m0sktfj" path="res://scenes/farmland-map.tscn" id="5_imhi6"]
@ -32,9 +31,6 @@ environment = SubResource("Environment_jlsfy")
transform = Transform3D(-0.866025, -0.433013, 0.25, 0, 0.5, 0.866025, -0.5, 0.75, -0.433013, 0, 0, 0) transform = Transform3D(-0.866025, -0.433013, 0.25, 0, 0.5, 0.866025, -0.5, 0.75, -0.433013, 0, 0, 0)
shadow_enabled = true shadow_enabled = true
[node name="Teddy" parent="." instance=ExtResource("1_081si")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.17483, 1.039, 2.08165e-12)
[node name="HUD" parent="." instance=ExtResource("2_s3v8n")] [node name="HUD" parent="." instance=ExtResource("2_s3v8n")]
[node name="AI" parent="." instance=ExtResource("4_fttoe")] [node name="AI" parent="." instance=ExtResource("4_fttoe")]

View file

@ -69,6 +69,7 @@ func _physics_process(delta):
func dead_AI(): func dead_AI():
health = 100 health = 100
dead = true dead = true
Global.AIKilled = true
$CollisionShape3D/Neck/Teddy.visible = false $CollisionShape3D/Neck/Teddy.visible = false
$CollisionShape3D.disabled = true $CollisionShape3D.disabled = true
await get_tree().create_timer(10).timeout await get_tree().create_timer(10).timeout

View file

@ -102,6 +102,10 @@ func _process(delta):
update_scores(Global.lastPersonToHitMe) update_scores(Global.lastPersonToHitMe)
rpc("killed_text", Global.lastPersonToHitMe, Global.playerName) rpc("killed_text", Global.lastPersonToHitMe, Global.playerName)
killed_text(Global.lastPersonToHitMe, Global.playerName) killed_text(Global.lastPersonToHitMe, Global.playerName)
if Global.AIKilled:
Global.AIKilled = false
update_scores(Global.playerName)
killed_text(Global.playerName, "AI")
if Global.roundInSession == false: if Global.roundInSession == false:
if not roundOver: if not roundOver:
for i in range(Global.connectedPlayers.size()): for i in range(Global.connectedPlayers.size()):
@ -314,7 +318,6 @@ func tutorial():
$TutorialPanel/welcome.visible = true $TutorialPanel/welcome.visible = true
$TutorialPanel/move.visible = true $TutorialPanel/move.visible = true
$TutorialPanel/Wasd.visible = true $TutorialPanel/Wasd.visible = true
$connectedPlayers.size.y += 26
$connectedPlayers/player1Label.text = Global.playerName $connectedPlayers/player1Label.text = Global.playerName
Global.HUDStartLabelText = " " Global.HUDStartLabelText = " "
play_audio(load("res://voice/tutorial/tutorial_1.mp3")) play_audio(load("res://voice/tutorial/tutorial_1.mp3"))
@ -463,6 +466,23 @@ func tutorial_5():
await get_tree().create_timer(14).timeout await get_tree().create_timer(14).timeout
$TutorialPanel.visible = false $TutorialPanel.visible = false
Global.tutorialComplete = true Global.tutorialComplete = true
tutorial_6()
var stage6 = false
var stage6_continue = false
func tutorial_6():
if not stage6 and roundTimer <= 1.0:
print("stage6 fr")
stage6 = true
await get_tree().create_timer(3).timeout
play_audio(load("res://voice/tutorial/tutorial_6.mp3"))
Global.tutorialTimerCompleted = true
if Input.is_action_just_pressed("start_game"):
stage6_continue = true
if stage6_continue:
stage6_continue = false
Global.tutorialTimerCompleted = false
func play_audio(audio): func play_audio(audio):
audio_stream_player.set_stream(audio) audio_stream_player.set_stream(audio)

View file

@ -44,10 +44,12 @@ var spawnCoordsInitalized = false # Used locally
var volumeModifer = 1 # Modifies volume level var volumeModifer = 1 # Modifies volume level
var tutorialComplete = false # Used only for tutorial var tutorialComplete = false # Used only for tutorial
var AIHit = false # Used so the AI knows to take damage var AIHit = false # Used so the AI knows to take damage
var AIKilled = false # Used to add a score to the person that killed the AI
var iAmDeadAndInnocent = false # Used to keep track of when an innocent dies in TTT var iAmDeadAndInnocent = false # Used to keep track of when an innocent dies in TTT
var spawnCotton = false # bullet will change this to true var spawnCotton = false # bullet will change this to true
var addedMenuScene = false # Used for teddy.gd, fixes multiple menu bug 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 tutorialCompleted = false # Used in the save file, to know if a play should go to tutorial first
var tutorialTimerCompleted = false # Used for after the timer goes off in the tutorial
var playerDisable = false # Can be used to disable the player var playerDisable = false # Can be used to disable the player
var playerDeathHealth = 100 # Can be changed by death.gd var playerDeathHealth = 100 # Can be changed by death.gd
var kickAllPlayers = false # Can be set to true to kick all players in-game var kickAllPlayers = false # Can be set to true to kick all players in-game
@ -114,7 +116,9 @@ func reset_variables_hard():
roundTimer = 300.0 roundTimer = 300.0
spawnCoordsInitalized = false spawnCoordsInitalized = false
tutorialComplete = false tutorialComplete = false
tutorialTimerCompleted = false
AIHit = false AIHit = false
AIKilled = false
iAmDeadAndInnocent = false iAmDeadAndInnocent = false
addedMenuScene = false addedMenuScene = false
playerDisable = false playerDisable = false

View file

@ -18,7 +18,7 @@ func _ready():
$AudioStreamPlayer.playing = false $AudioStreamPlayer.playing = false
if Global.playingGame == false: if Global.playingGame == false:
if not Global.tutorialCompleted: if not Global.tutorialCompleted:
get_tree().change_scene_to_file("res://scenes/tutorial.tscn") load_tutorial()
Global.mapName = "Tutorial" Global.mapName = "Tutorial"
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
Global.reset_variables_hard() Global.reset_variables_hard()
@ -35,7 +35,7 @@ func _process(delta):
func _on_button_pressed(): func _on_button_pressed():
if Global.playingGame == false: if Global.playingGame == false:
get_tree().change_scene_to_file("res://scenes/tutorial.tscn") load_tutorial()
Global.mapName = "Tutorial" Global.mapName = "Tutorial"
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
elif Global.playingGame == true: elif Global.playingGame == true:
@ -111,3 +111,11 @@ func _on_light_button_pressed():
func _on_issues_button_pressed(): func _on_issues_button_pressed():
OS.shell_open("https://git.techwizz-emu.com/the_adventures_of_teddy/public_issues/issues") OS.shell_open("https://git.techwizz-emu.com/the_adventures_of_teddy/public_issues/issues")
func load_tutorial():
Global.playerPleaseRespawn = true
Networking.create_server(28000, 1)
Networking.load_map("res://scenes/tutorial.tscn")
Networking.add_player_node(1)
Global.connectedPlayers += [Global.playerName]
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)

View file

@ -24,7 +24,7 @@ func _process(delta):
else: else:
Global.playerDisable = false Global.playerDisable = false
$skipLabel.visible = false $skipLabel.visible = false
if Global.tutorialComplete: if Global.tutorialComplete and not Global.tutorialTimerCompleted:
if audio_stream_player.playing == false: if audio_stream_player.playing == false:
var randomnum = RandomNumberGenerator.new().randi_range(0, 6) var randomnum = RandomNumberGenerator.new().randi_range(0, 6)
if randomnum == 0: if randomnum == 0:
@ -58,6 +58,8 @@ func _process(delta):
else: else:
print("This shouldn't ever be called, toyland.gd") print("This shouldn't ever be called, toyland.gd")
Global.musicUpdated = true Global.musicUpdated = true
if Global.tutorialTimerCompleted:
audio_stream_player.playing = false
func play_music(music): func play_music(music):

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,19 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://dvonn5lnwl0q2"
path="res://.godot/imported/tutorial_6.mp3-b1d6b73fb5317590e0fc1b3965c50424.mp3str"
[deps]
source_file="res://voice/tutorial/tutorial_6.mp3"
dest_files=["res://.godot/imported/tutorial_6.mp3-b1d6b73fb5317590e0fc1b3965c50424.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4