From 52b74c892f1c3d4a887aa5b6fde075b8e2f10df8 Mon Sep 17 00:00:00 2001 From: DPS2004 <10176105+DPS2004@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:47:40 -0400 Subject: [PATCH] tunnel now actually functions as a rhythm game --- .../Tunnel/Animations/Cowbell.controller | 28 +------------------ Assets/Scripts/Games/Tunnel/Tunnel.cs | 19 ++++++++++--- 2 files changed, 16 insertions(+), 31 deletions(-) diff --git a/Assets/Resources/Sprites/Games/Tunnel/Animations/Cowbell.controller b/Assets/Resources/Sprites/Games/Tunnel/Animations/Cowbell.controller index 5690fb740..463069394 100644 --- a/Assets/Resources/Sprites/Games/Tunnel/Animations/Cowbell.controller +++ b/Assets/Resources/Sprites/Games/Tunnel/Animations/Cowbell.controller @@ -49,31 +49,6 @@ AnimatorState: m_MirrorParameter: m_CycleOffsetParameter: m_TimeParameter: ---- !u!1101 &-972722190704787373 -AnimatorStateTransition: - m_ObjectHideFlags: 1 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_Name: - m_Conditions: - - m_ConditionMode: 1 - m_ConditionEvent: bellhit - m_EventTreshold: 0 - m_DstStateMachine: {fileID: 0} - m_DstState: {fileID: -5541921550588990438} - m_Solo: 0 - m_Mute: 0 - m_IsExit: 0 - serializedVersion: 3 - m_TransitionDuration: 0 - m_TransitionOffset: 0 - m_ExitTime: 0.75 - m_HasExitTime: 0 - m_HasFixedDuration: 1 - m_InterruptionSource: 0 - m_OrderedInterruption: 1 - m_CanTransitionToSelf: 1 --- !u!1107 &-278945667835189233 AnimatorStateMachine: serializedVersion: 6 @@ -90,8 +65,7 @@ AnimatorStateMachine: m_State: {fileID: -5541921550588990438} m_Position: {x: 520, y: 20, z: 0} m_ChildStateMachines: [] - m_AnyStateTransitions: - - {fileID: -972722190704787373} + m_AnyStateTransitions: [] m_EntryTransitions: [] m_StateMachineTransitions: {} m_StateMachineBehaviours: [] diff --git a/Assets/Scripts/Games/Tunnel/Tunnel.cs b/Assets/Scripts/Games/Tunnel/Tunnel.cs index c2a576662..18f6b5f11 100644 --- a/Assets/Scripts/Games/Tunnel/Tunnel.cs +++ b/Assets/Scripts/Games/Tunnel/Tunnel.cs @@ -16,7 +16,7 @@ namespace HeavenStudio.Games.Loaders { - new GameAction("Start", delegate { Tunnel.instance.StartCowbell(eventCaller.currentEntity.beat, eventCaller.currentEntity.toggle); }, 1, false, parameters: new List() + new GameAction("Cowbell", delegate { Tunnel.instance.StartCowbell(eventCaller.currentEntity.beat, eventCaller.currentEntity.toggle, eventCaller.currentEntity.length); }, 1f, true, parameters: new List() { new Param("toggle", false, "Driver can stop", "Lets the driver stop if the player makes too many mistakes"), }), @@ -75,6 +75,7 @@ namespace HeavenStudio.Games public float handStart; public float handProgress; + public bool started; private void Awake() { @@ -93,10 +94,10 @@ namespace HeavenStudio.Games private void Update() { - if (PlayerInput.Pressed()) //&& !IsExpectingInputNow()) + if (PlayerInput.Pressed() && !IsExpectingInputNow()) { HitCowbell(); - + print("unexpected input"); } @@ -123,8 +124,16 @@ namespace HeavenStudio.Games cowbellAnimator.Play("Shake",-1,0); } - public void StartCowbell(float beat, bool audienceReacting) + public void StartCowbell(float beat, bool audienceReacting, float length) { + started = true; + + + for (int i = 1; i <= length; i++) + { + ScheduleInput(beat, i, InputType.STANDARD_DOWN, CowbellSuccess, CowbellMiss, CowbellEmpty); + } + //if (coin != null) return; //Play sound and animations @@ -157,6 +166,8 @@ namespace HeavenStudio.Games } + + }