Package dwlab.behavior_models

Examples of dwlab.behavior_models.FixedWaitingModel


    onLandCondition.trueModels.addLast( new ModelActivator( jumpingAnimation ) );
    onLandCondition.trueModels.addLast( new ModelDeactivator( gravity ) );
    onLandCondition.falseModels.addLast( jumpKeyDown );

    FixedWaitingModel pauseBeforeJump = FixedWaitingModel.create( jumpingPause );
    pauseBeforeJump.nextModels.addLast( new Jump( jumpingStrength, jumpingStrength ) );
    pauseBeforeJump.nextModels.addLast( new ModelActivator( gravity ) );
    pauseBeforeJump.nextModels.addLast( jumpKeyDown );
    onLandCondition.trueModels.addLast( pauseBeforeJump );
View Full Code Here


      animationActive.falseModels.addLast( new ModelDeactivator( gravity ) );

      jumpingAnimation.nextModels.addLast( new ModelActivator( fallingAnimation ) );

      parameters= getDoubleParameters( "jumping_strength", "-" );
      FixedWaitingModel pauseBeforeJump = FixedWaitingModel.create( jumpingPause );
      pauseBeforeJump.nextModels.addLast( new Jumpparameters[ 0 ], parameters[ 1 ] ) );
      pauseBeforeJump.nextModels.addLast( new ModelActivator( horizontalMovementModel() ) );
      pauseBeforeJump.nextModels.addLast( new ModelActivator( gravity ) );
      pauseBeforeJump.nextModels.addLast( waitingForJump );
      animationActive.falseModels.addLast( pauseBeforeJump );

      addToStack( jumpingAnimation );
      score += 200;
    }


    addToStack( fallingAnimation );


    if( parameterExists( "firing" ) ) {
      double[] parameters = getDoubleParameters( "firing", "-" );
      RandomWaitingModel waitingForFire = new RandomWaitingModel( parameters[ 0 ], parameters[ 1 ] );
      attachModel( waitingForFire );

      IsModelActive onLandCondition = new IsModelActive( onLand );
      waitingForFire.nextModels.addLast( onLandCondition );

      IsModelActive animationActive = new IsModelActive( jumpingAnimation );
      onLandCondition.trueModels.addLast( animationActive );
      onLandCondition.falseModels.addLast( waitingForFire );

      animationActive.trueModels.addLast( waitingForFire );
      animationActive.falseModels.addLast( new ModelActivator( firingAnimation ) );
      animationActive.falseModels.addLast( new ModelDeactivator( horizontalMovementModel() ) );

      firingAnimation.nextModels.addLast( new ModelActivator( horizontalMovementModel() ) );

      parameters = getDoubleParameters( "firing_speed", "-" );
      FixedWaitingModel pauseBeforeBullet = FixedWaitingModel.create( bulletPause );
      pauseBeforeBullet.nextModels.addLast( new CreateBullet( parameters[ 0 ], parameters[ 1 ] ) );
      pauseBeforeBullet.nextModels.addLast( waitingForFire );
      animationActive.falseModels.addLast( pauseBeforeBullet );

      addToStack( firingAnimation, false );
View Full Code Here

TOP

Related Classes of dwlab.behavior_models.FixedWaitingModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.