fixed the input bug

tysm ymf <333 ur my hero
technically this is a functioning game! gonna get different sfx/sprites working, try to get bezier curves working, then i'll make a pr

* fixed that input bug
* changed some variable names
* getting some more infrastructure for getting the game fully working
This commit is contained in:
AstrlJelly 2023-01-26 18:44:04 -05:00
parent 9f70b02b7c
commit b66bd382c6
3 changed files with 31 additions and 33 deletions

View file

@ -27,7 +27,7 @@ Transform:
m_GameObject: {fileID: 119991411479083905} m_GameObject: {fileID: 119991411479083905}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 5.94, y: 1.345, z: 0} m_LocalPosition: {x: 5.94, y: 1.345, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1.175, y: 1.175, z: 1.175}
m_Children: [] m_Children: []
m_Father: {fileID: 1671099869309974123} m_Father: {fileID: 1671099869309974123}
m_RootOrder: 0 m_RootOrder: 0
@ -107,8 +107,9 @@ MonoBehaviour:
isEligible: 0 isEligible: 0
triggersAutoplay: 1 triggersAutoplay: 1
startBeat: 0 startBeat: 0
CurveFromLeft: {fileID: 1761052573981030483} type: 0
CurveFromRight: {fileID: 8610298732975356966} fromLeft: 0
curve: {fileID: 0}
--- !u!1 &127654075222335198 --- !u!1 &127654075222335198
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1260,7 +1261,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!4 &1671099869309974123 --- !u!4 &1671099869309974123
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1801,7 +1802,7 @@ Transform:
m_GameObject: {fileID: 5163996841361280296} m_GameObject: {fileID: 5163996841361280296}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -17.06, y: 1.345, z: 0} m_LocalPosition: {x: -17.06, y: 1.345, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1.175, y: 1.175, z: 1.175}
m_Children: [] m_Children: []
m_Father: {fileID: 1671099869309974123} m_Father: {fileID: 1671099869309974123}
m_RootOrder: 1 m_RootOrder: 1
@ -1881,8 +1882,9 @@ MonoBehaviour:
isEligible: 0 isEligible: 0
triggersAutoplay: 1 triggersAutoplay: 1
startBeat: 0 startBeat: 0
CurveFromLeft: {fileID: 1761052573981030483} type: 0
CurveFromRight: {fileID: 8610298732975356966} fromLeft: 0
curve: {fileID: 0}
--- !u!1 &5340671340987037539 --- !u!1 &5340671340987037539
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View file

@ -32,7 +32,7 @@ namespace HeavenStudio.Games.Loaders
}, },
new GameAction("ThrowObjectRight", "Throw Right Object") new GameAction("ThrowObjectRight", "Throw Right Object")
{ {
function = delegate { DogNinja.instance.ThrowObjectRight(eventCaller.currentEntity.beat); }, function = delegate { DogNinja.instance.ThrowObjectRight(eventCaller.currentEntity.beat, eventCaller.currentEntity["type"]); },
defaultLength = 2, defaultLength = 2,
parameters = new List<Param>() parameters = new List<Param>()
{ {
@ -129,22 +129,24 @@ namespace HeavenStudio.Games
public void ThrowObjectLeft(float beat, int ObjType) public void ThrowObjectLeft(float beat, int ObjType)
{ {
bool fromLeft = true;
Jukebox.PlayOneShotGame("dogNinja/fruit1"); Jukebox.PlayOneShotGame("dogNinja/fruit1");
//GameObject fo = Instantiate(ObjectLeftBase); ThrowObject Object = Instantiate(ObjectLeftBase).GetComponent<ThrowObject>();
//ThrowObject Object = Instantiate(ObjectLeftBase).GetComponent<ThrowObject>(); Object.startBeat = beat;
//Object.startBeat = beat; Object.type = ObjType;
Object.fromLeft = true;
//ThrowObjectTEST(); Object.curve = CurveFromLeft;
} }
public void ThrowObjectRight(float beat) public void ThrowObjectRight(float beat, int ObjType)
{ {
bool fromLeft = false;
Jukebox.PlayOneShotGame("dogNinja/fruit1"); Jukebox.PlayOneShotGame("dogNinja/fruit1");
ThrowObject Object = Instantiate(ObjectRightBase).GetComponent<ThrowObject>();
Object.startBeat = beat;
Object.type = ObjType;
Object.fromLeft = false;
Object.curve = CurveFromRight;
} }
public void CutEverything(float beat, bool sound) public void CutEverything(float beat, bool sound)

View file

@ -11,25 +11,22 @@ namespace HeavenStudio.Games.Scripts_DogNinja
public class ThrowObject : PlayerActionObject public class ThrowObject : PlayerActionObject
{ {
public float startBeat; public float startBeat;
public int type;
public bool fromLeft;
bool flying = true; bool flying = true;
float flyBeats; float flyBeats;
public int ObjType;
bool fromLeft;
//public ObjectType type; //public ObjectType type;
[Header("Curves")] [Header("Curves")]
public BezierCurve3D CurveFromLeft; public BezierCurve3D curve;
public BezierCurve3D CurveFromRight;
private DogNinja game; private DogNinja game;
private void Awake() private void Awake()
{ {
game = DogNinja.instance; game = DogNinja.instance;
} }
private void Start() private void Start()
@ -37,7 +34,7 @@ namespace HeavenStudio.Games.Scripts_DogNinja
game.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN, Hit, Out, Miss); game.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN, Hit, Out, Miss);
//debug stuff below //debug stuff below
Debug.Log("it's a/an "+ObjType); Debug.Log("it's a/an "+type);
} }
private void Update() private void Update()
@ -49,12 +46,12 @@ namespace HeavenStudio.Games.Scripts_DogNinja
float flyPos = cond.GetPositionFromBeat(startBeat, flyBeats); float flyPos = cond.GetPositionFromBeat(startBeat, flyBeats);
flyPos *= 0.6f; flyPos *= 0.6f;
if (fromLeft) /* if (fromLeft)
{ {
transform.position = CurveFromLeft.GetPoint(flyPos); transform.position = CurveFromLeft.GetPoint(flyPos);
} else { } else {
transform.position = CurveFromRight.GetPoint(flyPos); transform.position = CurveFromRight.GetPoint(flyPos);
} } */
// DESTROYS GAME OBJECT! UNINTENTIONALLY! // DESTROYS GAME OBJECT! UNINTENTIONALLY!
/* if (flyPos > 1f) /* if (flyPos > 1f)
@ -67,9 +64,6 @@ namespace HeavenStudio.Games.Scripts_DogNinja
void CutObject() void CutObject()
{ {
//flying = false;
//game.headAndBodyAnim.Play("BiteR", 0, 0);
Jukebox.PlayOneShotGame("dogNinja/fruit2"); Jukebox.PlayOneShotGame("dogNinja/fruit2");
//SpawnHalves(); //SpawnHalves();