simplified duplicated code

This commit is contained in:
2025-11-28 16:34:40 +01:00
parent c3aa7ea540
commit 73e17a56fc
14 changed files with 57 additions and 25 deletions

View File

@@ -0,0 +1,26 @@
package de.miaurizius.jgame2d.entity;
import de.miaurizius.jgame2d.core.Direction;
import de.miaurizius.jgame2d.core.GamePanel;
public class OldManNPC extends Entity {
public OldManNPC(GamePanel panel) {
super(panel);
direction = Direction.DOWN;
speed = 1;
}
public void getPlayerImage() {
up1 = initEntitySprites("boy_up_1");
up2 = initEntitySprites("boy_up_2");
down1 = initEntitySprites("boy_down_1");
down2 = initEntitySprites("boy_down_2");
left1 = initEntitySprites("boy_left_1");
left2 = initEntitySprites("boy_left_2");
right1 = initEntitySprites("boy_right_1");
right2 = initEntitySprites("boy_right_2");
}
}