Merge branch 'master' of https://github.com/SweetTini/GlobalGameJam2020
This commit is contained in:
@@ -4,9 +4,10 @@ using UnityEngine;
|
|||||||
|
|
||||||
public class BugMovement : MonoBehaviour
|
public class BugMovement : MonoBehaviour
|
||||||
{
|
{
|
||||||
[SerializeField] private int secondsGoingLeft = 1;
|
[SerializeField] private float secondsGoingLeft = 1;
|
||||||
[SerializeField] private int secondsGoingRight = 1;
|
[SerializeField] private float secondsGoingRight = 1;
|
||||||
[SerializeField] private float movementSpeed = 10;
|
[SerializeField] private float movementSpeed = 10;
|
||||||
|
[SerializeField] PolygonCollider2D playerCollider;
|
||||||
|
|
||||||
private int leftAccumalator = 0;
|
private int leftAccumalator = 0;
|
||||||
private int rightAccumalator = 0;
|
private int rightAccumalator = 0;
|
||||||
@@ -16,8 +17,7 @@ public class BugMovement : MonoBehaviour
|
|||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
// Physics2D.IgnoreLayerCollision(LayerMask.GetMask())
|
Physics2D.IgnoreCollision(GetComponent<BoxCollider2D>(), playerCollider);
|
||||||
|
|
||||||
rigidBody = GetComponent<Rigidbody2D>();
|
rigidBody = GetComponent<Rigidbody2D>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1317,10 +1317,15 @@ PrefabInstance:
|
|||||||
propertyPath: m_BodyType
|
propertyPath: m_BodyType
|
||||||
value: 0
|
value: 0
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
|
- target: {fileID: 3827363133515929334, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_GravityScale
|
||||||
|
value: 2
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 3827363133515929335, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
|
- target: {fileID: 3827363133515929335, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: movementSpeed
|
propertyPath: movementSpeed
|
||||||
value: 1
|
value: 2
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 3827363133515929335, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
|
- target: {fileID: 3827363133515929335, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
|
||||||
type: 3}
|
type: 3}
|
||||||
@@ -1330,7 +1335,7 @@ PrefabInstance:
|
|||||||
- target: {fileID: 3827363133515929335, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
|
- target: {fileID: 3827363133515929335, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: secondsGoingRight
|
propertyPath: secondsGoingRight
|
||||||
value: 2
|
value: 8
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
m_RemovedComponents: []
|
m_RemovedComponents: []
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a, type: 3}
|
||||||
|
|||||||
@@ -4,5 +4,7 @@ using UnityEngine;
|
|||||||
|
|
||||||
public static class LayerNames
|
public static class LayerNames
|
||||||
{
|
{
|
||||||
|
public static string Enemies => "Enemies";
|
||||||
|
public static string Ground => "Ground";
|
||||||
|
public static string Player => "Player";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ public class Player : MonoBehaviour
|
|||||||
[SerializeField] private float runFasterFactor = 1.5f;
|
[SerializeField] private float runFasterFactor = 1.5f;
|
||||||
|
|
||||||
private Rigidbody2D rigidbody;
|
private Rigidbody2D rigidbody;
|
||||||
private string enemiesLayerName => "Enemies";
|
|
||||||
private string groundLayerName => "Ground";
|
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
@@ -31,7 +29,7 @@ public class Player : MonoBehaviour
|
|||||||
|
|
||||||
private void Jump()
|
private void Jump()
|
||||||
{
|
{
|
||||||
var playerOnGround = rigidbody.IsTouchingLayers(LayerMask.GetMask(groundLayerName));
|
var playerOnGround = rigidbody.IsTouchingLayers(LayerMask.GetMask(LayerNames.Ground));
|
||||||
|
|
||||||
// Jump
|
// Jump
|
||||||
if (Input.GetKey(KeyCode.Space) && playerOnGround)
|
if (Input.GetKey(KeyCode.Space) && playerOnGround)
|
||||||
@@ -65,6 +63,6 @@ public class Player : MonoBehaviour
|
|||||||
|
|
||||||
private bool HasEncounteredEnemy()
|
private bool HasEncounteredEnemy()
|
||||||
{
|
{
|
||||||
return rigidbody.IsTouchingLayers(LayerMask.GetMask(enemiesLayerName));
|
return rigidbody.IsTouchingLayers(LayerMask.GetMask(LayerNames.Enemies));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,42 +82,6 @@ TextureImporter:
|
|||||||
overridden: 0
|
overridden: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Windows Store Apps
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: iPhone
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Android
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: WebGL
|
buildTarget: WebGL
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
|
|||||||
Reference in New Issue
Block a user