made more bugs

This commit is contained in:
2020-02-02 12:12:11 -05:00
parent b93b0f7cfe
commit d4cca79ab3
11 changed files with 1265 additions and 1103 deletions

View File

@@ -16,7 +16,7 @@ GameObject:
- component: {fileID: -6605527394410161759}
m_Layer: 9
m_Name: GioBug
m_TagString: Untagged
m_TagString: Kat Bug
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@@ -98,7 +98,7 @@ BoxCollider2D:
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0.03701496, y: -0.01850748}
m_Offset: {x: -0.2753334, y: 1.7770281}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
@@ -109,7 +109,7 @@ BoxCollider2D:
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 2.51762, y: 2.6286669}
m_Size: {x: 2.815094, y: 3.5491123}
m_EdgeRadius: 0
--- !u!114 &3827363133515929335
MonoBehaviour:
@@ -125,9 +125,9 @@ MonoBehaviour:
m_EditorClassIdentifier:
secondsGoingLeft: 0.8
secondsGoingRight: 0.8
movementSpeed: 2.2
eventTriggerCount: 1
controlTriggerCounterEvent: 1
movementSpeed: 2.6
eventTriggerCount: 2
controlTriggerCounterEvent: 2
playerCollider: {fileID: 0}
eventControls: {fileID: 0}
player: {fileID: 0}

View File

@@ -0,0 +1,137 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &8633131507466429591
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: -6605527394410161759, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_Controller
value:
objectReference: {fileID: 9100000, guid: 8b1593eba53dfd848ba134d626f63f6c, type: 2}
- target: {fileID: 3827363133515929328, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_SpriteTilingProperty.pivot.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929328, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_SpriteTilingProperty.oldSize.x
value: 4
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929328, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_SpriteTilingProperty.oldSize.y
value: 4
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929329, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_Sprite
value:
objectReference: {fileID: 5875687446670976453, guid: b0ab9d2a48d01f64892a3fddb3ab1622,
type: 3}
- target: {fileID: 3827363133515929330, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_LocalPosition.x
value: 56
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929330, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_LocalPosition.y
value: 3
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929330, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929330, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929330, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929330, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929330, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929330, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929330, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929330, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929330, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929330, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_LocalScale.x
value: -1
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929330, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929330, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929333, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: m_Name
value: KatBug
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929335, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: playerCollider
value:
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929335, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: player
value:
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929335, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: eventControls
value:
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929335, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: controlTriggerCounterEvent
value: 3
objectReference: {fileID: 0}
- target: {fileID: 3827363133515929335, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a,
type: 3}
propertyPath: eventTriggerCount
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ef13d4cb4d0a2b043b4f2a6cc75ca48a, type: 3}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c98830a6bebcdc24b91c550a26c9b621
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -178,7 +178,7 @@ public class EventControls : MonoBehaviour
eventTriggered = false;
eventCycleAccumalator = 0;
if (maxNumberOfControlTiles == numberOfEventsCount)
if (maxNumberOfEvents == numberOfEventsCount)
{
player.EndEncounter();
isInBattle = false;
@@ -242,7 +242,7 @@ public class EventControls : MonoBehaviour
eventDrawn = false;
numberOfControlTilesSet = 0;
if (maxNumberOfControlTiles == numberOfEventsCount)
if (maxNumberOfEvents == numberOfEventsCount)
{
if (currentEnemyCollider != null && hasFailed)
Physics2D.IgnoreCollision(currentPlayerCollider, currentEnemyCollider, false);

View File

@@ -30,17 +30,20 @@ public class Player : MonoBehaviour
private Animator animator;
private bool isMovementEnabled = true;
private bool isFighting = false;
private bool isHurt = false;
private void Start()
{
rigidBody = GetComponent<Rigidbody2D>();
collider = GetComponent<Collider2D>();
animator = GetComponent<Animator>();
currentHealth = 1; // startHealth;
currentStamina = 50; // startStamina;
currentHealth = startHealth;
healthBar.size = new Vector2(1.5f * startHealth, healthBar.size.y);
currentStamina = startStamina;
staminaInitialSize = staminaBar.size.x;
staminaBar.size = new Vector2(staminaInitialSize * 0.5f, staminaBar.size.y);
staminaBar.size = new Vector2(staminaInitialSize, staminaBar.size.y);
}
private void Update()
@@ -98,11 +101,13 @@ public class Player : MonoBehaviour
{
int result = currentStamina - GetStaminaValueChange(bugStaminaDamagePercent);
currentStamina = result < 0 ? 0 : result;
float multiplier = currentStamina * 1f / startStamina;
staminaBar.size = new Vector2(staminaInitialSize * multiplier, staminaBar.size.y);
}
private int GetStaminaValueChange(int percentage)
{
return currentStamina < startStamina ? (startStamina * percentage / 100) : 0;
return currentStamina <= startStamina ? (startStamina * percentage / 100) : 0;
}
@@ -115,6 +120,11 @@ public class Player : MonoBehaviour
FlipSprite();
}
if (Mathf.Abs(rigidBody.velocity.y) < runErrorThreshold)
{
isHurt = false;
};
HandleAnimations();
}
@@ -217,6 +227,7 @@ public class Player : MonoBehaviour
animator.SetBool("IsGround", IsPlayerOnGround());
animator.SetFloat("YVelocity", rigidBody.velocity.y);
animator.SetBool("IsFighting", isFighting);
animator.SetBool("IsHurt", isHurt);
}
public void StartEncounter()
@@ -229,11 +240,13 @@ public class Player : MonoBehaviour
{
isFighting = false;
isMovementEnabled = true;
DecreaseStaminaAfterBugFight();
}
public void ThrowUserInTheAirHurt()
{
GetComponent<Rigidbody2D>().velocity += new Vector2(Mathf.Sign(transform.localScale.x) * -1 * hurtVelocity, hurtVelocity);
isFighting = false;
isHurt = true;
}
}

View File

@@ -0,0 +1,11 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!62 &6200000
PhysicsMaterial2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Bug Physics Material
friction: 0.05
bounciness: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8bbf95d8d23ff94449785e66e0ae11ec
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 6200000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -178,7 +178,7 @@ TextureImporter:
width: 22
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -197,9 +197,9 @@ TextureImporter:
x: 25
y: 265
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -218,9 +218,9 @@ TextureImporter:
x: 1
y: 241
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -239,9 +239,9 @@ TextureImporter:
x: 25
y: 241
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -262,7 +262,7 @@ TextureImporter:
width: 22
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -281,9 +281,9 @@ TextureImporter:
x: 25
y: 217
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -302,9 +302,9 @@ TextureImporter:
x: 1
y: 193
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -323,9 +323,9 @@ TextureImporter:
x: 25
y: 193
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -346,7 +346,7 @@ TextureImporter:
width: 22
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -365,9 +365,9 @@ TextureImporter:
x: 25
y: 169
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -386,9 +386,9 @@ TextureImporter:
x: 1
y: 145
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -407,9 +407,9 @@ TextureImporter:
x: 25
y: 145
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -430,7 +430,7 @@ TextureImporter:
width: 22
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -449,9 +449,9 @@ TextureImporter:
x: 25
y: 121
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -470,9 +470,9 @@ TextureImporter:
x: 1
y: 97
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -491,9 +491,9 @@ TextureImporter:
x: 25
y: 97
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -514,7 +514,7 @@ TextureImporter:
width: 22
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -533,9 +533,9 @@ TextureImporter:
x: 25
y: 73
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -554,9 +554,9 @@ TextureImporter:
x: 1
y: 49
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -575,9 +575,9 @@ TextureImporter:
x: 25
y: 49
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -598,7 +598,7 @@ TextureImporter:
width: 22
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -617,9 +617,9 @@ TextureImporter:
x: 25
y: 25
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -638,9 +638,9 @@ TextureImporter:
x: 1
y: 1
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
@@ -659,9 +659,9 @@ TextureImporter:
x: 25
y: 1
width: 22
height: 21
height: 22
alignment: 0
pivot: {x: 0, y: 0}
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []

View File

@@ -30,7 +30,6 @@ AnimatorStateMachine:
m_ChildStateMachines: []
m_AnyStateTransitions:
- {fileID: 3708718943660755162}
- {fileID: -1637549219293370904}
- {fileID: -5898471161503941254}
m_EntryTransitions: []
m_StateMachineTransitions: {}
@@ -65,6 +64,31 @@ AnimatorStateTransition:
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &-5886567639466225223
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: IsHurt
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 3898215635428985453}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0
m_HasExitTime: 1
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &-4427708455344951909
AnimatorStateTransition:
m_ObjectHideFlags: 1
@@ -139,7 +163,7 @@ AnimatorState:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1101 &-2394224690546515301
--- !u!1101 &-2246283339113395046
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
@@ -150,6 +174,9 @@ AnimatorStateTransition:
- m_ConditionMode: 2
m_ConditionEvent: IsFighting
m_EventTreshold: 0
- m_ConditionMode: 2
m_ConditionEvent: IsHurt
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 0}
m_Solo: 0
@@ -158,8 +185,8 @@ AnimatorStateTransition:
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 0
m_ExitTime: 0
m_HasExitTime: 1
m_HasFixedDuration: 1
m_InterruptionSource: 0
m_OrderedInterruption: 1
@@ -203,31 +230,31 @@ AnimatorController:
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: IsGround
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: YVelocity
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: IsFighting
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: IsHurt
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
@@ -488,7 +515,8 @@ AnimatorState:
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: -2394224690546515301}
- {fileID: -5886567639466225223}
- {fileID: -2246283339113395046}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0

View File

@@ -6,6 +6,7 @@ TagManager:
tags:
- Pizza
- Coffee
- Kat Bug
layers:
- Default
- TransparentFX
@@ -49,3 +50,6 @@ TagManager:
- name: Stats
uniqueID: 4179335367
locked: 0
- name: Control Buttons
uniqueID: 2641203435
locked: 0