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_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
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_Father: {fileID: 1671099869309974123}
m_RootOrder: 0
@ -107,8 +107,9 @@ MonoBehaviour:
isEligible: 0
triggersAutoplay: 1
startBeat: 0
CurveFromLeft: {fileID: 1761052573981030483}
CurveFromRight: {fileID: 8610298732975356966}
type: 0
fromLeft: 0
curve: {fileID: 0}
--- !u!1 &127654075222335198
GameObject:
m_ObjectHideFlags: 0
@ -1260,7 +1261,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &1671099869309974123
Transform:
m_ObjectHideFlags: 0
@ -1801,7 +1802,7 @@ Transform:
m_GameObject: {fileID: 5163996841361280296}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
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_Father: {fileID: 1671099869309974123}
m_RootOrder: 1
@ -1881,8 +1882,9 @@ MonoBehaviour:
isEligible: 0
triggersAutoplay: 1
startBeat: 0
CurveFromLeft: {fileID: 1761052573981030483}
CurveFromRight: {fileID: 8610298732975356966}
type: 0
fromLeft: 0
curve: {fileID: 0}
--- !u!1 &5340671340987037539
GameObject:
m_ObjectHideFlags: 0

View file

@ -32,7 +32,7 @@ namespace HeavenStudio.Games.Loaders
},
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,
parameters = new List<Param>()
{
@ -76,7 +76,7 @@ namespace HeavenStudio.Games
public GameObject Dog;
public Transform ObjectHolder;
public Transform HalvesHolder;
[Header("Curves")]
public BezierCurve3D CurveFromLeft;
public BezierCurve3D CurveFromRight;
@ -129,22 +129,24 @@ namespace HeavenStudio.Games
public void ThrowObjectLeft(float beat, int ObjType)
{
bool fromLeft = true;
Jukebox.PlayOneShotGame("dogNinja/fruit1");
//GameObject fo = Instantiate(ObjectLeftBase);
//ThrowObject Object = Instantiate(ObjectLeftBase).GetComponent<ThrowObject>();
//Object.startBeat = beat;
//ThrowObjectTEST();
ThrowObject Object = Instantiate(ObjectLeftBase).GetComponent<ThrowObject>();
Object.startBeat = beat;
Object.type = ObjType;
Object.fromLeft = true;
Object.curve = CurveFromLeft;
}
public void ThrowObjectRight(float beat)
public void ThrowObjectRight(float beat, int ObjType)
{
bool fromLeft = false;
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)

View file

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