-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Neeltyper001/feature
Feature
- Loading branch information
Showing
35 changed files
with
430 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package Graphics; | ||
|
||
import javax.swing.Icon; | ||
import javax.swing.ImageIcon; | ||
import javax.swing.JLabel; | ||
import javax.swing.JWindow; | ||
|
||
import com.audios.GameStartEffect; | ||
import com.constants.GameConstants; | ||
import com.constants.GameResourcesPath; | ||
import com.constants.TemporalConstants; | ||
|
||
public class SplashScreen extends JWindow implements GameResourcesPath,GameConstants,TemporalConstants{ | ||
private JLabel label = new JLabel(); | ||
private GameStartEffect gameStartEffect = new GameStartEffect(); | ||
|
||
public SplashScreen() { | ||
setSize(SPLASH_SCREEN_WIDTH,SPLASH_SCREEN_HEIGHT); | ||
Icon icon = new ImageIcon(SplashScreen.class.getResource(SPLASH_SCREEN)); | ||
label.setIcon(icon); | ||
this.add(label); | ||
setLocationRelativeTo(null); | ||
setVisible(true); | ||
gameStartEffect.playGameStart(); | ||
try { | ||
Thread.sleep(FIVE_SECONDS); | ||
setVisible(false); | ||
dispose(); | ||
} catch(Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.audios; | ||
|
||
|
||
import java.io.IOException; | ||
import java.net.URL; | ||
|
||
import javax.sound.sampled.AudioInputStream; | ||
import javax.sound.sampled.AudioSystem; | ||
import javax.sound.sampled.Clip; | ||
import javax.sound.sampled.LineUnavailableException; | ||
import javax.sound.sampled.UnsupportedAudioFileException; | ||
|
||
|
||
import com.constants.GameResourcesPath; | ||
|
||
|
||
public class GameMusic implements GameResourcesPath{ | ||
|
||
private AudioInputStream audioInputStream; | ||
private URL gameMusicUrl; | ||
private Clip gameMusicClip; | ||
|
||
public GameMusic(){ | ||
this.createGameMusicURL(); | ||
this.getGameMusicPlayer(); | ||
} | ||
|
||
private void getGameMusicPlayer() { | ||
try { | ||
this.audioInputStream = AudioSystem.getAudioInputStream(gameMusicUrl); | ||
this.gameMusicClip = AudioSystem.getClip(); | ||
this.gameMusicClip.open(this.audioInputStream); | ||
} catch (UnsupportedAudioFileException | IOException | LineUnavailableException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
|
||
} | ||
|
||
private void createGameMusicURL() { | ||
this.gameMusicUrl = getClass().getResource(GAME_MUSIC_2); | ||
} | ||
|
||
public void playGameMusic() { | ||
this.gameMusicClip.loop(Clip.LOOP_CONTINUOUSLY); | ||
} | ||
|
||
public void stopGameMusic() { | ||
this.gameMusicClip.stop(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.audios; | ||
|
||
import java.io.IOException; | ||
import java.net.URL; | ||
|
||
import javax.sound.sampled.AudioInputStream; | ||
import javax.sound.sampled.AudioSystem; | ||
import javax.sound.sampled.Clip; | ||
import javax.sound.sampled.LineUnavailableException; | ||
import javax.sound.sampled.UnsupportedAudioFileException; | ||
|
||
import com.constants.GameResourcesPath; | ||
|
||
|
||
public class GameOverEffect implements GameResourcesPath { | ||
private AudioInputStream audioInputStream; | ||
private URL gameOverUrl; | ||
private Clip gameOverClip; | ||
|
||
public GameOverEffect(){ | ||
this.createGameOverURL(); | ||
this.getGameOverPlayer(); | ||
} | ||
|
||
private void getGameOverPlayer() { | ||
try { | ||
this.audioInputStream = AudioSystem.getAudioInputStream(gameOverUrl); | ||
this.gameOverClip = AudioSystem.getClip(); | ||
this.gameOverClip.open(this.audioInputStream); | ||
} catch (UnsupportedAudioFileException | IOException | LineUnavailableException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
|
||
} | ||
|
||
private void createGameOverURL() { | ||
this.gameOverUrl = getClass().getResource(GAME_OVER_2); | ||
} | ||
|
||
public void playGameOver() { | ||
this.gameOverClip.start(); | ||
} | ||
|
||
public void stopGameOver() { | ||
this.gameOverClip.stop(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.audios; | ||
|
||
import java.io.IOException; | ||
import java.net.URL; | ||
|
||
import javax.sound.sampled.AudioInputStream; | ||
import javax.sound.sampled.AudioSystem; | ||
import javax.sound.sampled.Clip; | ||
import javax.sound.sampled.LineUnavailableException; | ||
import javax.sound.sampled.UnsupportedAudioFileException; | ||
|
||
import com.constants.GameResourcesPath; | ||
|
||
public class GameStartEffect implements GameResourcesPath { | ||
private AudioInputStream audioInputStream; | ||
private URL gameStartUrl; | ||
private Clip gameStartClip; | ||
|
||
public GameStartEffect(){ | ||
this.createGameStartURL(); | ||
this.getGameStartPlayer(); | ||
} | ||
|
||
private void getGameStartPlayer() { | ||
try { | ||
this.audioInputStream = AudioSystem.getAudioInputStream(gameStartUrl); | ||
this.gameStartClip = AudioSystem.getClip(); | ||
this.gameStartClip.open(this.audioInputStream); | ||
} catch (UnsupportedAudioFileException | IOException | LineUnavailableException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
|
||
} | ||
|
||
private void createGameStartURL() { | ||
this.gameStartUrl = getClass().getResource(GAME_START_2); | ||
} | ||
|
||
public void playGameStart() { | ||
this.gameStartClip.start(); | ||
} | ||
|
||
public void stopGameStart() { | ||
this.gameStartClip.stop(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.audios; | ||
|
||
import java.io.IOException; | ||
import java.net.URL; | ||
|
||
import javax.sound.sampled.AudioInputStream; | ||
import javax.sound.sampled.AudioSystem; | ||
import javax.sound.sampled.Clip; | ||
import javax.sound.sampled.LineUnavailableException; | ||
import javax.sound.sampled.UnsupportedAudioFileException; | ||
|
||
import com.constants.GameResourcesPath; | ||
|
||
public class GunShotEffect implements GameResourcesPath { | ||
private AudioInputStream audioInputStream; | ||
private URL gunShotUrl; | ||
private Clip gunShotClip; | ||
|
||
public GunShotEffect(){ | ||
this.createGunShotURL(); | ||
this.getGunShotPlayer(); | ||
} | ||
|
||
private void getGunShotPlayer() { | ||
try { | ||
this.audioInputStream = AudioSystem.getAudioInputStream(gunShotUrl); | ||
this.gunShotClip = AudioSystem.getClip(); | ||
this.gunShotClip.open(this.audioInputStream); | ||
} catch (UnsupportedAudioFileException | IOException | LineUnavailableException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
|
||
} | ||
|
||
private void createGunShotURL() { | ||
this.gunShotUrl = getClass().getResource(GUN_SHOT_2); | ||
} | ||
|
||
public void playGunShot() { | ||
this.gunShotClip.setMicrosecondPosition(0); | ||
this.gunShotClip.loop(Clip.LOOP_CONTINUOUSLY); | ||
} | ||
|
||
public void stopGunShot() { | ||
this.gunShotClip.stop(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
package com.constants; | ||
|
||
public interface AnimationConstants { | ||
// PLAYER ANIMATION | ||
int ANIMATION_TICK=0; | ||
int ANIMATION_STARTING_INDEX = 0; | ||
int ANIMATION_TICK_LIMIT = 15; | ||
|
||
// ENEMY ANIMATION | ||
int ENEMY_ANIMATION_TICK=0; | ||
int ENEMY_ANIMATION_STARTING_INDEX = 0; | ||
int ENEMY_ANIMATION_TICK_LIMIT = 15; | ||
} |
Oops, something went wrong.