|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectapes.AbstractEnemyAI
apes.EnemyAIMediumBACKUP
public class EnemyAIMediumBACKUP
This *AI* is smarter than the Simple one. It adjusts the range in which random number are found according to the last impact and the position of the enemy. What it does not do: check for walls. so it can happen, that it gets stuck and does not stop throwing things against the wall, never trying a wider range again.
Field Summary | |
---|---|
org.newdawn.slick.geom.Shape |
hitArea
area that can be covert by min/max values. |
Fields inherited from class apes.AbstractEnemyAI |
---|
currentThinking, gc, map, MAXBETA, MAXTHINKINGTIME, MAXVELOCITY, MINBETA, MINTHINKINGTIME, MINVELOCITY |
Constructor Summary | |
---|---|
EnemyAIMediumBACKUP(BlockMap map)
constructs a new medium ai. |
Method Summary | |
---|---|
float |
calculateBeta()
returns a random beta value in between the current min/max values as defined by the call to reCalculateMinMaxBeta. |
float |
calculateVelocity()
returns a random velocity value in between the current min/max values as defined by the call to reCalcualteMinMaxVel. |
void |
calculateVelocityBeta()
calculates angles which will be returned by getBeta and getVelocity. |
protected void |
correctCalculations()
|
protected float |
diffTo45(float angle)
|
float |
getBeta()
returns an angle that should be used in a throw. |
float |
getVelocity()
returns a velocity that should be used in a throw. |
protected boolean |
isHitPossible(float minBeta,
float minVel,
float maxBeta,
float maxVel)
returns weather or not the enemy can be hit with some value between the given min/max values. |
protected void |
reCalcualteMinMaxVel()
see reCalculateMinMaxBeta but for the velocity (and also working...). |
protected void |
reCalculateMinMaxBeta()
checks if the place, where the banana landed last is bevor or behind the players ape and sets either the currentMinBeta or currentMaxBeta to the beta value of that previous throw. |
Methods inherited from class apes.AbstractEnemyAI |
---|
executeNextMove, randomBetween |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface apes.IEnemyAI |
---|
executeNextMove |
Field Detail |
---|
public org.newdawn.slick.geom.Shape hitArea
Constructor Detail |
---|
public EnemyAIMediumBACKUP(BlockMap map)
banana
- Method Detail |
---|
public void calculateVelocityBeta()
AbstractEnemyAI
calculateVelocityBeta
in class AbstractEnemyAI
public float getBeta()
AbstractEnemyAI
getBeta
in class AbstractEnemyAI
public float getVelocity()
AbstractEnemyAI
getVelocity
in class AbstractEnemyAI
public float calculateBeta()
public float calculateVelocity()
protected void reCalculateMinMaxBeta()
protected void reCalcualteMinMaxVel()
protected boolean isHitPossible(float minBeta, float minVel, float maxBeta, float maxVel)
minBeta
- minVel
- maxBeta
- maxVel
-
protected float diffTo45(float angle)
protected void correctCalculations()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |