Skip to content

Commit

Permalink
fix sprites
Browse files Browse the repository at this point in the history
modified:   Code/Game.java
  • Loading branch information
wish13yt committed Oct 27, 2024
1 parent ce4b9ef commit 5e6ec9c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Code/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ public void mousePressed(MouseEvent e) {

private void loadSprite() {
try {
freakyBobSprite = ImageIO.read(new File("Code\\Assets\\Freakybob.png"));
freakyBobSprite = ImageIO.read(new File("Assets\\Freakybob.png"));
} catch (Exception e) {
System.err.println("Error loading sprite: " + e.getMessage());
e.printStackTrace();
}
}
private void loadGunshotSound() {
try {
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File("Code\\Assets\\gunshot.wav"));
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File("Assets\\gunshot.wav"));
gunshotClip = AudioSystem.getClip();
gunshotClip.open(audioInputStream);
} catch (Exception e) {
Expand All @@ -154,7 +154,7 @@ private void playGunshotSound() {
}
private void playMusic() {
try {
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File("Code\\Assets\\awesome_ass_music_David_Fesliyan.wav"));
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File("Assets\\awesome_ass_music_David_Fesliyan.wav"));
clip = AudioSystem.getClip();
clip.open(audioInputStream);
clip.loop(Clip.LOOP_CONTINUOUSLY);
Expand Down Expand Up @@ -396,7 +396,7 @@ public Enemy(int x, int y) {

private void loadSprite() {
try {
enemySprite = ImageIO.read(new File("Code\\Assets\\ScarySquirtward.png"));
enemySprite = ImageIO.read(new File("Assets\\ScarySquirtward.png"));
} catch (IOException e) {
System.err.println("Error loading enemy sprite: " + e.getMessage());
e.printStackTrace();
Expand Down Expand Up @@ -447,9 +447,9 @@ public Perk(int x, int y, int type) {
protected void loadImage() {
try {
if (type == 0) {
image = ImageIO.read(new File("Code/Assets/green-marijuana-leaf-png_252592.jpg"));
image = ImageIO.read(new File("Assets/green-marijuana-leaf-png_252592.jpg"));
} else if (type == 1) {
image = ImageIO.read(new File("Code/Assets/speed_perk.png"));
image = ImageIO.read(new File("Assets/speed_perk.png"));
}
} catch (IOException e) {
e.printStackTrace();
Expand Down

0 comments on commit 5e6ec9c

Please sign in to comment.