apoIcejump.ai
Class ApoIcejumpAIEntity

java.lang.Object
  extended by apoIcejump.ai.ApoIcejumpAIEntity
Direct Known Subclasses:
ApoIcejumpAIBlock, ApoIcejumpAIEnemy, ApoIcejumpAIGoodies

public class ApoIcejumpAIEntity
extends java.lang.Object

repräsentiert eine Entity (also davon erben, Spieler, Gegner, Eisblöcke) im Spiel
class for all entities

Author:
Dirk Aporius

Constructor Summary
ApoIcejumpAIEntity(org.apogames.entity.ApoEntity entity)
           
 
Method Summary
 float getHeight()
          gibt die Höhe der Entity zurück
returns the height of the entity
 float getVecX()
          gibt die Geschwindigkeit in X-Richtung zurück
Um auszurechnen, wo eine Entity beim nächsten Aufruf ist
rechnet einfach getVecX() * ApoicejumpAIConstants.WAIT_TIME_THINK
Beispiel eine Geschwindigkeit von 0.16 bedeutet bei 10 Millisekunden bis zum nächsten Aufruf
das die Entity beim nächsten Aufruf 1.6 Pixel weiter rechts ist.
 float getVecY()
          gibt die Geschwindigkeit in Y-Richtung zurück (siehe getVecX() zum Verständnis)
returns the speed in y-direction of the entity per ms (see getVecX() to know how to calculate the next step)
 float getWidth()
          gibt die Breite der Entity zurück
returns the width of the entity
 float getX()
          gibt die X-Position der Entity zurück
0 = ganz links, ApoIcejumpAIConstants.GAME_WIDTH - getWidth() = ganz rechts
returns the x-Position of the entity
0 = left, ApoIcejumpAIConstants.GAME_WIDTH - getWidth() = right
 float getY()
          gibt die X-Position der Entity zurück
0 oben im Frame
returns the x-Position of the entity
0 above
 boolean intersects(ApoIcejumpAIEntity entity)
          gibt zurück, ob diese Entity sich mit der übergebenen Entity schneidet
returns whether the entity intersects another entity
 boolean intersects(float x, float y, float width, float height)
          gibt zurück, ob sich diese Entity mit dem übergebenen Rechteck schneidet
returns whether the entity intersects with a rectangle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApoIcejumpAIEntity

public ApoIcejumpAIEntity(org.apogames.entity.ApoEntity entity)
Method Detail

getX

public float getX()
gibt die X-Position der Entity zurück
0 = ganz links, ApoIcejumpAIConstants.GAME_WIDTH - getWidth() = ganz rechts
returns the x-Position of the entity
0 = left, ApoIcejumpAIConstants.GAME_WIDTH - getWidth() = right

Returns:
gibt die X-Position der Entity zurück / returns the x-Position of the entity

getY

public float getY()
gibt die X-Position der Entity zurück
0 oben im Frame
returns the x-Position of the entity
0 above

Returns:
gibt die X-Position der Entity zurück / returns the x-Position of the entity

getWidth

public float getWidth()
gibt die Breite der Entity zurück
returns the width of the entity

Returns:
gibt die Breite der Entity zurück / returns the width of the entity

getHeight

public float getHeight()
gibt die Höhe der Entity zurück
returns the height of the entity

Returns:
gibt die Höhe der Entity zurück / returns the height of the entity

getVecX

public float getVecX()
gibt die Geschwindigkeit in X-Richtung zurück
Um auszurechnen, wo eine Entity beim nächsten Aufruf ist
rechnet einfach getVecX() * ApoicejumpAIConstants.WAIT_TIME_THINK
Beispiel eine Geschwindigkeit von 0.16 bedeutet bei 10 Millisekunden bis zum nächsten Aufruf
das die Entity beim nächsten Aufruf 1.6 Pixel weiter rechts ist.
eturns the speed in x-direction of the entity per ms
To know where the entity in the next call is
calculate getVecX() * ApoicejumpAIConstants.WAIT_TIME_THINK
Excample a speed of 0.16 means that in 10 ms to the next call
the entity is 1.6 pixel further to the right.

Returns:
gibt die Geschwindigkeit in X-Richtung zurück / returns the speed in x-direction of the entity per ms

getVecY

public float getVecY()
gibt die Geschwindigkeit in Y-Richtung zurück (siehe getVecX() zum Verständnis)
returns the speed in y-direction of the entity per ms (see getVecX() to know how to calculate the next step)

Returns:
gibt die Geschwindigkeit in Y-Richtung zurück / returns the speed in y-direction of the entity per ms

intersects

public boolean intersects(ApoIcejumpAIEntity entity)
gibt zurück, ob diese Entity sich mit der übergebenen Entity schneidet
returns whether the entity intersects another entity

Parameters:
entity - : zu überprüfende Entity / other entity
Returns:
TRUE, beide Entities schneiden sich, sonst FALSE / TRUE, entity intersects other entity, else FALSE

intersects

public boolean intersects(float x,
                          float y,
                          float width,
                          float height)
gibt zurück, ob sich diese Entity mit dem übergebenen Rechteck schneidet
returns whether the entity intersects with a rectangle

Parameters:
x - : X-Wert des Rechtecks (oben links) / x value from the rec (left above)
y - : Y-Wert des Rechtecks (oben links) / y value from the rec (left above)
width - : Breite des Rechtecks / width of the rec
height - : Höhe des Rechtecks / height of the rec
Returns:
TRUE, Entity schneidet Rechteck, sonst FALSE / TRUE, entity intersects the rec, else FALSE