Package dwlab.shapes.sprites

Examples of dwlab.shapes.sprites.Sprite.moveForward()


    ang = 1500 * Math.sin( 7 * time );
    for( Shape shape : layer.children ) {
      Sprite sprite = shape.toSprite();
      oldSprite.directTo( sprite );
      oldSprite.angle += perSecond( ang ) + Service.random( -45, 45 );
      sprite.moveForward();
      oldSprite = sprite;
    }

    if( save.wasPressed() ) layer.saveToFile( "sprites.lw" );
    if( load.wasPressed() ) layer = (Layer) Obj.loadFromFile( "sprites.lw" );
View Full Code Here


 
  @Override
  public void logic() {
    for( Shape shape : layer.children ) {
      Sprite sprite = shape.toSprite();
      sprite.moveForward();
      sprite.bounceInside( rectangle );
    }
  }
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.