1.7.4 : Mario has 50% chance to kick another if he jump or run

This commit is contained in:
Kleme
2017-09-14 18:55:00 +02:00
parent 4a23892f6f
commit 0ec98f66a2
2 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ import fr.klemek.minimario.LocalServer.ConnectionListener;
public abstract class Launch {
private static final String VERSION = "1.7.3";
private static final String VERSION = "1.7.4";
private static TrayIcon trayIcon;
private static PopupMenu popup;
+6 -3
View File
@@ -228,12 +228,15 @@ public class MarioAI {
}
}
if(this.spdy<=0){
if(this.spdy<=0 && (this.state == State.JUMPING || this.state == State.RUNNING)){
Rectangle bounds = this.getBounds();
for(MarioAI ma:getOthers(this.id)){
if(ma.spdy<=0 && !ma.isInvicible() && bounds.intersects(ma.getBounds())){
ma.fall();
ma.setKicked(true);
int randi = Utils.nextInt(100);
if(randi<50){
ma.fall();
ma.setKicked(true);
}
}
}
}