1

import code

This commit is contained in:
2024-08-26 22:35:42 +03:00
commit fd45f6aa74
86 changed files with 5578 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
package com.mojang.ld22.sound;
import java.applet.Applet;
import java.applet.AudioClip;
public class Sound {
public static final Sound playerHurt = new Sound("/playerhurt.wav");
public static final Sound playerDeath = new Sound("/death.wav");
public static final Sound monsterHurt = new Sound("/monsterhurt.wav");
public static final Sound test = new Sound("/test.wav");
public static final Sound pickup = new Sound("/pickup.wav");
public static final Sound bossdeath = new Sound("/bossdeath.wav");
public static final Sound craft = new Sound("/craft.wav");
private AudioClip clip;
private Sound(String name) {
try {
clip = Applet.newAudioClip(Sound.class.getResource(name));
} catch (Throwable e) {
e.printStackTrace();
}
}
public void play() {
try {
new Thread() {
public void run() {
clip.play();
}
}.start();
} catch (Throwable e) {
e.printStackTrace();
}
}
}