Minor adjustments

master
John 2022-06-01 14:48:46 -04:00
parent f6fe5def83
commit 21edb5f4f4
6 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_18" default="true" project-jdk-name="openjdk-18" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="openjdk-18" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

Binary file not shown.

Binary file not shown.

View File

@ -143,10 +143,10 @@ public class GamePanel extends JPanel implements Runnable, KeyListener{
move();
checkCollision();
repaint();
if (frameCounter > 10) {
if (frameCounter > 5) {
// increment sprite image to be used and keeps it below 12
frame = (frame + 1) % 11;
frameCounter -= 10;
frameCounter -= 5;
}
delta--;
}

View File

@ -48,7 +48,7 @@ public class Player extends GenericSprite {
public int draw(Graphics g, int frame) {
// g.setColor(Color.WHITE);
if (!upPressed && !downPressed && !leftPressed && !rightPressed) {
g.drawImage(spriteArray[lastXDirection][lastYDirection][lastFrame], x, y, null);
g.drawImage(spriteArray[lastXDirection][lastYDirection][0], x, y, null);
return 0;
} else {
lastXDirection = (int)(Math.signum(xVelocity) + 1) / 2;