
|
Kegeln auf Java |
|
Dokumentation und Code |
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectbowling_all.Kegel
public final class Kegel
Class Kegel forms a bowling-pin
| Method Summary | |
|---|---|
double |
angelToBall(double kugelspeedX,
double kugelspeedY,
double kugelaccellerationX,
int time)
calculates the actual angle of the ball to the coordinate system |
void |
doPaint(java.awt.Graphics g,
java.awt.Image i4,
java.awt.Image i3,
java.awt.Image i2,
java.awt.Image i1,
java.awt.Image i0)
paints a graphic of the pin |
boolean |
getCollision()
checks if the pin is already fallen |
double |
getEposX()
gets the actual x-coordinate of the top of the pin |
double |
getEposY()
gets the actual y-coordinate of the top of the pin |
int |
getPostionX()
gets the actual x-coordinate of the bottom of the pin |
int |
getPostionY()
gets the actual y-coordinate of the bottom of the pin |
void |
if_collisionBall(Kugel k,
int time)
checks if the ball k collides at time time with the pin |
void |
if_collisionPin(Kegel p,
int time)
checks if the pin collides with another pin p at time time |
void |
kollision_mit_Kugel(double kugelspeedX,
double kugelspeedY,
double kugelaccellerationX,
int time,
double angleToGo)
sets the time of collison and the speed and the angle of the pin |
void |
reset()
resets the pin to his start-values |
void |
reset2()
sets the pin as hit and to a position outside the shown area, so he will not appear on the screen |
void |
set_posX(int time)
sets the x coordinate of a pin at a certain time |
void |
set_posY(int time)
sets the y coordinate of a pin at a certain time |
double |
x_transformToNew(double x,
double y,
double nX0,
double nY0,
double angle)
does a coordinate transformation (X) |
double |
y_transformToNew(double x,
double y,
double nX0,
double nY0,
double angle)
does a coordinate transformation (Y) |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public int getPostionY()
public int getPostionX()
public double getEposX()
public double getEposY()
public boolean getCollision()
public void set_posX(int time)
time - actual time (0 is the start of the animation)public void set_posY(int time)
time - actual time (0 is the start of the animation)
public void kollision_mit_Kugel(double kugelspeedX,
double kugelspeedY,
double kugelaccellerationX,
int time,
double angleToGo)
kugelspeedX - speed of the ball who hits the pin on x-axiskugelspeedY - speed of the ball who hits the pin on y-axiskugelaccellerationX - accelleration of the ball on x-axistime - the actual time (is the time of the collision)angleToGo - the direction the pin will moves inpublic void if_collisionBall(Kugel k, int time)
k - balltime - timepublic void if_collisionPin(Kegel p, int time)
p - pintime - time
public double angelToBall(double kugelspeedX,
double kugelspeedY,
double kugelaccellerationX,
int time)
kugelspeedX - speed of the ball in x-axiskugelspeedY - speed of the ball in y-axiskugelaccellerationX - accelleration of the ball in x-axistime - time
public double x_transformToNew(double x,
double y,
double nX0,
double nY0,
double angle)
x - x coordinate in the old systemy - y coordinate in the old systemnX0 - the x coordinate in the old system of the 0-point of the new systemnY0 - the y coordinate in the old system of the 0-point of the new systemangle - the angle between the old axis and the new ones
public double y_transformToNew(double x,
double y,
double nX0,
double nY0,
double angle)
x - x coordinate in the old systemy - y coordinate in the old systemnX0 - the x coordinate in the old system of the 0-point of the new systemnY0 - the y coordinate in the old system of the 0-point of the new systemangle - the angle between the old axis and the new ones
public void reset()
public void reset2()
public void doPaint(java.awt.Graphics g,
java.awt.Image i4,
java.awt.Image i3,
java.awt.Image i2,
java.awt.Image i1,
java.awt.Image i0)
g - Graphics instance on witch it should be paintedi4 - image of certain position of the pini3 - image of certain position of the pini2 - image of certain position of the pini1 - image of certain position of the pini0 - image of certain position of the pin
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
|
Javadoc: |

