Merge branch 'master' of https://github.com/SweetTini/GlobalGameJam2020
This commit is contained in:
18
Assets/Coffee.cs
Normal file
18
Assets/Coffee.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Coffee : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
11
Assets/Coffee.cs.meta
Normal file
11
Assets/Coffee.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b72c6073f9135a4894350d4cde51a76
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -12,16 +12,19 @@ namespace Assets.Model
|
||||
{
|
||||
public KeyCode keyCode;
|
||||
public Tile tile;
|
||||
public Tile pressedTile;
|
||||
public Tile successTile;
|
||||
public Tile failTile;
|
||||
public Vector3Int position;
|
||||
public bool isPlusTile;
|
||||
public bool isPerformed;
|
||||
public bool isPressed;
|
||||
|
||||
public EventControlTile(KeyCode keyCode, Tile tile, Tile successTile, Tile failTile, Vector3Int position, bool isPlusTile = false)
|
||||
public EventControlTile(KeyCode keyCode, Tile tile, Tile pressedTile, Tile successTile, Tile failTile, Vector3Int position, bool isPlusTile = false)
|
||||
{
|
||||
this.keyCode = keyCode;
|
||||
this.tile = tile;
|
||||
this.pressedTile = pressedTile;
|
||||
this.successTile = successTile;
|
||||
this.failTile = failTile;
|
||||
this.position = position;
|
||||
|
||||
@@ -94,7 +94,7 @@ BoxCollider2D:
|
||||
m_Enabled: 1
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IsTrigger: 0
|
||||
m_IsTrigger: 1
|
||||
m_UsedByEffector: 0
|
||||
m_UsedByComposite: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25942ecb34ea3764fad9cf75dc8a4f70
|
||||
guid: 08409a4626c473743bfad5cbdeced2f5
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3095e099213c73c4182d9feeae77ebbd
|
||||
guid: a0bfa73aaf0db804f8fcb5658d35e9bb
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 292f0e8e04642864daaf315efade99c7
|
||||
guid: 790b6cf6ea95f82488f7f9dc1957cafc
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33e618f5ded88f7449cf8c6b88e71c8f
|
||||
guid: 5ca1e8b3336d7554e98fc272bf1370cd
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aafb1c137c5574744b6c2c5b7d5e7055
|
||||
guid: 1e1a4d27514614d41b68c68ab0d147d9
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
|
||||
@@ -175,6 +175,13 @@ MonoBehaviour:
|
||||
- {fileID: 11400000, guid: bfe2d3906a2ea9a459088706930d84a6, type: 2}
|
||||
- {fileID: 11400000, guid: eb62aa8f449e99a499ed3a9dde109158, type: 2}
|
||||
- {fileID: 11400000, guid: 3892d3fd4f09d3546a9c0fa91c23804c, type: 2}
|
||||
pressedTiles:
|
||||
- {fileID: 11400000, guid: ae6e7a8b9fa2433448a66da4090e310c, type: 2}
|
||||
- {fileID: 11400000, guid: ccb4ffcdbc096b448881b3a12ed1bfce, type: 2}
|
||||
- {fileID: 11400000, guid: f3b494a9dede1e34cbf612b95ee136ec, type: 2}
|
||||
- {fileID: 11400000, guid: a6df840757ade3b4b91133bd128a4ca7, type: 2}
|
||||
- {fileID: 11400000, guid: 8e4de2f5a5925ad47b2e5135946daee7, type: 2}
|
||||
- {fileID: 11400000, guid: 8a9fda06d52381844891193f6ed6bb07, type: 2}
|
||||
successTiles:
|
||||
- {fileID: 11400000, guid: c2678bd928e9a0943ad5fadb602db819, type: 2}
|
||||
- {fileID: 11400000, guid: db1d65b4da209fa489ba3d7582dbff24, type: 2}
|
||||
@@ -190,7 +197,7 @@ MonoBehaviour:
|
||||
- {fileID: 11400000, guid: aa0847f2d07a5de409fea20d9eef8f98, type: 2}
|
||||
- {fileID: 11400000, guid: 4a575a19b6cd8a140959a1461963418f, type: 2}
|
||||
plusTile: {fileID: 11400000, guid: ee14e10b7ac07bd449e0f1d5ea99eb42, type: 2}
|
||||
framesPerControlTile: 8
|
||||
framesPerControlTile: 3
|
||||
nextControlYOffset: 2
|
||||
tileMapClearDelayInSeconds: 0.5
|
||||
--- !u!483693784 &1491656
|
||||
@@ -397,6 +404,11 @@ PrefabInstance:
|
||||
propertyPath: m_Size.y
|
||||
value: 1.3199286
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5520736153122788072, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
propertyPath: m_IsTrigger
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6870250841519595495, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
@@ -410,12 +422,12 @@ PrefabInstance:
|
||||
- target: {fileID: 7123021364386132083, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 133.11
|
||||
value: 132.4
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7123021364386132083, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: -13.99
|
||||
value: -18.2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7123021364386132083, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
@@ -462,7 +474,8 @@ PrefabInstance:
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedComponents:
|
||||
- {fileID: 1518483160148691188, guid: 2ccb08e2c4b8851498f8ecbf1a873146, type: 3}
|
||||
m_SourcePrefab: {fileID: 100100000, guid: 2ccb08e2c4b8851498f8ecbf1a873146, type: 3}
|
||||
--- !u!1001 &170428179
|
||||
PrefabInstance:
|
||||
@@ -486,6 +499,11 @@ PrefabInstance:
|
||||
propertyPath: m_SortingLayer
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5520736153122788072, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
propertyPath: m_IsTrigger
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6870250841519595495, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
@@ -1426,6 +1444,11 @@ PrefabInstance:
|
||||
propertyPath: m_SortingLayer
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5520736153122788072, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
propertyPath: m_IsTrigger
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6870250841519595495, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
@@ -1951,6 +1974,11 @@ PrefabInstance:
|
||||
propertyPath: m_Size.y
|
||||
value: 1.3281136
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5520736153122788072, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
propertyPath: m_IsTrigger
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6870250841519595495, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
@@ -47439,6 +47467,11 @@ PrefabInstance:
|
||||
propertyPath: m_SortingLayer
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5520736153122788072, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
propertyPath: m_IsTrigger
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6870250841519595495, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
@@ -47771,6 +47804,7 @@ Transform:
|
||||
m_GameObject: {fileID: 1671840916}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 37, y: -13, z: 0}
|
||||
m_LocalPosition: {x: -10.5, y: 4, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1008122163}
|
||||
@@ -48977,6 +49011,11 @@ PrefabInstance:
|
||||
propertyPath: m_Size.y
|
||||
value: 1.31913
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5520736153122788072, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
propertyPath: m_IsTrigger
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6870250841519595495, guid: 2ccb08e2c4b8851498f8ecbf1a873146,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
|
||||
@@ -11,6 +11,7 @@ public class EventControls : MonoBehaviour
|
||||
[SerializeField] private Camera camera;
|
||||
[SerializeField] private GameObject music;
|
||||
[SerializeField] private List<Tile> tiles;
|
||||
[SerializeField] private List<Tile> pressedTiles;
|
||||
[SerializeField] private List<Tile> successTiles;
|
||||
[SerializeField] private List<Tile> failTiles;
|
||||
[SerializeField] private Tile plusTile;
|
||||
@@ -43,6 +44,7 @@ public class EventControls : MonoBehaviour
|
||||
private EventControlTile currentEventControl;
|
||||
private bool isInBattle = false;
|
||||
private bool hasFailed = false;
|
||||
private int buttonPressAnimationAccumalator = 0;
|
||||
|
||||
private Collider2D currentPlayerCollider;
|
||||
private Collider2D currentEnemyCollider;
|
||||
@@ -177,6 +179,18 @@ public class EventControls : MonoBehaviour
|
||||
|
||||
if (currentEventControl == null)
|
||||
currentEventControl = eventControlTilesInCycle.First(x => !x.isPlusTile && !x.isPerformed);
|
||||
else
|
||||
{
|
||||
if (buttonPressAnimationAccumalator >= framesPerControlTile)
|
||||
{
|
||||
tilemap.SetTile(currentEventControl.position, currentEventControl.isPressed ? currentEventControl.pressedTile :
|
||||
currentEventControl.tile);
|
||||
currentEventControl.isPressed = !currentEventControl.isPressed;
|
||||
buttonPressAnimationAccumalator = 0;
|
||||
}
|
||||
else
|
||||
buttonPressAnimationAccumalator++;
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(currentEventControl.keyCode))
|
||||
{
|
||||
@@ -203,7 +217,7 @@ public class EventControls : MonoBehaviour
|
||||
|
||||
return;
|
||||
}
|
||||
else if (eventCycleAccumalator >= eventCycleInSeconds * framesPerSecond)
|
||||
else if (eventCycleAccumalator >= eventCycleInSeconds * framesPerSecond * player.GetStaminaDifficultyFactor())
|
||||
{
|
||||
eventTriggered = false;
|
||||
isInBattle = false;
|
||||
@@ -294,6 +308,7 @@ public class EventControls : MonoBehaviour
|
||||
|
||||
return new EventControlTile(TileToKeyMappings.TileToKey[randomNumber],
|
||||
tiles[randomNumber],
|
||||
pressedTiles[randomNumber],
|
||||
successTiles[randomNumber],
|
||||
failTiles[randomNumber],
|
||||
position);
|
||||
@@ -305,6 +320,7 @@ public class EventControls : MonoBehaviour
|
||||
plusTile,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
position,
|
||||
true);
|
||||
}
|
||||
|
||||
@@ -80,6 +80,7 @@ public class Player : MonoBehaviour
|
||||
{
|
||||
if (coll.gameObject.tag == "Pizza")
|
||||
{
|
||||
SoundManagerScript.PlaySound("eat");
|
||||
Destroy(coll.gameObject);
|
||||
currentHealth += currentHealth < startHealth ? 1 : 0;
|
||||
healthBar.size = new Vector2(1.5f * currentHealth, this.healthBar.size.y);
|
||||
@@ -115,6 +116,7 @@ public class Player : MonoBehaviour
|
||||
|
||||
private void Hurt()
|
||||
{
|
||||
currentHealth = 3; // TODO: REMOVE!
|
||||
currentHealth -= currentHealth > 0 ? 1 : 0;
|
||||
healthBar.size = new Vector2(1.5f * currentHealth, this.healthBar.size.y);
|
||||
|
||||
@@ -181,6 +183,16 @@ public class Player : MonoBehaviour
|
||||
{
|
||||
rigidBody.velocity = new Vector2(actualRunSpeed * -1, rigidBody.velocity.y);
|
||||
}
|
||||
|
||||
// Run
|
||||
if (Input.GetKeyUp(KeyCode.RightArrow))
|
||||
{
|
||||
rigidBody.velocity = new Vector2(0, rigidBody.velocity.y);
|
||||
}
|
||||
else if (Input.GetKeyUp(KeyCode.LeftArrow))
|
||||
{
|
||||
rigidBody.velocity = new Vector2(0, rigidBody.velocity.y);
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsPlayerOnGround()
|
||||
@@ -289,4 +301,9 @@ public class Player : MonoBehaviour
|
||||
isHurt = true;
|
||||
Hurt();
|
||||
}
|
||||
|
||||
public float GetStaminaDifficultyFactor()
|
||||
{
|
||||
return currentStamina / (startStamina * 1f);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user