Class Ball

java.lang.Object
   |
   +----java.awt.Rectangle
           |
           +----Ball

class Ball
extends Rectangle
Sorry, not documented yet.

Source


Variable Index

 o angle
0=Right, PI/2=Up
 o bojng
 o bounceBottom
Bounce from bottom
 o curTime
Time since xstart/ystart
 o speed
Pixel/Tick
 o speedUpCntr
 o speedUpTime
Speed up every ...
 o sprad
Radius of sphere (Pixel)
 o xcur
Current position (Pixel, Center)
 o xspeed
Current speeds (Pixel/Tick)
 o xstart
Start position of current movement
 o ycur
Current position (Pixel, Center)
 o yspeed
Current speeds (Pixel/Tick)
 o ystart
Start position of current movement

Constructor Index

 o Ball(Ball, double)
 o Ball(BojngInterface, int, int)

Method Index

 o bounce(boolean, boolean)
 o bounceBlocks()
Zusammenstoesse erfassen
 o bounceRect(Rectangle, Rectangle, boolean)
 o bounceWalls()
 o calcCurXY()
 o calcSpeed()
xspeed, yspeed aus speed und angle berechnen
 o checkHitInBlock(Rectangle, int, int)
 o correctAngle()
sehr flache Winkel vermeiden
 o draw()
Draws the ball on backimg
 o move()
Moves the ball coordinates, no drawing
 o moveTo(int, int)
 o moveTo(int, int, double)
 o remove()
Removes the ball from backimg
 o tick()

Variables

 o sprad
 int sprad
Radius of sphere (Pixel)

 o speed
 double speed
Pixel/Tick

 o angle
 double angle
0=Right, PI/2=Up

 o xstart
 double xstart
Start position of current movement

 o ystart
 double ystart
Start position of current movement

 o xspeed
 double xspeed
Current speeds (Pixel/Tick)

 o yspeed
 double yspeed
Current speeds (Pixel/Tick)

 o curTime
 double curTime
Time since xstart/ystart

 o xcur
 double xcur
Current position (Pixel, Center)

 o ycur
 double ycur
Current position (Pixel, Center)

 o bounceBottom
 boolean bounceBottom
Bounce from bottom

 o speedUpCntr
 int speedUpCntr
 o speedUpTime
 int speedUpTime
Speed up every ... ms

 o bojng
 BojngInterface bojng

Constructors

 o Ball
 Ball(BojngInterface bojng,
      int x,
      int y)
 o Ball
 Ball(Ball ball,
      double angleDisp)

Methods

 o moveTo
 void moveTo(int x,
             int y)
 o moveTo
 void moveTo(int x,
             int y,
             double a)
 o tick
 boolean tick()
 o calcSpeed
 void calcSpeed()
xspeed, yspeed aus speed und angle berechnen

 o draw
 void draw()
Draws the ball on backimg

 o remove
 void remove()
Removes the ball from backimg

 o move
 boolean move()
Moves the ball coordinates, no drawing

 o calcCurXY
 void calcCurXY()
 o bounceWalls
 boolean bounceWalls()
 o bounce
 void bounce(boolean bounceX,
             boolean bounceY)
 o correctAngle
 void correctAngle()
sehr flache Winkel vermeiden

 o bounceBlocks
 void bounceBlocks()
Zusammenstoesse erfassen

 o bounceRect
 void bounceRect(Rectangle ball,
                 Rectangle rect,
                 boolean jitter)
 o checkHitInBlock
 Rectangle checkHitInBlock(Rectangle r1,
                           int bx,
                           int by)