[Pogamut-list] Death Location - HeatMap
michal.bida
pogamut-forum at artemis.ms.mff.cuni.cz
Mon Apr 6 20:25:01 CEST 2009
Re: Death Location - HeatMap
Author: michal.bida
If you want to count the Frags of you agent here is code that should work:
//prepare listener class and variable we will store frags in
int frags = 0;
RcvMsgListener myListener = new RcvMsgListener() {
@Override
public void receiveMessage(RcvMsgEvent e) {
PlayerKilled pk;
pk = (PlayerKilled) e.getMessage();
if (pk.killerID == getMemory().getAgentID())
{
frags += 1;
}
}
};
//here we will register our listener for PLAYER KILLED messages
@Override
protected void postPrepareAgent(){
this.getBody().addTypedRcvMsgListener(myListener, MessageType.PLAYER_KILLED);
}
If you want to know when your bot die, use BOT_DIED listener.
best,
michal
More information about the Pogamut-list
mailing list