Skip to content

Commit

Permalink
(#20) Remove oldhelloworld, update examples to reflect main changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasstarsz committed Jul 4, 2021
1 parent 6521afe commit 1b061c2
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 241 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import tech.fastj.graphics.game.Polygon2D;
import tech.fastj.graphics.game.Text2D;
import tech.fastj.graphics.util.DrawUtil;
import tech.fastj.graphics.util.PsdfUtil;
import tech.fastj.graphics.util.ModelUtil;

import tech.fastj.systems.control.Scene;
import tech.fastj.systems.input.keyboard.KeyboardActionListener;
Expand All @@ -18,6 +18,7 @@
import java.awt.Color;
import java.awt.Font;
import java.awt.event.KeyEvent;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -150,7 +151,7 @@ private Polygon2D createPlayerHealthBar() {
}

private Model2D createPlayer() {
return new Model2D(PsdfUtil.loadPsdf(FilePaths.PathToResources + "player.psdf"));
return new Model2D(ModelUtil.loadModel(Path.of(FilePaths.PathToResources + "player.psdf")));
}

private void newWave() {
Expand All @@ -175,7 +176,7 @@ private Model2D createEnemy() {
Maths.randomAtEdge(Maths.random(-500f, -250f), Maths.random(970f, 1220f))
);

Model2D enemy = new Model2D(PsdfUtil.loadPsdf(FilePaths.PathToResources + "enemy.psdf"));
Model2D enemy = new Model2D(ModelUtil.loadModel(Path.of(FilePaths.PathToResources + "enemy.psdf")));
enemy.addBehavior(new EnemyMovement(this), this);
enemy.setTranslation(randomPosition);
drawableManager.addGameObject(enemy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ private void createBullet(GameObject player) {
Pointf cannonFront = Pointf.rotate(startingPoint, rotationAngle, rotationPoint);
Pointf[] bulletMesh = DrawUtil.createBox(cannonFront, BulletSize);

Polygon2D bullet = (Polygon2D) Polygon2D.create(bulletMesh)
.withFill(Color.red)
.build()
Polygon2D bullet = (Polygon2D) Polygon2D.fromPoints(bulletMesh)
.setFill(Color.red)
.addBehavior(bulletMovementScript, gameScene)
.<GameObject>addTag(Tags.Bullet, gameScene);

Expand Down
37 changes: 0 additions & 37 deletions src/example/java/tech/fastj/example/oldhelloworld/GameManager.java

This file was deleted.

12 changes: 0 additions & 12 deletions src/example/java/tech/fastj/example/oldhelloworld/Main.java

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 1b061c2

Please sign in to comment.