Rename Welt to World

All this german code confuses me that much, that I do it myself…
This commit is contained in:
David96 2020-12-31 13:58:53 +01:00
parent e2d5e74b7e
commit 20c3ea7155
2 changed files with 8 additions and 8 deletions

View File

@ -5,7 +5,7 @@ class GameScreen
{ {
private final List<Drawable> _drawables; private final List<Drawable> _drawables;
private final Bird _bird; private final Bird _bird;
private final Welt _welt; private final World _world;
private double _totalTime; private double _totalTime;
private int _try; private int _try;
@ -13,7 +13,7 @@ class GameScreen
{ {
_drawables = new ArrayList<Drawable>(); _drawables = new ArrayList<Drawable>();
_bird = new Bird(this); _bird = new Bird(this);
_welt = new Welt(this); _world = new World(this);
_totalTime = 0; _totalTime = 0;
_try = 1; _try = 1;
} }
@ -24,13 +24,13 @@ class GameScreen
public void update(double elapsed) public void update(double elapsed)
{ {
_bird.update(elapsed); _bird.update(elapsed);
_welt.update(elapsed); _world.update(elapsed);
_totalTime += elapsed; _totalTime += elapsed;
System.out.print("\r" + _try + " - Time survived: " + (int)(_totalTime * 1e-3) + "s, " + System.out.print("\r" + _try + " - Time survived: " + (int)(_totalTime * 1e-3) + "s, " +
"speed: " + (int)_welt.getSpeed() + "px/s"); "speed: " + (int)_world.getSpeed() + "px/s");
Rectangle birdRect = _bird.getRect(); Rectangle birdRect = _bird.getRect();
if (_welt.checkCollision(_bird.getRect()) if (_world.checkCollision(_bird.getRect())
|| birdRect.getY() + birdRect.getHeight() > TurtleWelt.HEIGHT || birdRect.getY() + birdRect.getHeight() > TurtleWelt.HEIGHT
|| birdRect.getY() + birdRect.getHeight() < 0) || birdRect.getY() + birdRect.getHeight() < 0)
{ {
@ -38,7 +38,7 @@ class GameScreen
++_try; ++_try;
_totalTime = 0; _totalTime = 0;
_bird.reset(); _bird.reset();
_welt.reset(); _world.reset();
} }
} }

View File

@ -1,7 +1,7 @@
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Random; import java.util.Random;
class Welt implements Drawable class World implements Drawable
{ {
private static final int DISTANCE = 250; private static final int DISTANCE = 250;
private final ArrayList<Rectangle> _obstacles; private final ArrayList<Rectangle> _obstacles;
@ -9,7 +9,7 @@ class Welt implements Drawable
private double _acc = 2; private double _acc = 2;
private final Random _random; private final Random _random;
public Welt(GameScreen game) public World(GameScreen game)
{ {
game.addDrawable(this); game.addDrawable(this);
_random = new Random(); _random = new Random();