Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Display.class
Binary file not shown.
351 changes: 231 additions & 120 deletions Display.java

Large diffs are not rendered by default.

Binary file modified Driver.class
Binary file not shown.
62 changes: 57 additions & 5 deletions Driver.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.swing.*;

import java.io.*;
import javax.sound.sampled.*;
import javax.sound.sampled.DataLine.Info;
public class Driver
{
public static void main(String[] args)
{
playContinuous("Spectre.wav");
JFrame frame = new JFrame("Yeet Fighter");
frame.setSize(965, 640);
frame.setLocation(200,100);
Expand All @@ -19,9 +25,7 @@ public static void main(String[] args)
Fighter fighters[] = new Fighter[2];
int m = 0;
while(disp.getMode() == 0)
{

}
{}
fighters = disp.loadGame(plat);

int fps = 60;
Expand All @@ -47,4 +51,52 @@ public static void main(String[] args)
}
disp.endGame(fighters);
}
}
// public static void playMusic(String filename){
// InputStream music;
// try{
// System.out.println("Playing Audio Once");
// music = new FileInputStream(new File(filename));
// AudioStream aud = new AudioStream(music);
// AudioPlayer.player.start(aud);
// }
// catch(Exception e){
// System.out.println("Playing Music Once");
// }
// }
// public static void playMusicInALoop(String filename){
// try{
// AudioInputStream inputStream = AudioSystem.getAudioInputStream(new File(filename));
// Clip clip = AudioSystem.getClip();
// clip.open(inputStream);
// clip.loop(Clip.LOOP_CONTINUOUSLY);
// }
// catch(Exception e){
// System.out.println(e);
// playMusic(filename);
// }
// }
public static void playContinuous(String filename){
try{
AudioInputStream inputStream = AudioSystem.getAudioInputStream(new File(filename));
DataLine.Info lineInfo = new DataLine.Info(SourceDataLine.class, inputStream.getFormat());
SourceDataLine clip = (SourceDataLine)AudioSystem.getLine(lineInfo);
clip.open(inputStream.getFormat());
clip.start();
final int BUFFERSIZE = 1024;
byte[] buffer = new byte[BUFFERSIZE];
int bytesRead = -1;
bytesRead = inputStream.read(buffer);
while (bytesRead != 1){
clip.write(buffer, 0 ,bytesRead);
bytesRead = inputStream.read(buffer);
}
clip.drain();
clip.close();
inputStream.close();
}
catch(Exception e){
System.out.println(e);
// playMusic(filename);
}
}
}
Binary file modified Fighter$AirDirection.class
Binary file not shown.
Binary file modified Fighter$AirDown.class
Binary file not shown.
Binary file modified Fighter$AirNeutral.class
Binary file not shown.
Binary file modified Fighter$Attack.class
Binary file not shown.
Binary file modified Fighter$BasicDirection.class
Binary file not shown.
Binary file modified Fighter$BasicNeutral.class
Binary file not shown.
Binary file modified Fighter$BasicUp.class
Binary file not shown.
Binary file modified Fighter.class
Binary file not shown.
30 changes: 26 additions & 4 deletions Fighter.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public class Fighter
boolean right = false;
int attacking = 0;
int attackT = 0;
int blocking = 0;
int blockT = 0;
Fighter.Attack attack;


Expand Down Expand Up @@ -83,6 +85,16 @@ public int getAttacking()
{
return this.attacking;
}

public void setBlocking(int a)
{
this.blocking = a;
}

public int getBlocking()
{
return this.blocking;
}

public void setRight(boolean r)
{
Expand All @@ -104,6 +116,16 @@ public int getAttackT()
return this.attackT;
}

public void setBlockT(int a)
{
this.blockT = a;
}

public int getBlockT()
{
return this.blockT;
}




Expand Down Expand Up @@ -182,7 +204,7 @@ public class AirDirection extends Attack
setSize(120,10);
setDamage(50);
setKnockBack(120,-10);
setTime(30);
setTime(20);
}
}
public class AirDown extends Attack
Expand All @@ -200,7 +222,7 @@ public class AirNeutral extends Attack
AirNeutral(){
setPos(20,20);
setSize(50,50);
setDamage(100);
setDamage(110);
setKnockBack(40,-10);
setTime(25);
}
Expand Down Expand Up @@ -229,9 +251,9 @@ public class BasicUp extends Attack
{
BasicUp(){
setPos(20,-10);
setSize(10,20);
setSize(10,10);
setDamage(200);
setKnockBack(0,-200);
setKnockBack(4,-200);
setTime(50);
}
}
Expand Down
Binary file added Force.mp3
Binary file not shown.
Binary file added Spectre.mp3
Binary file not shown.