MZMove AddCommonMove(MZMode mode, string name) { MZMove_LinearBy linearTo = mode.AddMove<MZMove_LinearBy>( name ); linearTo.velocity = 100; linearTo.direction = 270; return linearTo; }
void AddMove_Rotation(MZMode mode) { MZMove_Rotation move = mode.AddMove<MZMove_Rotation>( "move" ); move.angularVelocity = -100; move.variationOfRadians = -10; move.radiansLimited = 100; move.targetHelp.assignPosition = new Vector2( 0, 0 ); }
void AddSplitMoveToSubEmemy(MZMode mode) { MZMove_LinearTo splitMove = mode.AddMove<MZMove_LinearTo>( "s" ); float moveDegrees = ( 360/8 )*currentEnemyCreatedCount; float movement = 200; splitMove.useRelativePosition = true; splitMove.destinationPosition = MZMath.UnitVectorFromDegrees( moveDegrees )*movement; splitMove.totalTime = _splitTime - 0.1f; splitMove.duration = _splitTime; }
void SetType3Move(MZMode mode, MZEnemy enemy) { MZMove_Rotation rotShow = mode.AddMove<MZMove_Rotation>( "r" ); rotShow.angularVelocity = 50*_angularVelocityDirection; rotShow.variationOfRadians = -300; rotShow.radiansLimited = 400; rotShow.targetHelp.assignPosition = Vector2.zero; rotShow.duration = 1.5f; MZMove_Idle moveIdle = mode.AddMove<MZMove_Idle>( "i" ); moveIdle.duration = 5; MZMove_LinearTo moveOut = mode.AddMove<MZMove_LinearTo>( "l" ); moveOut.destinationPosition = Vector2.zero; moveOut.totalTime = 0.5f; moveOut.notEndAtDestation = true; }
void SetType2Move(MZMode mode, MZEnemy enemy) { MZMove_Rotation rotShow = mode.AddMove<MZMove_Rotation>( "r" ); rotShow.angularVelocity = 50*_angularVelocityDirection; rotShow.variationOfRadians = -100; rotShow.targetHelp.assignPosition = Vector2.zero; rotShow.duration = 20; }
void SetType1Move(MZMode mode, MZEnemy enemy) { MZMove_LinearBy show = mode.AddMove<MZMove_LinearBy>( "l" ); show.direction = MZMath.DegreesFromXAxisToVector( MZMath.UnitVectorFromP1ToP2( enemy.position, Vector2.zero ) ); show.duration = 0.6f; show.velocity = 500; MZMove_Rotation rotShow = mode.AddMove< MZMove_Rotation>( "r1" ); rotShow.angularVelocity = 50*_angularVelocityDirection; rotShow.variationOfRadians = -300; rotShow.radiansLimited = 400; rotShow.targetHelp.assignPosition = Vector2.zero; rotShow.duration = 10.0f; MZMove_Rotation rotOut = mode.AddMove< MZMove_Rotation>( "r2" ); rotOut.angularVelocity = 50*_angularVelocityDirection; rotOut.variationOfRadians = 300; rotOut.targetHelp.assignPosition = Vector2.zero; rotOut.duration = 10; }
void SetMove(MZMode mode) { MZMove_LinearTo to = mode.AddMove<MZMove_LinearTo>( "move" ); to.destinationPosition = new Vector2( 0, MZGameSetting.ENEMY_BOUNDLE_TOP/3*2 + 40 ); to.totalTime = 4.0f; to.isRunOnce = true; to.duration = 12; MZMove_LinearTo left = mode.AddMove<MZMove_LinearTo>( "left" ); left.destinationPosition = new Vector2( 0, MZGameSetting.ENEMY_BOUNDLE_TOP + 300 ); left.totalTime = 10.0f; }
void AddMove_ToTarget(MZMode mode) { MZMove_ToTarget move = mode.AddMove<MZMove_ToTarget>( "move" ); move.velocity = 300; }
// void AddMove_Linear(MZMode mode) { MZMove_LinearBy move = mode.AddMove< MZMove_LinearBy>( "move" ); move.direction = ( position.x > 0 )? 225 : ( position.x < 0 )? 315 : 270; move.velocity = 100; }