MEHR FPSSSS yay
This commit is contained in:
Binary file not shown.
@@ -13,7 +13,7 @@ public class Main extends Game {
|
||||
private HUD hud;
|
||||
|
||||
public Main() {
|
||||
super(World.SCALE * 15, World.SCALE * 11);
|
||||
super(World.SCALE * 15, World.SCALE * 11, 16);
|
||||
instance = this;
|
||||
|
||||
// Welt initialisieren und Spieler hinzufügen
|
||||
|
||||
@@ -9,7 +9,7 @@ import main.maps.TutorialMap;
|
||||
*/
|
||||
public class World extends Knoten {
|
||||
|
||||
public static final int SCALE_FACTOR = 4; // Der Basis Zoomfaktor
|
||||
public static final int SCALE_FACTOR = 6; // Der Basis Zoomfaktor
|
||||
public static final int SCALE = SCALE_FACTOR * Tile.getSize(); // Eine Gameunit ist so viele pixel lang
|
||||
|
||||
private Map currentMap; // Die Map die aktuell angezeigt werden soll.
|
||||
|
||||
@@ -116,7 +116,11 @@ public abstract class Entity implements Ticker {
|
||||
* Generiert einen vektor von diesm Entity zu einem anderen
|
||||
*/
|
||||
public Vektor vectorToEntity(Entity e) {
|
||||
return new Vektor(e.posX - posX, e.posY - posY);
|
||||
Vektor v = new Vektor(e.posX - posX, e.posY - posY);;
|
||||
if (v.x == 0 && v.y == 0) {
|
||||
return new Vektor(0.0000001f, 0.0000001f);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
protected boolean lineOfSightClear(Entity e) {
|
||||
|
||||
@@ -28,7 +28,7 @@ public class Snake extends LivingEntity {
|
||||
actionFigur.neuerZustand(loader.getFigur(5), getDamageAnimationName());
|
||||
|
||||
loader.getFigur(3).animationsGeschwindigkeitSetzen(80);
|
||||
loader.getFigur(5).animationsGeschwindigkeitSetzen(40);
|
||||
loader.getFigur(5).animationsGeschwindigkeitSetzen(60);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -104,8 +104,8 @@ public class Player extends LivingEntity {
|
||||
Vektor toE = vectorToEntity(le);
|
||||
toE = toE.normiert();
|
||||
if ((toE.x > 0 && !side) || (toE.x <= 0 && side)) {
|
||||
le.setVelX(le.getVelX() + toE.x * 0.05f);
|
||||
le.setVelY(le.getVelY() + toE.y * 0.05f);
|
||||
le.setVelX(le.getVelX() + toE.x * 0.1f);
|
||||
le.setVelY(le.getVelY() + toE.y * 0.1f);
|
||||
le.takeDamage(0.1f, this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user