Crop Stomp: Implementation progress

This commit is contained in:
Jenny Crowe 2022-02-28 23:38:38 -07:00
parent 8a2147ba70
commit 25e90b0b39
11 changed files with 1524 additions and 3 deletions

View file

@ -1,5 +1,90 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &389467186872104531
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6205523899711794644}
m_Layer: 0
m_Name: VeggieHolder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6205523899711794644
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 389467186872104531}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 2.635, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 3229117913716202416}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &932095736067145199
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4394677245651984230}
- component: {fileID: 2637729749686440137}
m_Layer: 0
m_Name: Curve
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4394677245651984230
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 932095736067145199}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -0.752, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 7169260676522138663}
- {fileID: 1292394714416143255}
- {fileID: 5996674799664905378}
m_Father: {fileID: 7001187974207596949}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2637729749686440137
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 932095736067145199}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 066a41e004f415b4eb74d5e61a2aadbe, type: 3}
m_Name:
m_EditorClassIdentifier:
curveColor: {r: 0, g: 1, b: 0, a: 1}
startPointColor: {r: 1, g: 0, b: 0, a: 1}
endPointColor: {r: 0, g: 0, b: 1, a: 1}
sampling: 25
keyPoints:
- {fileID: 2327985857956665041}
- {fileID: 6549937257461551593}
- {fileID: 2626838558952412612}
normalizedTime: 0.5
--- !u!1 &972711761618501991
GameObject:
m_ObjectHideFlags: 0
@ -82,6 +167,205 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &2592768001999288343
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7001187974207596949}
- component: {fileID: 7679040244269732922}
m_Layer: 0
m_Name: Veggie
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &7001187974207596949
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2592768001999288343}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 4.5, y: 4.5, z: 1}
m_Children:
- {fileID: 4394677245651984230}
- {fileID: 5722828240178235474}
m_Father: {fileID: 7947161716638790645}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7679040244269732922
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2592768001999288343}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 21658c0e285c7f54e8c320332291b270, type: 3}
m_Name:
m_EditorClassIdentifier:
inList: 0
lastState: 0
state:
gameObject: {fileID: 0}
early: 0
perfect: 0
late: 0
createBeat: 0
eligibleHitsList: []
aceTimes: 0
isEligible: 0
triggersAutoplay: 1
isMole: 0
veggieSprites:
- {fileID: -4174758508601275437, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- {fileID: -2961287720435529803, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- {fileID: 5598513160068558425, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
moleSprites:
- {fileID: -7342873356196823606, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- {fileID: -4112523241890619114, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- {fileID: 3862573926363885855, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
veggieSprite: {fileID: 8249654647796258422}
veggieTrans: {fileID: 5722828240178235474}
curve: {fileID: 2637729749686440137}
targetBeat: 0
--- !u!1 &2911726556380549294
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1292394714416143255}
- component: {fileID: 6549937257461551593}
m_Layer: 0
m_Name: Point 1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1292394714416143255
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2911726556380549294}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 1.5040001, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4394677245651984230}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &6549937257461551593
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2911726556380549294}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3}
m_Name:
m_EditorClassIdentifier:
curve: {fileID: 2637729749686440137}
handleType: 0
leftHandleLocalPosition: {x: -0, y: 0, z: 0}
rightHandleLocalPosition: {x: 0, y: -0, z: -0}
--- !u!1 &3948884045839928685
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5722828240178235474}
- component: {fileID: 8249654647796258422}
m_Layer: 0
m_Name: Sprite
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5722828240178235474
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3948884045839928685}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -0.752, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 7001187974207596949}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &8249654647796258422
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3948884045839928685}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 2
m_Sprite: {fileID: -4174758508601275437, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &4040952777731144098
GameObject:
m_ObjectHideFlags: 0
@ -188,13 +472,46 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4359899702068686394}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -11.028004, y: -2.9631865, z: -44.50507}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2890674062888421961}
- {fileID: 7947161716638790645}
- {fileID: 6205523899711794644}
m_Father: {fileID: 5813499711186931250}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &4478042505738261112
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7947161716638790645}
m_Layer: 0
m_Name: Prefabs
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7947161716638790645
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4478042505738261112}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 7001187974207596949}
m_Father: {fileID: 3229117913716202416}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &5386007714129059416
GameObject:
m_ObjectHideFlags: 0
@ -407,11 +724,14 @@ MonoBehaviour:
m_EditorClassIdentifier:
EligibleHits: []
firstEnable: 0
baseVeggie: {fileID: 2592768001999288343}
legsAnim: {fileID: 5381231469059857945}
bodyAnim: {fileID: 5071188212098719590}
farmerTrans: {fileID: 2890674062888421961}
grass: {fileID: 6072388044625575886}
grassTrans: {fileID: 9053856824134827426}
scrollingHolder: {fileID: 3229117913716202416}
veggieHolder: {fileID: 6205523899711794644}
farmer: {fileID: 2943047049103139379}
--- !u!1 &5813499711658895222
GameObject:
@ -631,6 +951,100 @@ Animator:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!1 &6990946600413379120
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5996674799664905378}
- component: {fileID: 2626838558952412612}
m_Layer: 0
m_Name: Point 2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5996674799664905378
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6990946600413379120}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4394677245651984230}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2626838558952412612
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6990946600413379120}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3}
m_Name:
m_EditorClassIdentifier:
curve: {fileID: 2637729749686440137}
handleType: 0
leftHandleLocalPosition: {x: -0, y: 1, z: -0}
rightHandleLocalPosition: {x: 0, y: -1, z: 0}
--- !u!1 &7395503987791811721
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7169260676522138663}
- component: {fileID: 2327985857956665041}
m_Layer: 0
m_Name: Point 0
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7169260676522138663
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7395503987791811721}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 4394677245651984230}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2327985857956665041
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7395503987791811721}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3}
m_Name:
m_EditorClassIdentifier:
curve: {fileID: 2637729749686440137}
handleType: 0
leftHandleLocalPosition: {x: 0, y: -1, z: 0}
rightHandleLocalPosition: {x: -0, y: 1, z: -0}
--- !u!1 &7802009473335976183
GameObject:
m_ObjectHideFlags: 0
@ -759,7 +1173,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8284146705987220773}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 16.028004, y: 1.0631865, z: 44.50507}
m_LocalPosition: {x: 5, y: -1.9, z: 0}
m_LocalScale: {x: 4.5, y: 4.5, z: 1}
m_Children:
- {fileID: 4454582336686680825}

View file

@ -0,0 +1,108 @@
fileFormatVersion: 2
guid: 8b897ed14134c4f4288c32e76b834452
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,5 +1,31 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1102 &-8770870324587176312
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Pick
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: a0d50c9cdbf122544b88ec096aa43ebc, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &-6924980301800808911
AnimatorState:
serializedVersion: 6
@ -47,6 +73,9 @@ AnimatorStateMachine:
- serializedVersion: 1
m_State: {fileID: -1941055948172004836}
m_Position: {x: 345, y: 325, z: 0}
- serializedVersion: 1
m_State: {fileID: -8770870324587176312}
m_Position: {x: 380, y: 390, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []

View file

@ -0,0 +1,668 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Pick
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0.23, y: 0.385, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.033333335
value: {x: 0.26, y: 0.395, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.05
value: {x: 0.26, y: 0.395, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.06666667
value: {x: 0.285, y: 0.395, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: -0.375, y: 0.455, z: 0}
inSlope: {x: Infinity, y: 0, z: 0}
outSlope: {x: Infinity, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.033333335
value: {x: -0.28, y: 0.455, z: 0}
inSlope: {x: Infinity, y: 0, z: 0}
outSlope: {x: Infinity, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.05
value: {x: -0.215, y: 0.455, z: 0}
inSlope: {x: Infinity, y: 0, z: 0}
outSlope: {x: Infinity, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.06666667
value: {x: -0.22, y: 0.455, z: 0}
inSlope: {x: Infinity, y: 0, z: 0}
outSlope: {x: Infinity, y: 0, z: 0}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: Arms
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: {x: 0.06, y: 0.4, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.033333335
value: {x: 0.03, y: 0.39, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.05
value: {x: 0.12, y: 0.39, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.06666667
value: {x: 0.12, y: 0.39, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
path: Head
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: -5453690017794669403, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- time: 0.033333335
value: {fileID: -8251789786874819756, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- time: 0.05
value: {fileID: -720346898489606771, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- time: 0.06666667
value: {fileID: -5171928548217571342, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
- curve:
- time: 0
value: {fileID: -351461684392304642, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- time: 0.033333335
value: {fileID: -5671720971450025282, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- time: 0.05
value: {fileID: -6202399008548120228, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- time: 0.06666667
value: {fileID: -6202399008548120228, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
attribute: m_Sprite
path: Arms
classID: 212
script: {fileID: 0}
- curve:
- time: 0
value: {fileID: -13237673149276976, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- time: 0.05
value: {fileID: 5889376184759980671, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- time: 0.06666667
value: {fileID: 5889376184759980671, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
attribute: m_Sprite
path: Head
classID: 212
script: {fileID: 0}
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 1
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 1288071446
attribute: 1
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 130111906
attribute: 1
script: {fileID: 0}
typeID: 4
customType: 0
isPPtrCurve: 0
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
- serializedVersion: 2
path: 1288071446
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
- serializedVersion: 2
path: 130111906
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: -5453690017794669403, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- {fileID: -8251789786874819756, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- {fileID: -720346898489606771, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- {fileID: -5171928548217571342, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- {fileID: -351461684392304642, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- {fileID: -5671720971450025282, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- {fileID: -6202399008548120228, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- {fileID: -6202399008548120228, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- {fileID: -13237673149276976, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- {fileID: 5889376184759980671, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
- {fileID: 5889376184759980671, guid: 2deb728f30830dd438f91e9a4dff8cd4, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.083333336
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves:
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0.23
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.033333335
value: 0.26
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0.26
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: 0.285
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.x
path:
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0.385
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.033333335
value: 0.395
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0.395
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: 0.395
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path:
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.033333335
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.z
path:
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: -0.375
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.033333335
value: -0.28
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: -0.215
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: -0.22
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.x
path: Arms
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0.455
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.033333335
value: 0.455
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0.455
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: 0.455
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path: Arms
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.033333335
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: 0
inSlope: 0
outSlope: 0
tangentMode: 136
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.z
path: Arms
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0.06
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.033333335
value: 0.03
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0.12
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: 0.12
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.x
path: Head
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0.4
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.033333335
value: 0.39
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.05
value: 0.39
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: 0.39
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.y
path: Head
classID: 4
script: {fileID: 0}
- curve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 0.06666667
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
attribute: m_LocalPosition.z
path: Head
classID: 4
script: {fileID: 0}
m_EulerEditorCurves: []
m_HasGenericRootTransform: 1
m_HasMotionFloatCurves: 0
m_Events: []

View file

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

View file

@ -214,11 +214,21 @@ namespace RhythmHeavenMania
return a;
}
public float GetBeatFromPosition(float position, float startBeat, float length)
{
return Mathp.DeNormalize(position, startBeat, startBeat + length);
}
public float GetPositionFromMargin(float targetBeat, float margin)
{
return GetPositionFromBeat(targetBeat - margin, margin);
}
public float GetBeatFromPositionAndMargin(float position, float targetBeat, float margin)
{
return GetBeatFromPosition(position, targetBeat - margin, margin);
}
public float GetSongPosFromBeat(float beat)
{
return secPerBeat * beat;

View file

@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using DG.Tweening;
using RhythmHeavenMania.Util;
@ -23,11 +24,16 @@ namespace RhythmHeavenMania.Games.CropStomp
public bool isMarching => marchStartBeat != -1f && Conductor.instance.isPlaying;
[NonSerialized] public bool isFlicking;
public GameObject baseVeggie;
public Animator legsAnim;
public Animator bodyAnim;
public Transform farmerTrans;
public SpriteRenderer grass;
public Transform grassTrans;
public Transform scrollingHolder;
public Transform veggieHolder;
public Farmer farmer;
private Tween shakeTween;
@ -47,6 +53,48 @@ namespace RhythmHeavenMania.Games.CropStomp
var borderRight = grassSprite.rect.xMax - grassSprite.border.z;
var borderWidthPixels = borderRight - borderLeft;
grassWidth = borderWidthPixels / grassSprite.pixelsPerUnit;
// Initialize vegetables.
var cond = Conductor.instance;
var entities = GameManager.instance.Beatmap.entities;
// Find the beat of the closest "start marching" event.
// If not found, default to current beat.
float startBeat = cond.songPositionInBeats;
var marchStarts = entities.FindAll(m => m.datamodel == "cropStomp/start marching");
for (int i = 0; i < marchStarts.Count; i++)
{
var sampleBeat = marchStarts[i].beat;
if (cond.songPositionInBeats < sampleBeat)
{
startBeat = sampleBeat;
}
}
// Spawn veggies.
var vegEvents = entities.FindAll(v => v.datamodel == "cropStomp/veggies");
for (int i = 0; i < vegEvents.Count; i++)
{
var vegBeat = vegEvents[i].beat;
var vegLength = vegEvents[i].length;
// Only consider veggie events that aren't past the start point.
if (startBeat < vegBeat + vegLength)
{
int veggiesInEvent = Mathf.CeilToInt(vegLength + 1) / 2;
for (int b = 0; b < veggiesInEvent; b++)
{
var targetVeggieBeat = vegBeat + 2f * b;
if (startBeat < targetVeggieBeat)
{
SpawnVeggie(targetVeggieBeat, startBeat);
}
}
}
}
}
private void Update()
@ -103,6 +151,21 @@ namespace RhythmHeavenMania.Games.CropStomp
grassTrans.localPosition = new Vector3(newGrassX, grassPos.y, grassPos.z);
}
private void LateUpdate()
{
if (!isMarching)
return;
if (PlayerInput.PressedUp())
{
// Don't play raise animation if successfully flicked.
if (!isFlicking)
bodyAnim.Play("Raise");
}
isFlicking = false;
}
public void StartMarching(float beat)
{
marchStartBeat = beat;
@ -134,5 +197,17 @@ namespace RhythmHeavenMania.Games.CropStomp
isStepping = true;
}
private void SpawnVeggie(float beat, float startBeat)
{
var newVeggie = GameObject.Instantiate(baseVeggie, veggieHolder).GetComponent<Veggie>();
newVeggie.targetBeat = beat;
var veggieX = (beat - startBeat) * -stepDistance / 2f;
newVeggie.transform.localPosition = new Vector3(veggieX, 0f, 0f);
newVeggie.gameObject.SetActive(true);
}
}
}

View file

@ -38,14 +38,20 @@ namespace RhythmHeavenMania.Games.CropStomp
if (state.perfect)
{
game.Stomp();
game.bodyAnim.Play("Stomp", 0, 0);
nextStompBeat += 2f;
ResetState();
}
else if (state.notPerfect())
{
game.bodyAnim.Play("Crouch", 0, 0);
nextStompBeat += 2f;
ResetState();
}
else
{
game.bodyAnim.Play("Crouch", 0, 0);
}
}
}
}

View file

@ -0,0 +1,191 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using NaughtyBezierCurves;
using RhythmHeavenMania.Util;
namespace RhythmHeavenMania.Games.CropStomp
{
public class Veggie : PlayerActionObject
{
public bool isMole;
public Sprite[] veggieSprites;
public Sprite[] moleSprites;
public SpriteRenderer veggieSprite;
public Transform veggieTrans;
public BezierCurve3D curve;
public float targetBeat;
private float stompedBeat;
private int veggieState = 0;
private bool boinked; // Player got barely when trying to pick.
private float landBeat;
private CropStomp game;
private void Start()
{
game = CropStomp.instance;
if (!isMole)
{
veggieSprite.sprite = veggieSprites[UnityEngine.Random.Range(0, veggieSprites.Length)];
}
}
private bool gotStomped; // Safeguard in case nested Update() call breaks.
private void Update()
{
if (!game.isMarching)
return;
// Veggie missed. Handle missed state.
if (veggieState == -1)
{
MissedUpdate();
return;
}
// Veggie picked. Handle picked state.
if (veggieState == 2)
{
PickedUpdate();
return;
}
var cond = Conductor.instance;
float normalizedBeat = cond.GetPositionFromMargin(targetBeat, 1f);
StateCheck(normalizedBeat);
// In ground.
if (veggieState == 0)
{
if (normalizedBeat > Minigame.LateTime())
{
veggieState = -1;
return;
}
if (PlayerInput.Pressed())
{
if (state.perfect)
{
StompVeggie(false);
}
else if (state.notPerfect())
{
veggieState = -1;
}
}
}
// In air.
else if (veggieState == 1)
{
float airPosition = cond.GetPositionFromBeat(stompedBeat, landBeat - stompedBeat);
veggieTrans.position = curve.GetPoint(Mathf.Clamp(airPosition, 0, 1));
if (normalizedBeat > Minigame.EndTime())
{
veggieState = -1;
// Stuff that happens upon veggie landing goes here.
return;
}
if (PlayerInput.PressedUp())
{
if (state.perfect)
{
PickVeggie(false);
}
else if (state.notPerfect())
{
veggieState = -1;
boinked = true;
// Stuff that happens upon boink goes here.
MissedUpdate();
}
game.bodyAnim.Play("Pick", 0, 0);
game.isFlicking = true;
}
}
}
private void MissedUpdate()
{
if (boinked)
{
}
else
{
}
}
private void PickedUpdate()
{
}
private void StompVeggie(bool autoTriggered)
{
// Juuuuuust in case.
if (gotStomped)
{
Debug.Log("Recursion moment?");
return;
}
gotStomped = true;
var cond = Conductor.instance;
veggieState = 1;
targetBeat = targetBeat + (isMole ? 0.5f : 1f);
stompedBeat = cond.songPositionInBeats;
landBeat = cond.GetBeatFromPositionAndMargin(Minigame.EndTime(), targetBeat, 1f);
if (autoTriggered)
{
game.Stomp();
game.bodyAnim.Play("Stomp", 0, 0);
}
ResetState();
Update(); // Update flying veggie state immediately.
}
private void PickVeggie(bool autoTriggered)
{
veggieState = 2;
if (autoTriggered)
{
game.bodyAnim.Play("Pick", 0, 0);
game.isFlicking = true;
}
// Stuff that happens upon veggie picking goes here.
PickedUpdate();
}
public override void OnAce()
{
if (veggieState == 0)
StompVeggie(true);
else
PickVeggie(true);
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 21658c0e285c7f54e8c320332291b270
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -356,7 +356,8 @@ namespace RhythmHeavenMania
}),
new Minigame("cropStomp", "Crop Stomp \n<color=#eb5454>[WIP don't use]</color>", "BFDEA6", false, false, new List<GameAction>()
{
new GameAction("start marching", delegate { CropStomp.instance.StartMarching(eventCaller.currentEntity.beat); }, 0.5f, false),
new GameAction("start marching", delegate { CropStomp.instance.StartMarching(eventCaller.currentEntity.beat); }, 2f, false),
new GameAction("veggies", delegate { }, 4f, true),
}),
/*new Minigame("spaceDance", "Space Dance", "B888F8", new List<GameAction>()
{