Skip to content

Commit

Permalink
Merge pull request #140 from fastjengine/fix-sprite2d-init
Browse files Browse the repository at this point in the history
Fix sprite2d constructor
  • Loading branch information
lucasstarsz authored Oct 25, 2021
2 parents 77ed10c + a4d55e5 commit 92df95f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/tech/fastj/graphics/game/Sprite2D.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public class Sprite2D extends GameObject {

Sprite2D(ImageResource spritesResource, int horizontalImageCount, int verticalImageCount) {
this.spritesResource = spritesResource;
setCollisionPath(DrawUtil.createPath(DrawUtil.createBoxFromImage(sprites[0])));
resetSpriteSheet(horizontalImageCount, verticalImageCount);
setCollisionPath(DrawUtil.createPath(DrawUtil.createBoxFromImage(sprites[0])));
resetSpriteAnimator();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@
import tech.fastj.math.Maths;
import tech.fastj.math.Point;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import unittest.EnvironmentHelper;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assumptions.assumeFalse;

class EngineConfigTests {

@BeforeAll
public static void onlyRunIfNotHeadless() {
assumeFalse(EnvironmentHelper.IsEnvironmentHeadless);
}

@Test
void checkEngineConfigDefaults_shouldMatchEngineDefaults() {
assertEquals(FastJEngine.DefaultFPS, EngineConfig.Default.targetFPS(), "The default engine config FPS should match the default FPS.");
Expand Down

0 comments on commit 92df95f

Please sign in to comment.