DJ School sounds

This commit is contained in:
Braedon
2022-02-02 21:09:50 -05:00
parent ad4b10c7d8
commit 3941410e17
132 changed files with 5954 additions and 56 deletions

View File

@ -0,0 +1,145 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
/// <summary>
/// A simple free camera to be added to a Unity game object.
///
/// Keys:
/// wasd / arrows - movement
/// q/e - up/down (local space)
/// r/f - up/down (world space)
/// pageup/pagedown - up/down (world space)
/// hold shift - enable fast movement mode
/// right mouse - enable free look
/// mouse - free look / rotation
///
/// </summary>
public class FreeCam : MonoBehaviour
{
/// <summary>
/// Normal speed of camera movement.
/// </summary>
public float movementSpeed = 2f;
/// <summary>
/// Speed of camera movement when shift is held down,
/// </summary>
public float fastMovementSpeed = 15f;
/// <summary>
/// Sensitivity for free look.
/// </summary>
public float freeLookSensitivity = 2f;
/// <summary>
/// Amount to zoom the camera when using the mouse wheel.
/// </summary>
public float zoomSensitivity = 10f;
/// <summary>
/// Amount to zoom the camera when using the mouse wheel (fast mode).
/// </summary>
public float fastZoomSensitivity = 50f;
/// <summary>
/// Set to true when free looking (on right mouse button).
/// </summary>
private bool looking = false;
void Update()
{
var fastMode = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift);
var movementSpeed = fastMode ? this.fastMovementSpeed : this.movementSpeed;
if (Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.LeftArrow))
{
transform.position = transform.position + (-transform.right * movementSpeed * Time.deltaTime);
}
if (Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.RightArrow))
{
transform.position = transform.position + (transform.right * movementSpeed * Time.deltaTime);
}
if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.UpArrow))
{
transform.position = transform.position + (transform.forward * movementSpeed * Time.deltaTime);
}
if (Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.DownArrow))
{
transform.position = transform.position + (-transform.forward * movementSpeed * Time.deltaTime);
}
if (Input.GetKey(KeyCode.Q))
{
transform.position = transform.position + (transform.up * movementSpeed * Time.deltaTime);
}
if (Input.GetKey(KeyCode.E))
{
transform.position = transform.position + (-transform.up * movementSpeed * Time.deltaTime);
}
if (Input.GetKey(KeyCode.R) || Input.GetKey(KeyCode.PageUp))
{
transform.position = transform.position + (Vector3.up * movementSpeed * Time.deltaTime);
}
if (Input.GetKey(KeyCode.F) || Input.GetKey(KeyCode.PageDown))
{
transform.position = transform.position + (-Vector3.up * movementSpeed * Time.deltaTime);
}
if (looking)
{
float newRotationX = transform.localEulerAngles.y + Input.GetAxis("Mouse X") * freeLookSensitivity;
float newRotationY = transform.localEulerAngles.x - Input.GetAxis("Mouse Y") * freeLookSensitivity;
transform.localEulerAngles = new Vector3(newRotationY, newRotationX, 0f);
}
float axis = Input.GetAxis("Mouse ScrollWheel");
if (axis != 0)
{
var zoomSensitivity = fastMode ? this.fastZoomSensitivity : this.zoomSensitivity;
transform.position = transform.position + transform.forward * axis * zoomSensitivity;
}
if (Input.GetKeyDown(KeyCode.Mouse1))
{
StartLooking();
}
else if (Input.GetKeyUp(KeyCode.Mouse1))
{
StopLooking();
}
}
void OnDisable()
{
StopLooking();
}
/// <summary>
/// Enable free looking.
/// </summary>
public void StartLooking()
{
looking = true;
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Locked;
}
/// <summary>
/// Disable free looking.
/// </summary>
public void StopLooking()
{
looking = false;
Cursor.visible = true;
Cursor.lockState = CursorLockMode.None;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a0e5d5d77f9b8824b997a02d704003ef
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace RhythmHeavenMania
{
public class GameCamera : MonoBehaviour
{
public static GameCamera instance { get; private set; }
public new Camera camera;
[Header("Components")]
public Color baseColor;
private void Awake()
{
instance = this;
camera = this.GetComponent<Camera>();
}
private void Start()
{
camera.backgroundColor = baseColor;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a774f8053d895604cb8ded8c46de6733
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 51d95684617a83745b551fa3687d2a01
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,34 @@
using RhythmHeavenMania.Util;
namespace RhythmHeavenMania.Games.DJSchool
{
public class DJSchool : Minigame
{
public static DJSchool instance { get; private set; }
private void Awake()
{
instance = this;
}
public void BreakCmon(float beat)
{
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("djSchool/breakCmon1", beat),
new MultiSound.Sound("djSchool/breakCmon2", beat + 1f),
new MultiSound.Sound("djSchool/ooh", beat + 2f),
});
}
public void ScratchoHey(float beat)
{
MultiSound.Play(new MultiSound.Sound[]
{
new MultiSound.Sound("djSchool/scratchoHey1", beat),
new MultiSound.Sound("djSchool/scratchoHey2", beat + 1f),
new MultiSound.Sound("djSchool/hey", beat + 2f),
});
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 36f587267a500e643bcbf5b9c04bb1b5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c3ad2a7be988b204e8eb10ec0871948c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace RhythmHeavenMania.Games.RhythmRally
{
public class RhythmRally : MonoBehaviour
{
public Transform cameraPos;
// Start is called before the first frame update
void Start()
{
GameCamera.instance.camera.transform.position = cameraPos.position;
GameCamera.instance.camera.transform.rotation = cameraPos.rotation;
GameCamera.instance.camera.fieldOfView = 41f;
GameCamera.instance.camera.backgroundColor = Color.white;
}
// Update is called once per frame
void Update()
{
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 35772aee9756b5040ab64a73ebc3f8ae
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -197,7 +197,7 @@ namespace RhythmHeavenMania.Games.SpaceSoccer
}
else
{
toeCurve.KeyPoints[1].transform.position = new Vector3(kicker.transform.position.x - 0.7f, kicker.transform.position.y - 6f);
toeCurve.KeyPoints[1].transform.position = new Vector3(kicker.transform.position.x - 1.0f, kicker.transform.position.y - 6f);
}
holder.transform.localPosition = toeCurve.GetPoint(normalizedBeatAnim);

View File

@ -33,7 +33,7 @@ namespace RhythmHeavenMania.Games.Spaceball
{
for (int i = 1; i < BallsHolder.transform.childCount; i++)
Destroy(BallsHolder.transform.GetChild(i).gameObject);
GameManager.instance.GameCamera.orthographic = false;
GameCamera.instance.camera.orthographic = false;
if (EligibleHits.Count > 0)
EligibleHits.RemoveRange(0, EligibleHits.Count);
@ -52,7 +52,7 @@ namespace RhythmHeavenMania.Games.Spaceball
private void Start()
{
allCameraEvents = EventCaller.GetAllInGameManagerList("spaceball", new string[] { "cameraZoom" });
GameManager.instance.GameCamera.transform.localPosition = new Vector3(0, 0, -10);
GameCamera.instance.camera.transform.localPosition = new Vector3(0, 0, -10);
}
private void Update()
@ -83,18 +83,18 @@ namespace RhythmHeavenMania.Games.Spaceball
if (normalizedBeat > Minigame.EndTime())
{
lastCamDistance = GameManager.instance.GameCamera.transform.localPosition.z;
lastCamDistance = GameCamera.instance.camera.transform.localPosition.z;
}
else
{
if (currentZoomCamLength <= 0)
{
GameManager.instance.GameCamera.transform.localPosition = new Vector3(0, 0, currentZoomCamDistance);
GameCamera.instance.camera.transform.localPosition = new Vector3(0, 0, currentZoomCamDistance);
}
else
{
float newPosZ = Mathf.Lerp(lastCamDistance, currentZoomCamDistance, normalizedBeat);
GameManager.instance.GameCamera.transform.localPosition = new Vector3(0, 0, newPosZ);
GameCamera.instance.camera.transform.localPosition = new Vector3(0, 0, newPosZ);
}
}
}

View File

@ -53,6 +53,7 @@ namespace RhythmHeavenMania.Editor
private string currentRemixPath = "";
private int lastEditorObjectsCount = 0;
private bool fullscreen;
public bool discordDuringTesting = false;
public static Editor instance { get; private set; }
@ -64,7 +65,7 @@ namespace RhythmHeavenMania.Editor
public void Init()
{
GameManager.instance.GameCamera.targetTexture = ScreenRenderTexture;
GameCamera.instance.camera.targetTexture = ScreenRenderTexture;
GameManager.instance.CursorCam.targetTexture = ScreenRenderTexture;
Screen.texture = ScreenRenderTexture;
@ -382,22 +383,23 @@ namespace RhythmHeavenMania.Editor
{
MainCanvas.enabled = false;
EditorCamera.enabled = false;
GameManager.instance.GameCamera.targetTexture = null;
// GameManager.instance.GameCamera.transform.parent.GetChild(1).GetComponent<Camera>().enabled = false;
GameCamera.instance.camera.targetTexture = null;
GameCamera.instance.camera.transform.parent.GetChild(1).GetComponent<Camera>().enabled = false;
fullscreen = true;
}
else
{
MainCanvas.enabled = true;
EditorCamera.enabled = true;
GameManager.instance.GameCamera.targetTexture = ScreenRenderTexture;
// GameManager.instance.GameCamera.transform.parent.GetChild(1).GetComponent<Camera>().enabled = true;
GameCamera.instance.camera.targetTexture = ScreenRenderTexture;
GameCamera.instance.camera.transform.parent.GetChild(1).GetComponent<Camera>().enabled = true;
fullscreen = false;
}
}
private void UpdateEditorStatus(bool updateTime)
{
if (discordDuringTesting || !Application.isEditor)
DiscordRPC.DiscordRPC.UpdateActivity("In Editor", $"Objects: {GameManager.instance.Beatmap.entities.Count + GameManager.instance.Beatmap.tempoChanges.Count}", updateTime);
}

View File

@ -9,6 +9,7 @@ using RhythmHeavenMania.Games.ClappyTrio;
using RhythmHeavenMania.Games.Spaceball;
using RhythmHeavenMania.Games.KarateMan;
using RhythmHeavenMania.Games.SpaceSoccer;
using RhythmHeavenMania.Games.DJSchool;
namespace RhythmHeavenMania
{
@ -20,9 +21,10 @@ namespace RhythmHeavenMania
public string displayName;
public string color;
public GameObject holder;
public bool threeD;
public List<GameAction> actions = new List<GameAction>();
public Minigame(string name, string displayName, string color, List<GameAction> actions)
public Minigame(string name, string displayName, string color, bool threeD, List<GameAction> actions)
{
this.name = name;
this.displayName = displayName;
@ -53,60 +55,66 @@ namespace RhythmHeavenMania
{
eventCaller.minigames = new List<Minigame>()
{
new Minigame("gameManager", "Game Manager", "", new List<GameAction>()
new Minigame("gameManager", "Game Manager", "", false, new List<GameAction>()
{
new GameAction("end", delegate { Debug.Log("end"); }),
new GameAction("switchGame", delegate { GameManager.instance.SwitchGame(eventCaller.currentSwitchGame); })
new GameAction("end", delegate { Debug.Log("end"); }),
new GameAction("switchGame", delegate { GameManager.instance.SwitchGame(eventCaller.currentSwitchGame); })
}),
new Minigame("forkLifter", "Fork Lifter", "FFFFFF", new List<GameAction>()
new Minigame("forkLifter", "Fork Lifter", "FFFFFF", false, new List<GameAction>()
{
new GameAction("pea", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 0); }, 3),
new GameAction("topbun", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 1); }, 3),
new GameAction("burger", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 2); }, 3),
new GameAction("bottombun", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 3); }, 3),
new GameAction("prepare", delegate { ForkLifter.instance.ForkLifterHand.Prepare(); }, 0.5f),
new GameAction("gulp", delegate { ForkLifterPlayer.instance.Eat(); }),
new GameAction("sigh", delegate { Jukebox.PlayOneShot("sigh"); })
new GameAction("pea", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 0); }, 3),
new GameAction("topbun", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 1); }, 3),
new GameAction("burger", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 2); }, 3),
new GameAction("bottombun", delegate { ForkLifter.instance.Flick(eventCaller.currentBeat, 3); }, 3),
new GameAction("prepare", delegate { ForkLifter.instance.ForkLifterHand.Prepare(); }, 0.5f),
new GameAction("gulp", delegate { ForkLifterPlayer.instance.Eat(); }),
new GameAction("sigh", delegate { Jukebox.PlayOneShot("sigh"); })
}),
new Minigame("clappyTrio", "The Clappy Trio", "29E7FF", new List<GameAction>()
new Minigame("clappyTrio", "The Clappy Trio", "29E7FF", false, new List<GameAction>()
{
new GameAction("clap", delegate { ClappyTrio.instance.Clap(eventCaller.currentBeat, eventCaller.currentLength); }, 3, true),
new GameAction("bop", delegate { ClappyTrio.instance.Bop(eventCaller.currentBeat); } ),
new GameAction("prepare", delegate { ClappyTrio.instance.Prepare(0); } ),
new GameAction("prepare_alt", delegate { ClappyTrio.instance.Prepare(3); } ),
new GameAction("clap", delegate { ClappyTrio.instance.Clap(eventCaller.currentBeat, eventCaller.currentLength); }, 3, true),
new GameAction("bop", delegate { ClappyTrio.instance.Bop(eventCaller.currentBeat); } ),
new GameAction("prepare", delegate { ClappyTrio.instance.Prepare(0); } ),
new GameAction("prepare_alt", delegate { ClappyTrio.instance.Prepare(3); } ),
}),
new Minigame("spaceball", "Spaceball", "00A518", new List<GameAction>()
new Minigame("spaceball", "Spaceball", "00A518", false, new List<GameAction>()
{
new GameAction("shoot", delegate { Spaceball.instance.Shoot(eventCaller.currentBeat, false, eventCaller.currentType); }, 2),
new GameAction("shootHigh", delegate { Spaceball.instance.Shoot(eventCaller.currentBeat, true, eventCaller.currentType); }, 3),
new GameAction("costume", delegate { Spaceball.instance.Costume(eventCaller.currentType); } ),
new GameAction("alien", delegate { Spaceball.instance.alien.Show(eventCaller.currentBeat); } ),
new GameAction("cameraZoom", delegate { }, 4, true ),
new GameAction("shoot", delegate { Spaceball.instance.Shoot(eventCaller.currentBeat, false, eventCaller.currentType); }, 2),
new GameAction("shootHigh", delegate { Spaceball.instance.Shoot(eventCaller.currentBeat, true, eventCaller.currentType); }, 3),
new GameAction("costume", delegate { Spaceball.instance.Costume(eventCaller.currentType); } ),
new GameAction("alien", delegate { Spaceball.instance.alien.Show(eventCaller.currentBeat); } ),
new GameAction("cameraZoom", delegate { }, 4, true ),
}),
new Minigame("karateman", "Karate Man", "70A8D8", new List<GameAction>()
new Minigame("karateman", "Karate Man", "70A8D8", false, new List<GameAction>()
{
new GameAction("bop", delegate { KarateMan.instance.Bop(eventCaller.currentBeat, eventCaller.currentLength); }, 0.5f, true),
new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 0); }, 2),
new GameAction("bulb", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 1); }, 2),
new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 2); }, 2),
new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 3); }, 2),
new GameAction("kick", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 4); }, 4.5f),
new GameAction("combo", delegate { KarateMan.instance.Combo(eventCaller.currentBeat); }, 4f),
new GameAction("hit3", delegate { KarateMan.instance.Hit3(eventCaller.currentBeat); }),
new GameAction("hit4", delegate { KarateMan.instance.Hit4(eventCaller.currentBeat); }),
new GameAction("prepare", delegate { KarateMan.instance.Prepare(eventCaller.currentBeat, eventCaller.currentLength); }, 1f, true),
new GameAction("bgfxon", delegate { KarateMan.instance.BGFXOn(); } ),
new GameAction("bgfxoff", delegate { KarateMan.instance.BGFXOff(); }),
new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 6); }, 2),
new GameAction("bop", delegate { KarateMan.instance.Bop(eventCaller.currentBeat, eventCaller.currentLength); }, 0.5f, true),
new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 0); }, 2),
new GameAction("bulb", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 1); }, 2),
new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 2); }, 2),
new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 3); }, 2),
new GameAction("kick", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 4); }, 4.5f),
new GameAction("combo", delegate { KarateMan.instance.Combo(eventCaller.currentBeat); }, 4f),
new GameAction("hit3", delegate { KarateMan.instance.Hit3(eventCaller.currentBeat); }),
new GameAction("hit4", delegate { KarateMan.instance.Hit4(eventCaller.currentBeat); }),
new GameAction("prepare", delegate { KarateMan.instance.Prepare(eventCaller.currentBeat, eventCaller.currentLength); }, 1f, true),
new GameAction("bgfxon", delegate { KarateMan.instance.BGFXOn(); } ),
new GameAction("bgfxoff", delegate { KarateMan.instance.BGFXOff(); }),
new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentBeat, 6); }, 2),
}),
new Minigame("spaceSoccer", "Space Soccer", "B888F8", new List<GameAction>()
new Minigame("spaceSoccer", "Space Soccer", "B888F8", false, new List<GameAction>()
{
new GameAction("ball dispense", delegate { SpaceSoccer.instance.Dispense(eventCaller.currentBeat); }, 2f),
new GameAction("keep-up", delegate { }, 4f, true),
new GameAction("high kick-toe!", delegate { }, 3f),
}),
/*new Minigame("djSchool", "DJ School", "B888F8", new List<GameAction>()
new Minigame("djSchool", "DJ School \n<color=#eb5454>[Non-Playable]</color>", "B888F8", false, new List<GameAction>()
{
new GameAction("break c'mon ooh", delegate { DJSchool.instance.BreakCmon(eventCaller.currentBeat); }, 3f),
new GameAction("scratch-o hey", delegate { DJSchool.instance.ScratchoHey(eventCaller.currentBeat); }, 3f),
}),
/*new Minigame("rhythmRally", "Rhythm Rally", "B888F8", true, new List<GameAction>()
{
}),
new Minigame("spaceDance", "Space Dance", "B888F8", new List<GameAction>()
{
@ -120,9 +128,6 @@ namespace RhythmHeavenMania
new Minigame("munchyMonk", "Munchy Monk", "B888F8", new List<GameAction>()
{
}),
new Minigame("rhythmRally", "Rhythm Rally", "B888F8", new List<GameAction>()
{
}),
new Minigame("airRally", "Air Rally", "B888F8", new List<GameAction>()
{
}),