@@ -0,0 +1,235 @@
package data;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

import data.StateManager.GameState;

public class MouseInput implements MouseListener, MouseMotionListener{

@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub

}

@Override
public void mouseEntered(MouseEvent e) {


}

@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub

}

@Override
public void mousePressed(MouseEvent e) {
int mx = e.getX();
int my = e.getY();
//Main Menu
if(StateManager.gameState == GameState.MAINMENU)
{
//Play
if(mx>650 && mx<(650+167) && my>135 && my<(135+100))
{
StateManager.game = null;
StateManager.characterSelect = null;
StateManager.gameState = GameState.CHARACTERSELECT;
}
//Settings
if(mx>637 && mx<(637+200) && my>240 && my<(240+100))
{
MainMenu.music.stop();
MainMenu.music.close();
StateManager.settings = null;
StateManager.gameState = GameState.SETTINGS;
}
//Exit
if(mx>650 && mx<(650+167) && my>345 && my<(345+100))
{
StateManager.gameState = GameState.EXIT;
}
}
//Settings
else if(StateManager.gameState == GameState.SETTINGS)
{
//Music
if(MainMenu.musicOn==true)
{
if(mx>585 && mx<685 && my>148 && my<245)
{
MainMenu.music.stop();
MainMenu.music.close();
MainMenu.musicOn = false;
}

}
else
{
if(mx>585 && mx<685 && my>148 && my<245)
{
MainMenu.musicOn = true;
MainMenu.music = new AudioPlayer("res/menuMusic.wav");
MainMenu.music.play();
}
}
//SFX
if(mx>585 && mx<685 && my>281 && my<378)
{
MainMenu.sfxOn = !MainMenu.sfxOn;
}
//Back
if(mx>820 && mx<880 && my>15 && my<50)
{
MainMenu.music.stop();
MainMenu.music.close();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
StateManager.gameState = GameState.MAINMENU;
if(MainMenu.musicOn)
MainMenu.music.play();
}
}

else if(StateManager.gameState == GameState.CHARACTERSELECT)
{
if(CharacterSelect.playerOneChar == null)
{
if(mx>75 && mx<368 && my>100 && my<399)
{
CharacterSelect.playerOneChar = "Mario";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
CharacterSelect.playerOneChar = "Luigi";
}
}
else if(CharacterSelect.playerTwoChar == null)
{
if(mx>75 && mx<368 && my>100 && my<399)
{
CharacterSelect.playerTwoChar = "Mario";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
CharacterSelect.playerTwoChar = "Luigi";
}
}
else
{
if(mx>380 && mx <510 && my>400 && my<435)
{
StateManager.mapSelect = null;
StateManager.gameState = GameState.MAPSELECT;
StateManager.characterSelect = null;
}
}
if(mx>830 && mx<890 && my>400 && my<435)
{
MainMenu.music.stop();
MainMenu.music.close();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
StateManager.gameState = GameState.MAINMENU;
StateManager.characterSelect = null;
CharacterSelect.playerTwoChar = null;
CharacterSelect.playerOneChar = null;
if(MainMenu.musicOn)
MainMenu.music.play();
}
}

else if(StateManager.gameState == GameState.MAPSELECT)
{
if(MapSelect.mapName == null)
{
if(mx>75 && mx<368 && my>100 && my<399)
{
MapSelect.mapName = "Freefall";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
MapSelect.mapName = "Hellfire";
}
}
else
{
if(mx>75 && mx<368 && my>100 && my<399)
{
MapSelect.mapName = "Freefall";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
MapSelect.mapName = "Hellfire";
}
if(mx>380 && mx <510 && my>400 && my<435)
{
MainMenu.music.stop();
MainMenu.music.close();
StateManager.mapSelect = null;
StateManager.game = null;
StateManager.game2 = null;
if(MapSelect.mapName.equals("Freefall"))
StateManager.gameState = GameState.GAME;
else if (MapSelect.mapName.equals("Hellfire"))
StateManager.gameState = GameState.GAME2;
StateManager.characterSelect = null;
StateManager.mapSelect = null;
MapSelect.mapName = null;
}
}
if(mx>830 && mx<890 && my>400 && my<435)
{
StateManager.characterSelect = null;
CharacterSelect.playerTwoChar = null;
CharacterSelect.playerOneChar = null;
StateManager.gameState = GameState.CHARACTERSELECT;
MapSelect.mapName = null;
}
}


}

@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub

}


@Override
public void mouseDragged(MouseEvent e) {
// TODO Auto-generated method stub

}

@Override
public void mouseMoved(MouseEvent e) {

//Main Menu
int mx = e.getX();
int my = e.getY();
if(StateManager.gameState == GameState.MAINMENU)
{
//Play
if(mx>650 && mx<(650+167) && my>135 && my<(135+100))
{
MainMenu.sfx1.play();
}
//Settings
if(mx>637 && mx<(637+200) && my>240 && my<(240+100))
{
MainMenu.sfx1.play();
}
//Exit
if(mx>650 && mx<(650+167) && my>345 && my<(345+100))
{
MainMenu.sfx1.play();
}
}
}

}
@@ -16,7 +16,7 @@ public class World2 {
{
grid = g;
bg = new Tile(0, 0, WIDTH, HEIGHT, TileType.Background2);
mapTex = new Tile(0, 0, WIDTH, HEIGHT, TileType.MapTex2);
mapTex = new Tile(0, 0, WIDTH, HEIGHT+10, TileType.PBJT);
fiyah = new Tile(0, 350, WIDTH, HEIGHT-200, TileType.Fire);
gameMusic = new AudioPlayer("res/gameMusic.wav");
if(MainMenu.musicOn == true)

This file was deleted.

@@ -0,0 +1,41 @@
package data;

import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;

import data.StateManager.GameState;

public class MouseMotionInput implements MouseMotionListener{

@Override
public void mouseDragged(MouseEvent arg0) {
// TODO Auto-generated method stub

}

@Override
public void mouseMoved(MouseEvent arg0) {
int mx = e.getX();
int my = e.getY();
if(StateManager.gameState == GameState.MAINMENU)
{
//Play
if(mx>650 && mx<(650+167) && my>135 && my<(135+100))
{
MainMenu.sfx1.play();
}
//Settings
if(mx>637 && mx<(637+200) && my>240 && my<(240+100))
{
MainMenu.sfx1.play();
}
//Exit
if(mx>650 && mx<(650+167) && my>345 && my<(345+100))
{
MainMenu.sfx1.play();
}
}

}

}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -0,0 +1,227 @@
package data;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import data.StateManager.GameState;

public class MouseInput implements MouseListener{

@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub

}

@Override
public void mouseEntered(MouseEvent e) {


}

@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub

}

@Override
public void mousePressed(MouseEvent e) {
int mx = e.getX();
int my = e.getY();
//Main Menu
if(StateManager.gameState == GameState.MAINMENU)
{
//Play
if(mx>650 && mx<(650+167) && my>135 && my<(135+100))
{
StateManager.game = null;
StateManager.characterSelect = null;
StateManager.gameState = GameState.CHARACTERSELECT;
}
//Settings
if(mx>637 && mx<(637+200) && my>240 && my<(240+100))
{
MainMenu.music.stop();
MainMenu.music.close();
StateManager.settings = null;
StateManager.gameState = GameState.SETTINGS;
}
//Exit
if(mx>650 && mx<(650+167) && my>345 && my<(345+100))
{
StateManager.gameState = GameState.EXIT;
}
}
//Settings
else if(StateManager.gameState == GameState.SETTINGS)
{
//Music
if(MainMenu.musicOn==true)
{
if(mx>585 && mx<685 && my>148 && my<245)
{
MainMenu.music.stop();
MainMenu.music.close();
MainMenu.musicOn = false;
}

}
else
{
if(mx>585 && mx<685 && my>148 && my<245)
{
MainMenu.musicOn = true;
MainMenu.music = new AudioPlayer("res/menuMusic.wav");
MainMenu.music.play();
}
}
//SFX
if(mx>585 && mx<685 && my>281 && my<378)
{
MainMenu.sfxOn = !MainMenu.sfxOn;
}
//Back
if(mx>820 && mx<880 && my>15 && my<50)
{
MainMenu.music.stop();
MainMenu.music.close();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
StateManager.gameState = GameState.MAINMENU;
if(MainMenu.musicOn)
MainMenu.music.play();
}
}

else if(StateManager.gameState == GameState.CHARACTERSELECT)
{
if(CharacterSelect.playerOneChar == null)
{
if(mx>75 && mx<368 && my>100 && my<399)
{
CharacterSelect.playerOneChar = "Mario";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
CharacterSelect.playerOneChar = "Luigi";
}
}
else if(CharacterSelect.playerTwoChar == null)
{
if(mx>75 && mx<368 && my>100 && my<399)
{
CharacterSelect.playerTwoChar = "Mario";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
CharacterSelect.playerTwoChar = "Luigi";
}
}
else
{
if(mx>380 && mx <510 && my>400 && my<435)
{
StateManager.mapSelect = null;
StateManager.gameState = GameState.MAPSELECT;
StateManager.characterSelect = null;
}
}
if(mx>830 && mx<890 && my>400 && my<435)
{
MainMenu.music.stop();
MainMenu.music.close();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
StateManager.gameState = GameState.MAINMENU;
StateManager.characterSelect = null;
CharacterSelect.playerTwoChar = null;
CharacterSelect.playerOneChar = null;
if(MainMenu.musicOn)
MainMenu.music.play();
}
}

else if(StateManager.gameState == GameState.MAPSELECT)
{
if(MapSelect.mapName == null)
{
if(mx>75 && mx<368 && my>100 && my<399)
{
MapSelect.mapName = "Freefall";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
MapSelect.mapName = "Hellfire";
}
}
else
{
if(mx>75 && mx<368 && my>100 && my<399)
{
MapSelect.mapName = "Freefall";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
MapSelect.mapName = "Hellfire";
}
if(mx>380 && mx <510 && my>400 && my<435)
{
MainMenu.music.stop();
MainMenu.music.close();
StateManager.mapSelect = null;
StateManager.game = null;
StateManager.game2 = null;
if(MapSelect.mapName.equals("Freefall"))
StateManager.gameState = GameState.GAME;
else if (MapSelect.mapName.equals("Hellfire"))
StateManager.gameState = GameState.GAME2;
StateManager.characterSelect = null;
StateManager.mapSelect = null;
MapSelect.mapName = null;
}
}
if(mx>830 && mx<890 && my>400 && my<435)
{
StateManager.characterSelect = null;
CharacterSelect.playerTwoChar = null;
CharacterSelect.playerOneChar = null;
StateManager.gameState = GameState.CHARACTERSELECT;
MapSelect.mapName = null;
}
}


}

@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub

}

public void nice(MouseEvent e)
{
//Main Menu
int mx = e.getX();
int my = e.getY();
if(StateManager.gameState == GameState.MAINMENU)
{
//Play
if(mx>650 && mx<(650+167) && my>135 && my<(135+100))
{
MainMenu.sfx1.play();
MainMenu.sfx1.stop();
}
//Settings
if(mx>637 && mx<(637+200) && my>240 && my<(240+100))
{
MainMenu.sfx1.play();
}
//Exit
if(mx>650 && mx<(650+167) && my>345 && my<(345+100))
{
MainMenu.sfx1.play();
}
}
}

}
@@ -0,0 +1,206 @@
package data;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import data.StateManager.GameState;

public class MouseInput implements MouseListener{

@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub

}

@Override
public void mouseEntered(MouseEvent e) {


}

@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub

}

@Override
public void mousePressed(MouseEvent e) {
int mx = e.getX();
int my = e.getY();
//Main Menu
if(StateManager.gameState == GameState.MAINMENU)
{
//Play
if(mx>650 && mx<(650+167) && my>135 && my<(135+100))
{
StateManager.game = null;
StateManager.characterSelect = null;
StateManager.gameState = GameState.CHARACTERSELECT;
}
//Settings
if(mx>637 && mx<(637+200) && my>240 && my<(240+100))
{
MainMenu.music.stop();
MainMenu.music.close();
StateManager.settings = null;
StateManager.gameState = GameState.SETTINGS;
}
//Exit
if(mx>650 && mx<(650+167) && my>345 && my<(345+100))
{
StateManager.gameState = GameState.EXIT;
}
}
//Settings
else if(StateManager.gameState == GameState.SETTINGS)
{
//Music
if(MainMenu.musicOn==true)
{
if(mx>585 && mx<685 && my>148 && my<245)
{
MainMenu.music.stop();
MainMenu.music.close();
MainMenu.musicOn = false;
}

}
else
{
if(mx>585 && mx<685 && my>148 && my<245)
{
MainMenu.musicOn = true;
MainMenu.music = new AudioPlayer("res/menuMusic.wav");
MainMenu.music.play();
}
}
//SFX
if(mx>585 && mx<685 && my>281 && my<378)
{
MainMenu.sfxOn = !MainMenu.sfxOn;
}
//Back
if(mx>820 && mx<880 && my>15 && my<50)
{
MainMenu.music.stop();
MainMenu.music.close();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
StateManager.gameState = GameState.MAINMENU;
if(MainMenu.musicOn)
MainMenu.music.play();
}
}

else if(StateManager.gameState == GameState.CHARACTERSELECT)
{
if(CharacterSelect.playerOneChar == null)
{
if(mx>75 && mx<368 && my>100 && my<399)
{
CharacterSelect.playerOneChar = "Mario";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
CharacterSelect.playerOneChar = "Luigi";
}
}
else if(CharacterSelect.playerTwoChar == null)
{
if(mx>75 && mx<368 && my>100 && my<399)
{
CharacterSelect.playerTwoChar = "Mario";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
CharacterSelect.playerTwoChar = "Luigi";
}
}
else
{
if(mx>380 && mx <510 && my>400 && my<435)
{
StateManager.mapSelect = null;
StateManager.gameState = GameState.MAPSELECT;
StateManager.characterSelect = null;
}
}
if(mx>830 && mx<890 && my>400 && my<435)
{
MainMenu.music.stop();
MainMenu.music.close();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
StateManager.gameState = GameState.MAINMENU;
StateManager.characterSelect = null;
CharacterSelect.playerTwoChar = null;
CharacterSelect.playerOneChar = null;
if(MainMenu.musicOn)
MainMenu.music.play();
}
}

else if(StateManager.gameState == GameState.MAPSELECT)
{
if(MapSelect.mapName == null)
{
if(mx>75 && mx<368 && my>100 && my<399)
{
MapSelect.mapName = "Freefall";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
MapSelect.mapName = "Hellfire";
}
}
else
{
if(mx>75 && mx<368 && my>100 && my<399)
{
MapSelect.mapName = "Freefall";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
MapSelect.mapName = "Hellfire";
}
if(mx>380 && mx <510 && my>400 && my<435)
{
MainMenu.music.stop();
MainMenu.music.close();
StateManager.mapSelect = null;
StateManager.game = null;
StateManager.game2 = null;
if(MapSelect.mapName.equals("Freefall"))
StateManager.gameState = GameState.GAME;
else if (MapSelect.mapName.equals("Hellfire"))
StateManager.gameState = GameState.GAME2;
StateManager.characterSelect = null;
StateManager.mapSelect = null;
MapSelect.mapName = null;
}
}
if(mx>830 && mx<890 && my>400 && my<435)
{
StateManager.characterSelect = null;
CharacterSelect.playerTwoChar = null;
CharacterSelect.playerOneChar = null;
StateManager.gameState = GameState.CHARACTERSELECT;
MapSelect.mapName = null;
}
}


}

@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub

}

public void nice(MouseEvent e)
{

}

}
@@ -0,0 +1,54 @@
package data;

import java.awt.Graphics;
import java.awt.Image;


import javax.swing.ImageIcon;

public class MainMenu {

public static final int WIDTH = 900, HEIGHT = 450; //Default
public static boolean musicOn;
public static boolean sfxOn;

private Image menuBG;
public static AudioPlayer music;
public static AudioPlayer sfx1;
public static AudioPlayer sfx2;
private UI menuUI;
private Image play, settings, exit;
public MainMenu()
{
this.menuBG = new ImageIcon(getClass().getClassLoader().getResource("res/mainmenu.png")).getImage();
this.play = new ImageIcon(getClass().getClassLoader().getResource("res/play.png")).getImage();
this.settings = new ImageIcon(getClass().getClassLoader().getResource("res/settings.png")).getImage();
this.exit = new ImageIcon(getClass().getClassLoader().getResource("res/exit.png")).getImage();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
MainMenu.sfx1 = new AudioPlayer("res/buttonEffect.wav");
MainMenu.musicOn = true;
MainMenu.sfxOn = true;
this.menuUI = new UI();
menuUI.addButton("Play", play, 650, 135, 167, 100);
menuUI.addButton("Settings", settings, 637, 240, 200, 100);
menuUI.addButton("Exit", exit, 650, 345, 167, 100);
if(MainMenu.musicOn == true)
music.play();
if(MainMenu.sfxOn == true){
sfx1.play();
sfx1.close();
}
}

private void updateButtons()
{

}

public void update(Graphics g)
{
g.drawImage(menuBG, 0, 0, WIDTH, HEIGHT, null);
menuUI.draw(g);
}

}
@@ -0,0 +1,202 @@
package data;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

import data.StateManager.GameState;

public class MouseInput implements MouseListener{

@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub

}

@Override
public void mouseEntered(MouseEvent e) {


}

@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub

}

@Override
public void mousePressed(MouseEvent e) {
int mx = e.getX();
int my = e.getY();
//Main Menu
if(StateManager.gameState == GameState.MAINMENU)
{
//Play
if(mx>650 && mx<(650+167) && my>135 && my<(135+100))
{
StateManager.game = null;
StateManager.characterSelect = null;
StateManager.gameState = GameState.CHARACTERSELECT;
}
//Settings
if(mx>637 && mx<(637+200) && my>240 && my<(240+100))
{
MainMenu.music.stop();
MainMenu.music.close();
StateManager.settings = null;
StateManager.gameState = GameState.SETTINGS;
}
//Exit
if(mx>650 && mx<(650+167) && my>345 && my<(345+100))
{
StateManager.gameState = GameState.EXIT;
}
}
//Settings
else if(StateManager.gameState == GameState.SETTINGS)
{
//Music
if(MainMenu.musicOn==true)
{
if(mx>585 && mx<685 && my>148 && my<245)
{
MainMenu.music.stop();
MainMenu.music.close();
MainMenu.musicOn = false;
}

}
else
{
if(mx>585 && mx<685 && my>148 && my<245)
{
MainMenu.musicOn = true;
MainMenu.music = new AudioPlayer("res/menuMusic.wav");
MainMenu.music.play();
}
}
//SFX
if(mx>585 && mx<685 && my>281 && my<378)
{
MainMenu.sfxOn = !MainMenu.sfxOn;
}
//Back
if(mx>820 && mx<880 && my>15 && my<50)
{
MainMenu.music.stop();
MainMenu.music.close();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
StateManager.gameState = GameState.MAINMENU;
if(MainMenu.musicOn)
MainMenu.music.play();
}
}

else if(StateManager.gameState == GameState.CHARACTERSELECT)
{
if(CharacterSelect.playerOneChar == null)
{
if(mx>75 && mx<368 && my>100 && my<399)
{
CharacterSelect.playerOneChar = "Mario";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
CharacterSelect.playerOneChar = "Luigi";
}
}
else if(CharacterSelect.playerTwoChar == null)
{
if(mx>75 && mx<368 && my>100 && my<399)
{
CharacterSelect.playerTwoChar = "Mario";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
CharacterSelect.playerTwoChar = "Luigi";
}
}
else
{
if(mx>380 && mx <510 && my>400 && my<435)
{
StateManager.mapSelect = null;
StateManager.gameState = GameState.MAPSELECT;
StateManager.characterSelect = null;
}
}
if(mx>830 && mx<890 && my>400 && my<435)
{
MainMenu.music.stop();
MainMenu.music.close();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
StateManager.gameState = GameState.MAINMENU;
StateManager.characterSelect = null;
CharacterSelect.playerTwoChar = null;
CharacterSelect.playerOneChar = null;
if(MainMenu.musicOn)
MainMenu.music.play();
}
}

else if(StateManager.gameState == GameState.MAPSELECT)
{
if(MapSelect.mapName == null)
{
if(mx>75 && mx<368 && my>100 && my<399)
{
MapSelect.mapName = "Freefall";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
MapSelect.mapName = "Hellfire";
}
}
else
{
if(mx>75 && mx<368 && my>100 && my<399)
{
MapSelect.mapName = "Freefall";
}
else if(mx>520 && mx<815 && my>100 && my<399)
{
MapSelect.mapName = "Hellfire";
}
if(mx>380 && mx <510 && my>400 && my<435)
{
MainMenu.music.stop();
MainMenu.music.close();
StateManager.mapSelect = null;
StateManager.game = null;
StateManager.game2 = null;
if(MapSelect.mapName.equals("Freefall"))
StateManager.gameState = GameState.GAME;
else if (MapSelect.mapName.equals("Hellfire"))
StateManager.gameState = GameState.GAME2;
StateManager.characterSelect = null;
StateManager.mapSelect = null;
MapSelect.mapName = null;
}
}
if(mx>830 && mx<890 && my>400 && my<435)
{
StateManager.characterSelect = null;
CharacterSelect.playerTwoChar = null;
CharacterSelect.playerOneChar = null;
StateManager.gameState = GameState.CHARACTERSELECT;
MapSelect.mapName = null;
}
}


}

@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub

}

}

This file was deleted.

This file was deleted.

This file was deleted.

@@ -0,0 +1,52 @@
package data;

import java.awt.Graphics;
import java.awt.Image;


import javax.swing.ImageIcon;

public class MainMenu {

public static final int WIDTH = 900, HEIGHT = 450; //Default
public static boolean musicOn;
public static boolean sfxOn;

private Image menuBG;
public static AudioPlayer music;
public static AudioPlayer sfx1;
public static AudioPlayer sfx2;
private UI menuUI;
private Image play, settings, exit;
public MainMenu()
{
this.menuBG = new ImageIcon(getClass().getClassLoader().getResource("res/mainmenu.png")).getImage();
this.play = new ImageIcon(getClass().getClassLoader().getResource("res/play.png")).getImage();
this.settings = new ImageIcon(getClass().getClassLoader().getResource("res/settings.png")).getImage();
this.exit = new ImageIcon(getClass().getClassLoader().getResource("res/exit.png")).getImage();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
MainMenu.sfx1 = new AudioPlayer("res/buttonEffect.wav");
MainMenu.musicOn = true;
MainMenu.sfxOn = true;
this.menuUI = new UI();
menuUI.addButton("Play", play, 650, 135, 167, 100);
menuUI.addButton("Settings", settings, 637, 240, 200, 100);
menuUI.addButton("Exit", exit, 650, 345, 167, 100);
if(MainMenu.musicOn == true)
music.play();
if(MainMenu.sfxOn == true)
sfx1.play();
}

private void updateButtons()
{

}

public void update(Graphics g)
{
g.drawImage(menuBG, 0, 0, WIDTH, HEIGHT, null);
menuUI.draw(g);
}

}
@@ -0,0 +1,69 @@
package data;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.MouseInfo;

import javax.swing.ImageIcon;

public class MainMenu {

public static final int WIDTH = 900, HEIGHT = 450; //Default
public static boolean musicOn;
public static boolean sfxOn;

private Image menuBG;
public static AudioPlayer music;
public static AudioPlayer sfx1;
public static AudioPlayer sfx2;
private UI menuUI;
private Image play, settings, exit;
public MainMenu()
{
this.menuBG = new ImageIcon(getClass().getClassLoader().getResource("res/mainmenu.png")).getImage();
this.play = new ImageIcon(getClass().getClassLoader().getResource("res/play.png")).getImage();
this.settings = new ImageIcon(getClass().getClassLoader().getResource("res/settings.png")).getImage();
this.exit = new ImageIcon(getClass().getClassLoader().getResource("res/exit.png")).getImage();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
MainMenu.sfx1 = new AudioPlayer("res/buttonEffect.wav");
MainMenu.musicOn = true;
MainMenu.sfxOn = true;
this.menuUI = new UI();
menuUI.addButton("Play", play, 650, 135, 167, 100);
menuUI.addButton("Settings", settings, 637, 240, 200, 100);
menuUI.addButton("Exit", exit, 650, 345, 167, 100);
if(MainMenu.musicOn == true)
music.play();
if(MainMenu.sfxOn == true){
int mx = (int) MouseInfo.getPointerInfo().getLocation().getX();
int my = (int) MouseInfo.getPointerInfo().getLocation().getY();
//Play
if(mx>650 && mx<(650+167) && my>135 && my<(135+100))
{
MainMenu.sfx1.play();
}
//Settings
if(mx>637 && mx<(637+200) && my>240 && my<(240+100))
{
MainMenu.sfx1.play();
}
//Exit
if(mx>650 && mx<(650+167) && my>345 && my<(345+100))
{
MainMenu.sfx1.play();
}
}
}

private void updateButtons()
{

}

public void update(Graphics g)
{
g.drawImage(menuBG, 0, 0, WIDTH, HEIGHT, null);
menuUI.draw(g);
}

}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -0,0 +1,38 @@
package data;

import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;

import data.StateManager.GameState;

public class MouseMotionInput implements MouseMotionListener{

@Override
public void mouseDragged(MouseEvent arg0) {
// TODO Auto-generated method stub

}

@Override
public void mouseMoved(MouseEvent e) {
int mx = e.getX();
int my = e.getY();
if(StateManager.gameState == GameState.MAINMENU)
{
MainMenu.sfx1.play();
System.out.print("yee");
}
//Settings
if(mx>637 && mx<(637+200) && my>240 && my<(240+100))
{
MainMenu.sfx1.play();
}
//Exit
if(mx>650 && mx<(650+167) && my>345 && my<(345+100))
{
MainMenu.sfx1.play();
}

}

}

This file was deleted.

This file was deleted.

@@ -0,0 +1,52 @@
package data;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.MouseEvent;

import javax.swing.ImageIcon;

public class MainMenu {

public static final int WIDTH = 900, HEIGHT = 450; //Default
public static boolean musicOn;
public static boolean sfxOn;

private Image menuBG;
public static AudioPlayer music;
public static AudioPlayer sfx1;
public static AudioPlayer sfx2;
private UI menuUI;
private Image play, settings, exit;
public MainMenu()
{
this.menuBG = new ImageIcon(getClass().getClassLoader().getResource("res/mainmenu.png")).getImage();
this.play = new ImageIcon(getClass().getClassLoader().getResource("res/play.png")).getImage();
this.settings = new ImageIcon(getClass().getClassLoader().getResource("res/settings.png")).getImage();
this.exit = new ImageIcon(getClass().getClassLoader().getResource("res/exit.png")).getImage();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
MainMenu.sfx1 = new AudioPlayer("res/buttonEffect.wav");
MainMenu.musicOn = true;
MainMenu.sfxOn = true;
this.menuUI = new UI();
menuUI.addButton("Play", play, 650, 135, 167, 100);
menuUI.addButton("Settings", settings, 637, 240, 200, 100);
menuUI.addButton("Exit", exit, 650, 345, 167, 100);
if(MainMenu.musicOn == true)
music.play();
//if(MainMenu.sfxOn == true)
//MouseInput.nice(MouseEvent e);
}

private void updateButtons()
{

}

public void update(Graphics g)
{
g.drawImage(menuBG, 0, 0, WIDTH, HEIGHT, null);
menuUI.draw(g);
}

}

This file was deleted.

@@ -0,0 +1,52 @@
package data;

import java.awt.Graphics;
import java.awt.Image;


import javax.swing.ImageIcon;

public class MainMenu {

public static final int WIDTH = 900, HEIGHT = 450; //Default
public static boolean musicOn;
public static boolean sfxOn;

private Image menuBG;
public static AudioPlayer music;
public static AudioPlayer sfx1;
public static AudioPlayer sfx2;
private UI menuUI;
private Image play, settings, exit;
public MainMenu()
{
this.menuBG = new ImageIcon(getClass().getClassLoader().getResource("res/mainmenu.png")).getImage();
this.play = new ImageIcon(getClass().getClassLoader().getResource("res/play.png")).getImage();
this.settings = new ImageIcon(getClass().getClassLoader().getResource("res/settings.png")).getImage();
this.exit = new ImageIcon(getClass().getClassLoader().getResource("res/exit.png")).getImage();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
MainMenu.sfx1 = new AudioPlayer("res/buttonEffect.wav");
MainMenu.musicOn = true;
MainMenu.sfxOn = true;
this.menuUI = new UI();
menuUI.addButton("Play", play, 650, 135, 167, 100);
menuUI.addButton("Settings", settings, 637, 240, 200, 100);
menuUI.addButton("Exit", exit, 650, 345, 167, 100);
if(MainMenu.musicOn == true)
music.play();
if(MainMenu.sfxOn == true)
return;
}

private void updateButtons()
{

}

public void update(Graphics g)
{
g.drawImage(menuBG, 0, 0, WIDTH, HEIGHT, null);
menuUI.draw(g);
}

}
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5,4 +5,9 @@
<item value="347" key="DIALOG_HEIGHT"/>
<item value="1|Tahoma|8.25|0|WINDOWS|1|-11|0|0|0|400|0|0|0|1|0|0|0|0|Tahoma" key="DIALOG_FONT_NAME"/>
</section>
<section name="org.eclipse.debug.ui.SELECT_LAUNCH_SHORTCUT_DIALOG">
<item value="223" key="DIALOG_WIDTH"/>
<item value="408" key="DIALOG_HEIGHT"/>
<item value="1|Tahoma|8.25|0|WINDOWS|1|-11|0|0|0|400|0|0|0|1|0|0|0|0|Tahoma" key="DIALOG_FONT_NAME"/>
</section>
</section>

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
@@ -1,16 +1,17 @@
INDEX VERSION 1.127+H:\11th Grade\Computer Systems Research\workspace\.metadata\.plugins\org.eclipse.jdt.core
1697886153.index
1818563445.index
4155206848.index
3626448167.index
163172794.index
1498219845.index
1115467115.index
3133528496.index
305854171.index
4108727661.index
3065916431.index
4041092966.index
3974580528.index
4155206848.index
1995173708.index
30765161.index
4173023868.index
1995173708.index
305854171.index
3974580528.index
3133528496.index
1498219845.index
3065916431.index
4108727661.index
1697886153.index
1818563445.index
1115467115.index
@@ -20,9 +20,11 @@
<fullyQualifiedTypeName name="java.util.concurrent.TimeUnit"/>
<fullyQualifiedTypeName name="java.util.ArrayList"/>
<fullyQualifiedTypeName name="java.awt.Image"/>
<fullyQualifiedTypeName name="java.awt.MouseInfo"/>
<fullyQualifiedTypeName name="java.awt.Point"/>
<fullyQualifiedTypeName name="java.awt.event.MouseListener"/>
<fullyQualifiedTypeName name="data.StateManager.GameState"/>
<fullyQualifiedTypeName name="java.awt.Graphics"/>
<fullyQualifiedTypeName name="java.awt.event.MouseEvent"/>
<fullyQualifiedTypeName name="java.awt.event.MouseMotionListener"/>
<fullyQualifiedTypeName name="java.awt.MouseInfo"/>
</qualifiedTypeNameHistroy>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

@@ -3,18 +3,22 @@
<section name="org.eclipse.ui.texteditor.FindReplaceDialog_dialogBounds">
<item value="237" key="DIALOG_WIDTH"/>
<item value="378" key="DIALOG_Y_ORIGIN"/>
<item value="792" key="DIALOG_X_ORIGIN"/>
<item value="357" key="DIALOG_HEIGHT"/>
<item value="792" key="DIALOG_X_ORIGIN"/>
<item value="1|Tahoma|8.25|0|WINDOWS|1|-11|0|0|0|400|0|0|0|1|0|0|0|0|Tahoma" key="DIALOG_FONT_NAME"/>
</section>
<section name="org.eclipse.ui.texteditor.FindReplaceDialog">
<item value="true" key="wrap"/>
<item value="false" key="casesensitive"/>
<item value="false" key="isRegEx"/>
<item value="false" key="casesensitive"/>
<item value="false" key="incremental"/>
<item value="false" key="wholeword"/>
<item value="m" key="selection"/>
<item value="" key="selection"/>
<list key="findhistory">
<item value="addmouse"/>
<item value="addMouse"/>
<item value="sfx1"/>
<item value="MainMenu.sfx1"/>
<item value="m"/>
<item value="setTile"/>
<item value="buffer"/>
@@ -1,3 +1,3 @@
#Mon May 23 08:12:51 EDT 2016
#Fri Jun 03 13:29:10 EDT 2016
org.eclipse.core.runtime=2
org.eclipse.platform=4.5.2.v20160128-1800
BIN +124 Bytes (100%) SuperSmashMaps/bin/data/Boot.class
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.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -29,6 +29,7 @@ public synchronized void start(){
return;
running = true;
this.addMouseListener(new MouseInput());
this.addMouseMotionListener(new MouseMotionInput());
thread = new Thread(this); //Uses call in Window constructor to start thread
thread.start();
}
@@ -2,7 +2,7 @@

import java.awt.Graphics;
import java.awt.Image;

import java.awt.MouseInfo;

import javax.swing.ImageIcon;

@@ -14,16 +14,18 @@ public class MainMenu {

private Image menuBG;
public static AudioPlayer music;
public static AudioPlayer sfx1;
public static AudioPlayer sfx2;
private UI menuUI;
private Image play, settings, exit;

public MainMenu()
{
this.menuBG = new ImageIcon(getClass().getClassLoader().getResource("res/mainmenu.png")).getImage();
this.play = new ImageIcon(getClass().getClassLoader().getResource("res/play.png")).getImage();
this.settings = new ImageIcon(getClass().getClassLoader().getResource("res/settings.png")).getImage();
this.exit = new ImageIcon(getClass().getClassLoader().getResource("res/exit.png")).getImage();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
MainMenu.sfx1 = new AudioPlayer("res/buttonEffect.wav");
MainMenu.musicOn = true;
MainMenu.sfxOn = true;
this.menuUI = new UI();
@@ -32,7 +34,9 @@ public MainMenu()
menuUI.addButton("Exit", exit, 650, 345, 167, 100);
if(MainMenu.musicOn == true)
music.play();
//if(MainMenu.sfxOn == true)
if(MainMenu.sfxOn == true){

}
}

private void updateButtons()
@@ -2,7 +2,6 @@

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import data.StateManager.GameState;

public class MouseInput implements MouseListener{
@@ -15,7 +14,7 @@ public void mouseClicked(MouseEvent e) {

@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub


}

@@ -35,13 +34,17 @@ public void mousePressed(MouseEvent e) {
//Play
if(mx>650 && mx<(650+167) && my>135 && my<(135+100))
{
if(MainMenu.sfxOn)
MainMenu.sfx1.play();
StateManager.game = null;
StateManager.characterSelect = null;
StateManager.gameState = GameState.CHARACTERSELECT;
}
//Settings
if(mx>637 && mx<(637+200) && my>240 && my<(240+100))
{
if(MainMenu.sfxOn)
MainMenu.sfx1.play();
MainMenu.music.stop();
MainMenu.music.close();
StateManager.settings = null;
@@ -50,6 +53,8 @@ public void mousePressed(MouseEvent e) {
//Exit
if(mx>650 && mx<(650+167) && my>345 && my<(345+100))
{
if(MainMenu.sfxOn)
MainMenu.sfx1.play();
StateManager.gameState = GameState.EXIT;
}
}
@@ -84,6 +89,8 @@ else if(StateManager.gameState == GameState.SETTINGS)
//Back
if(mx>820 && mx<880 && my>15 && my<50)
{
if(MainMenu.sfxOn)
MainMenu.sfx1.play();
MainMenu.music.stop();
MainMenu.music.close();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
@@ -121,13 +128,17 @@ else if(mx>520 && mx<815 && my>100 && my<399)
{
if(mx>380 && mx <510 && my>400 && my<435)
{
if(MainMenu.sfxOn)
MainMenu.sfx1.play();
StateManager.mapSelect = null;
StateManager.gameState = GameState.MAPSELECT;
StateManager.characterSelect = null;
}
}
if(mx>830 && mx<890 && my>400 && my<435)
{
if(MainMenu.sfxOn)
MainMenu.sfx1.play();
MainMenu.music.stop();
MainMenu.music.close();
MainMenu.music = new AudioPlayer("res/sciFi.wav");
@@ -165,6 +176,8 @@ else if(mx>520 && mx<815 && my>100 && my<399)
}
if(mx>380 && mx <510 && my>400 && my<435)
{
if(MainMenu.sfxOn)
MainMenu.sfx1.play();
MainMenu.music.stop();
MainMenu.music.close();
StateManager.mapSelect = null;
@@ -181,6 +194,8 @@ else if (MapSelect.mapName.equals("Hellfire"))
}
if(mx>830 && mx<890 && my>400 && my<435)
{
if(MainMenu.sfxOn)
MainMenu.sfx1.play();
StateManager.characterSelect = null;
CharacterSelect.playerTwoChar = null;
CharacterSelect.playerOneChar = null;
@@ -0,0 +1,21 @@
package data;

import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;

import data.StateManager.GameState;

public class MouseMotionInput implements MouseMotionListener{

@Override
public void mouseDragged(MouseEvent arg0) {

}

@Override
public void mouseMoved(MouseEvent e) {


}

}
@@ -4,7 +4,7 @@ public enum TileType {

Primary("res/primaryTile.png", true), Secondary("res/secondaryTile.png", false), Background("res/bg.gif", true),
Transparent("res/transparent.png", true), Impassable("res/transparent.png", false), Ship("res/spaceship.png", false), MapTex1("res/map 1.png", true),
Background2("res/map2BG.png", true), MapTex2("res/map2tex.png", false), Fire("res/flametest.gif", true);
Background2("res/map2BG.png", true), MapTex2("res/map2tex.png", false), Fire("res/flametest.gif", true), PBJT("res/pbjt.gif", true);

String textureName;
boolean passable;
@@ -7,7 +7,7 @@ public class World {
private TileGrid grid;
private Tile bg;
private Tile mapTex;
private AudioPlayer gameMusic;
public static AudioPlayer gameMusic;

public static final int WIDTH = 900, HEIGHT = 450; //Default

@@ -16,7 +16,7 @@ public World(TileGrid g)
grid = g;
bg = new Tile(-10, -10, WIDTH+20, HEIGHT+20, TileType.Background);
mapTex = new Tile(-10, -10, WIDTH+20, HEIGHT+20, TileType.MapTex1);
gameMusic = new AudioPlayer("res/gameMusic.wav");
World.gameMusic = new AudioPlayer("res/gameMusic.wav");
if(MainMenu.musicOn == true)
gameMusic.play();
}
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.