Merge remote-tracking branch 'origin/master'

# Conflicts:
#	out/production/final/GamePanel.class
#	out/production/final/GenericSprite.class
master
bob 2022-06-01 14:49:50 -04:00
commit 5de61a7ba7
4 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.

View File

@ -141,10 +141,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;