mirror of
https://github.com/frizbee19/FebGameJam.git
synced 2026-11-11 04:22:40 +00:00
It works because hard corder very odd but yeah
it works sorta yeah sorta.
This commit is contained in:
1 parent
6d43681db6
commit
1cea56dbad
2 files changed
+28
-16
No files matched your search
@@ -859,7 +859,7 @@ BoxCollider2D:
|
|||||||
adaptiveTiling: 0
|
adaptiveTiling: 0
|
||||||
m_AutoTiling: 0
|
m_AutoTiling: 0
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Size: {x: 2, y: 9}
|
m_Size: {x: 4, y: 9}
|
||||||
m_EdgeRadius: 0
|
m_EdgeRadius: 0
|
||||||
--- !u!114 &701830246
|
--- !u!114 &701830246
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
@@ -1148,6 +1148,7 @@ MonoBehaviour:
|
|||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
controller: {fileID: 790075221}
|
controller: {fileID: 790075221}
|
||||||
|
animator: {fileID: 0}
|
||||||
runSpeed: 40
|
runSpeed: 40
|
||||||
--- !u!58 &790075218
|
--- !u!58 &790075218
|
||||||
CircleCollider2D:
|
CircleCollider2D:
|
||||||
@@ -1234,6 +1235,8 @@ MonoBehaviour:
|
|||||||
m_GroundCheck: {fileID: 1772079924}
|
m_GroundCheck: {fileID: 1772079924}
|
||||||
m_CeilingCheck: {fileID: 772189788}
|
m_CeilingCheck: {fileID: 772189788}
|
||||||
m_CrouchDisableCollider: {fileID: 790075219}
|
m_CrouchDisableCollider: {fileID: 790075219}
|
||||||
|
m_Grounded: 0
|
||||||
|
m_Velocity: {x: 0, y: 0, z: 0}
|
||||||
OnLandEvent:
|
OnLandEvent:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
@@ -1583,7 +1586,7 @@ SpriteRenderer:
|
|||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
m_SortingLayerID: 1027733709
|
m_SortingLayerID: 1027733709
|
||||||
m_SortingLayer: 1
|
m_SortingLayer: 2
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
m_Sprite: {fileID: 21300000, guid: f1a2cb3f7f820294b8bf45a3cf11e89a, type: 3}
|
m_Sprite: {fileID: 21300000, guid: f1a2cb3f7f820294b8bf45a3cf11e89a, type: 3}
|
||||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
@@ -2127,7 +2130,7 @@ BoxCollider2D:
|
|||||||
adaptiveTiling: 0
|
adaptiveTiling: 0
|
||||||
m_AutoTiling: 0
|
m_AutoTiling: 0
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Size: {x: 4, y: 116}
|
m_Size: {x: 4, y: 16}
|
||||||
m_EdgeRadius: 0
|
m_EdgeRadius: 0
|
||||||
--- !u!114 &1880558047
|
--- !u!114 &1880558047
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
|||||||
@@ -29,29 +29,38 @@ public class UpdatedWallTrigger : MonoBehaviour
|
|||||||
{
|
{
|
||||||
var rayAngle = Quaternion.AngleAxis((360f / angleStep) * i, target.forward) * Vector3.left;
|
var rayAngle = Quaternion.AngleAxis((360f / angleStep) * i, target.forward) * Vector3.left;
|
||||||
hit = Physics2D.Raycast(target.position, rayAngle, rayLength, layerMask);
|
hit = Physics2D.Raycast(target.position, rayAngle, rayLength, layerMask);
|
||||||
float xe = Mathf.Abs(hit.point.x - target.position.x);
|
float xe = Mathf.Abs(hit.point.x - target.localPosition.x);
|
||||||
float ye = hit.point.y;
|
float ye = Mathf.Abs(hit.point.y - target.position.y);
|
||||||
float goalx = Mathf.Abs(target.localPosition.x / box.size.x);
|
float goalx = Mathf.Abs(target.position.x * box.size.x) ;
|
||||||
|
float goaly = Mathf.Abs(target.position.x * box.size.x);
|
||||||
if (hit && counter >=150)
|
if (hit && counter >=150)
|
||||||
{
|
{
|
||||||
if (xe >= goalx)
|
if (xe >= 44 && xe <50)
|
||||||
{
|
{
|
||||||
Debug.Log("Counter Right "+counter);
|
Debug.Log("Counter Right "+counter);
|
||||||
Debug.Log(xe);
|
|
||||||
Debug.Log("XE " + xe);
|
Debug.Log("XE " + xe);
|
||||||
Debug.Log("Goal " + goalx);
|
Debug.Log("Goaly " + goaly);
|
||||||
camMove.transform.position = new Vector3(camMove.transform.position.x - 22f, camMove.transform.position.y, -1.3f);
|
Debug.Log(target.position.y * box.size.y);
|
||||||
catMove.transform.position = new Vector3(catMove.transform.position.x - 10f, catMove.transform.position.y+1f, 0);
|
camMove.transform.position = new Vector3(camMove.transform.position.x + 22f, camMove.transform.position.y, -1.3f);
|
||||||
|
catMove.transform.position = new Vector3(catMove.transform.position.x + 10f, catMove.transform.position.y+1f, 0);
|
||||||
|
xe = 0;
|
||||||
|
ye = 0;
|
||||||
|
goalx = 0;
|
||||||
|
goaly = 0;
|
||||||
counter = 0;
|
counter = 0;
|
||||||
}
|
}
|
||||||
else if (xe < goalx)
|
else if (xe >=50)
|
||||||
{
|
{
|
||||||
Debug.Log("Counter Left " + counter);
|
Debug.Log("Counter Left " + counter);
|
||||||
Debug.Log("XE "+xe);
|
Debug.Log("XE "+ye);
|
||||||
Debug.Log("Goal "+ goalx);
|
Debug.Log("Goaly "+ goaly);
|
||||||
camMove.transform.position = new Vector3(camMove.transform.position.x + 22f, 0,-1.3f);
|
camMove.transform.position = new Vector3(camMove.transform.position.x - 22f, catMove.transform.position.y + 1.0f,-1.3f);
|
||||||
catMove.transform.position = new Vector3(catMove.transform.position.x + 10f, catMove.transform.position.y +1f,0);
|
catMove.transform.position = new Vector3(catMove.transform.position.x - 10f, catMove.transform.position.y ,0);
|
||||||
counter = 0;
|
counter = 0;
|
||||||
|
xe = 0;
|
||||||
|
ye = 0;
|
||||||
|
goalx = 0;
|
||||||
|
goaly = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
counter++;
|
counter++;
|
||||||
|
|||||||
Reference in new issue
Block a user