Can we get the source for that? Also, Hypercam is free now! 8) No need for the labels.
113 bots were submitted and the first results you can see here.
Source-Code:
The problem is: the real player variable is a private variable in the player ai class. And u can get the varibale with
private static Field getField(Class<?> cls, String name) throws NoSuchFieldException, SecurityException {
Field field = null;
while(cls != null) {
try {
field = cls.getDeclaredField(name);
break;
} catch(NoSuchFieldException e) {}
cls = cls.getSuperclass();
}
if(field == null)
throw new NoSuchFieldException();
return field;
}
private static <T extends ApoMarioEntity> T getBaseEntity(ApoMarioAIEntity entity, Class<T> cls) throws IllegalArgumentException, IllegalAccessException {
return cls.cast(entityField.get(entity));
}
static {
try {
entityField = getField(ApoMarioAIEntity.class, "entity");
entityField.setAccessible(true);
} catch(NoSuchFieldException e) {
e.printStackTrace();
}
}
public void think(final ApoMarioAIPlayer player, final ApoMarioAILevel level) {
try {
ApoMarioPlayer hacker = getBaseEntity(player, ApoMarioPlayer.class);
//... now u can do everything u want. ;)
} catch(Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
and thanks for the hypercam tip. Next video will be without the labels. =)
Now I finished the contest and will publish the results on monday the 27.06.2011.
I remove some bugs and I also publish a new little video with some test levels I made with the editor. The player is again the AI-bot Icarus.