diff --git a/Plants VS Zombies/ConeHeadZombie.java b/Plants VS Zombies/ConeHeadZombie.java new file mode 100644 index 0000000..9b9d8b2 --- /dev/null +++ b/Plants VS Zombies/ConeHeadZombie.java @@ -0,0 +1,44 @@ +package ProjectFinal; + +import javafx.animation.Animation; +import javafx.animation.KeyFrame; +import javafx.animation.Timeline; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.util.Duration; + +import java.io.InputStream; +import java.util.concurrent.atomic.AtomicInteger; + +public class ConeHeadZombie { + + public static int coneHeadZombieHealth = 30; + + String zombieGif = "myPicture/gif/ZombieGif.gif"; + + private int zombieImageChang (ImageView myImageView, int yZombieBlock, int currentZombie, int result) { + if (GameData.zombieHealth[yZombieBlock].get (currentZombie) <= 10 && result == 1) { + result = 0; + InputStream input = getClass().getResourceAsStream(zombieGif); + Image image = new Image(input); + myImageView.setImage (image); + myImageView.setFitHeight (120); + myImageView.setFitWidth (80); + } + return result; + } + + private void zombieImageChanger (ImageView myImageView, int yZombieBlock, int currentZombie) { + AtomicInteger result = new AtomicInteger(); + result.set (1); + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(10), + (event) -> result.set(zombieImageChang (myImageView, yZombieBlock, currentZombie, result.get())))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + } + + public void playConeHeadZombie (ImageView myImageView, int yZombieBlock, int currentZombie) { + zombieImageChanger (myImageView, yZombieBlock, currentZombie); + } + +} diff --git a/Plants VS Zombies/FileAndTools.java b/Plants VS Zombies/FileAndTools.java new file mode 100644 index 0000000..7a5f8ae --- /dev/null +++ b/Plants VS Zombies/FileAndTools.java @@ -0,0 +1,426 @@ +package ProjectFinal; + +import javafx.animation.Animation; +import javafx.animation.KeyFrame; +import javafx.animation.Timeline; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.scene.control.Label; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.scene.layout.StackPane; +import javafx.scene.paint.Color; +import javafx.stage.Stage; +import javafx.stage.StageStyle; +import javafx.util.Duration; +import javax.sound.sampled.*; +import java.io.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Scanner; + +public class FileAndTools { + + public synchronized void audioPlayer (String fileName) { + new Thread(new Runnable() { + public void run() { + try { + File myFile = new File(fileName); + AudioInputStream myAudio = AudioSystem.getAudioInputStream(myFile); + Clip myClip = AudioSystem.getClip(); + myClip.open(myAudio); + myClip.start(); + } catch (IOException | UnsupportedAudioFileException | LineUnavailableException error) { + error.printStackTrace(); + } + } + }).start(); + } + + public void createGameOverPage (String fileName, String score, String gameScoreFileName, String logInFileName) throws IOException { + Stage primaryStage = new Stage(); + primaryStage.initStyle (StageStyle.TRANSPARENT); + FXMLLoader loader = new FXMLLoader(getClass().getResource(fileName)); + Parent root = loader.load (); + GameOverController myController = loader.getController(); + myController.setGameScoreLabel (score); + myController.setGameHighScoreLabel (getBestScoreOfUser(gameScoreFileName, gettingLastUser(logInFileName))); + Scene myScene = new Scene (root); + myScene.setFill (Color.TRANSPARENT); + primaryStage.setScene (myScene); + myScene.getWindow().centerOnScreen(); + primaryStage.show(); + } + + public void createMenuPage (Label myLabel, String fileName, String userName) throws IOException { + Stage primaryStage = (Stage) myLabel.getScene().getWindow(); + FXMLLoader loader = new FXMLLoader(getClass().getResource(fileName)); + Parent root = loader.load (); + MenuBarController myController = loader.getController(); + myController.setUserNameLabel (userName); + Scene myScene = new Scene (root); + myScene.setFill (Color.TRANSPARENT); + primaryStage.setScene (myScene); + primaryStage.show(); + } + + public void createRecordingPage (Label myLabel, String fileName, String signINFileName, String gameScoreFileName) throws IOException { + Stage primaryStage = (Stage) myLabel.getScene().getWindow(); + FXMLLoader loader = new FXMLLoader(getClass().getResource(fileName)); + Parent root = loader.load (); + RecordingPageController myController = loader.getController(); + List myList = new ArrayList<>(); + getFinalScoreList (myList, signINFileName, gameScoreFileName); + myController.setList (myList); + Scene myScene = new Scene (root); + myScene.setFill (Color.TRANSPARENT); + primaryStage.setScene (myScene); + primaryStage.show(); + } + + public void createPage (Label myLabel, String fileName) throws IOException { + Stage primaryStage = (Stage) myLabel.getScene().getWindow(); + Parent root = FXMLLoader.load(getClass().getResource(fileName)); + Scene myScene = new Scene (root); + myScene.setFill (Color.TRANSPARENT); + primaryStage.setScene (myScene); + primaryStage.show(); + } + + public void createGamePage (Label myLabel, String CSSFileName, StackPane root) { + root.setId("pane"); + Stage primaryStage = (Stage) myLabel.getScene().getWindow(); + Scene myScene = new Scene (root,1024,670); + myScene.getStylesheets().addAll(this.getClass().getResource(CSSFileName).toExternalForm()); + primaryStage.setTitle ("Exercise 2"); + primaryStage.setScene (myScene); + myScene.getWindow().centerOnScreen(); + primaryStage.show (); + } + + private void checkEmptyTextField (String userName, String password, Label error_user_name_label, Label error_password_label + , String notificationAudio) { + if (userName.length() == 0) { + error_user_name_label.setText ("User Name text field is empty !"); + } + if (password.length() == 0) { + error_password_label.setText ("Password text field is empty !"); + } + if (userName.length() == 0 || password.length() == 0) { + audioPlayer (notificationAudio); + } + } + + private void writeFirstUser (String fileName) { + try { + File myFile = new File(fileName); + FileOutputStream myStream = new FileOutputStream(myFile); + OutputStreamWriter myWriter = new OutputStreamWriter(myStream); + + myWriter.write("Ahmad" + "\n"); + myWriter.write("Asadi" + "\n"); + + myWriter.close(); + myStream.close(); + } + catch (IOException error) { + error.printStackTrace(); + } + } + + private int checkUserName (String fileName, String userName) { + int result = -1; + int counter = 0; + try { + File myFile = new File(fileName); + Scanner myScanner = new Scanner(myFile); + while (myScanner.hasNextLine ()) { + counter++; + String data = myScanner.nextLine (); + if (data.compareTo (userName) == 0 && counter % 2 == 1) { + result = 1; // userName exist + break; + } + else { + result = 0; // userName not exist + } + } + myScanner.close(); + } + catch (IOException error) { + error.printStackTrace(); + } + return result; + } + + private void writeUserData (String fileName, List list1) { + try { + FileWriter myWriter = new FileWriter (fileName, true); + BufferedWriter myBuffer = new BufferedWriter (myWriter); + for (String str: list1) { + myBuffer.write (str + System.lineSeparator()); + } + myBuffer.close(); + myWriter.close(); + } + catch (IOException error) { + error.printStackTrace(); + } + } + + public void getUserData (String fileName, String userName, String field) { + List data = new ArrayList<>(); + data.add (userName); + data.add (field); + writeUserData (fileName, data); + } + + private void createFile (String fileName) throws IOException { + File myFile = new File (fileName); + boolean fileCreated = true; + if (!myFile.exists ()) { + fileCreated = myFile.createNewFile (); + writeFirstUser (fileName); + } + if (!fileCreated) { + throw new IOException("Unable to create file at specified path. It already exists"); + } + } + + public void signIn (String fileName, String gameScoreFileName, String userName, String password, Label error_user_name_label, Label error_password_label + , String notificationAudio, String accessAudio) throws IOException { + error_user_name_label.setText (""); + error_password_label.setText (""); + createFile(fileName); + checkEmptyTextField (userName, password, error_user_name_label, error_password_label, notificationAudio); + if (userName.length() != 0 && password.length() != 0) { + if (checkUserName (fileName, userName) == 0) { + getUserData (fileName, userName, password); + audioPlayer (accessAudio); + getUserData (gameScoreFileName, userName, String.valueOf(0)); + } + else { + error_user_name_label.setText ("User Name is already exist !"); + audioPlayer (notificationAudio); + } + } + } + + private int checkUserNameAndPassword (String fileName, String userName, String Password) { + int result = -1, result1 = -1, counter = 0, numLine = 0; + try { + File myFile = new File(fileName); + Scanner myScanner = new Scanner(myFile); + while (myScanner.hasNextLine ()) { + counter++; + String data = myScanner.nextLine (); + if (data.compareTo (userName) == 0 && counter % 2 == 1) { + result1 = 0; + result = 0; // userName exist + numLine = counter + 1; + } + else if (result == 0 && numLine == counter && data.compareTo (Password) == 0) { + result = 1; // userName and password exist + break; + } + else { + result = 2; // userName not exist + } + } + myScanner.close(); + if (result1 == 0 && result != 1) { + result = 0; + } + } + catch (IOException error) { + error.printStackTrace(); + } + return result; + } + + private void settingLastUser (String fileName, String userName) throws IOException { + File myFile = new File (fileName); + boolean fileCreated = true; + if (!myFile.exists ()) { + fileCreated = myFile.createNewFile (); + } + if (!fileCreated) { + throw new IOException("Unable to create file at specified path. It already exists"); + } + try { + FileWriter myWriter = new FileWriter (myFile); + myWriter.write (userName); + myWriter.close(); + } + catch (IOException error) { + error.printStackTrace(); + } + } + + public String gettingLastUser (String fileName) { + String result = "null"; + try { + File myFile = new File(fileName); + Scanner myScanner = new Scanner(myFile); + while (myScanner.hasNextLine()) { + result = myScanner.nextLine(); + } + myScanner.close(); + } + catch (IOException error) { + error.printStackTrace(); + } + return result; + } + + public void logIn (String fileName, String logInFileName, String fXMLFileName, String userName, String password, Label error_user_name_label, Label error_password_label + , String notificationAudio, String accessAudio) throws IOException { + error_user_name_label.setText (""); + error_password_label.setText (""); + checkEmptyTextField (userName, password, error_user_name_label, error_password_label, notificationAudio); + int result = checkUserNameAndPassword (fileName, userName, password); + if (userName.length() != 0 && password.length() != 0) { + if (result == 0) { + error_user_name_label.setText ("User Name exist"); + error_password_label.setText ("Wrong Password !"); + audioPlayer (notificationAudio); + } + else if (result == 2) { + error_user_name_label.setText ("User Name not exist !"); + audioPlayer (notificationAudio); + } + else { + audioPlayer (accessAudio); + createMenuPage (error_user_name_label, fXMLFileName, userName); + settingLastUser (logInFileName, userName); + } + } + } + + public void setImageView (ImageView myImageView, String fileName, int FitHeight, int FitWidth, int translateX, int translateY, boolean isItMove) { + InputStream input = getClass().getResourceAsStream(fileName); + Image image = new Image(input); + myImageView.setImage (image); + myImageView.setFitHeight(FitHeight); + myImageView.setFitWidth (FitWidth); + if (isItMove) { + myImageView.setTranslateX (translateX); + myImageView.setTranslateY (translateY); + } + } + + private void plantThreadDelete (Timeline timeline, int xPlantBlock, int yPlantBlock) { + if (GameData.plant[yPlantBlock][xPlantBlock] == 0) { + timeline.stop(); + } + } + + public void plantThreadDeleter (Timeline plantTimeline, int xPlantBlock, int yPlantBlock) { + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(10), + (event) -> plantThreadDelete (plantTimeline, xPlantBlock, yPlantBlock))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + } + + private String getBestScoreOfUser (String fileName, String userName) { + int counter = 0, highScore = 0, count = 0; + try { + File myFile = new File(fileName); + Scanner myScanner = new Scanner(myFile); + while (myScanner.hasNextLine ()) { + counter++; + String data = myScanner.nextLine (); + if (data.equals(userName)) { + count = counter + 1; + } + if (count == counter && Integer.parseInt(data) > highScore) { + highScore = Integer.parseInt(data); + } + } + myScanner.close(); + } + catch (IOException error) { + error.printStackTrace(); + } + return String.valueOf(highScore); + } + + private void setBestUsersScoreList (List myList, String signInFileName, String gameScoreFileName) { + int counter = 0; + try { + File myFile = new File(signInFileName); + Scanner myScanner = new Scanner(myFile); + while (myScanner.hasNextLine ()) { + counter++; + String data = myScanner.nextLine (); + if ((counter % 2) == 1) { + myList.add (getBestScoreOfUser (gameScoreFileName, data)); + myList.add (data); + } + } + myScanner.close(); + } + catch (IOException error) { + error.printStackTrace(); + } + } + + private int foundHighScoreFromList (List myList) { + int highScore = 0; + for (int counter = 0; counter < myList.size(); counter += 2) { + if (highScore < Integer.parseInt(myList.get(counter))) { + highScore = Integer.parseInt(myList.get(counter)); + } + } + return highScore; + } + + private int whichRowHaveHighScore (List myList, int highScore) { + int result = 0; + for (int counter = 0; counter < myList.size(); counter += 2) { + if (Integer.parseInt(myList.get(counter)) == highScore) { + result = counter; + } + } + return result; + } + + public void getBestScoreList (List bestList, String signInFileName, String gameScoreFileName) { + List myList = new ArrayList<>(); + setBestUsersScoreList (myList, signInFileName, gameScoreFileName); + int row; + int size = myList.size(); + for (int counter = 0; counter < size; counter += 2) { + row = whichRowHaveHighScore (myList, foundHighScoreFromList(myList)); + bestList.add (myList.get(row)); + bestList.add (myList.get(row + 1)); + myList.remove (row); + myList.remove (row); + } + } + + public void getWorstScoreList (List badList, String signInFileName, String gameScoreFileName) { + List bestList = new ArrayList<>(); + getBestScoreList (bestList, signInFileName, gameScoreFileName); + int size = bestList.size(); + for (int counter = size - 1; counter >= 0; counter--) { + badList.add (bestList.get(counter)); + } + } + + public void getFinalScoreList (List finalList, String signInFileName, String gameScoreFileName) { + List badList = new ArrayList<>(); + getWorstScoreList (badList, signInFileName, gameScoreFileName); + String result; + int size = badList.size(); + for (int counter = 0; counter < size; counter += 2) { + result = badList.get(counter); + result = result + " : " + badList.get(counter + 1); + finalList.add (result); + } + } + + + +} diff --git a/Plants VS Zombies/GameData.java b/Plants VS Zombies/GameData.java new file mode 100644 index 0000000..9385870 --- /dev/null +++ b/Plants VS Zombies/GameData.java @@ -0,0 +1,170 @@ +package ProjectFinal; + +import javafx.animation.Animation; +import javafx.animation.KeyFrame; +import javafx.animation.Timeline; +import javafx.scene.control.Label; +import javafx.scene.image.ImageView; +import javafx.scene.paint.Color; +import javafx.scene.text.Font; +import javafx.stage.Stage; +import javafx.util.Duration; +import java.io.IOException; +import java.util.ArrayList; +import java.util.concurrent.atomic.AtomicInteger; + +public class GameData { + + public static int[][] plant = new int[6][10]; + public static int[][] plantHealth = new int [6][10]; + + public static ArrayList[] zombies = new ArrayList[6]; + public static ArrayList[] zombieHealth = new ArrayList[6]; + public static ArrayList[] pea = new ArrayList[6]; + + public static int[] zombieNumber = new int[6]; + public static int[] peaNumber = new int[6]; + public static int[] lawnMover = new int[6]; + + public static int score = 0; + + String coinImage = "myPicture/Coin.png"; + String gameOverFXMLFileName = "myFXMLFile/Game_over.fxml"; + String gameScoreFileName = "src/ProjectFinal/myFile/GameScore.txt"; + String logInFileName = "src/ProjectFinal/myFile/LogIn.txt"; + + Label scoreLabel = new Label(); + + LawnMover lawnMoverObject = new LawnMover(); + FileAndTools myTool = new FileAndTools (); + + private int gameOver (int result) { + if (lawnMoverObject.isAllLawnMowerDead() && result != 1) { + result = 1; + myTool.getUserData (gameScoreFileName, myTool.gettingLastUser(logInFileName), String.valueOf(GameData.score)); + try { + myTool.createGameOverPage(gameOverFXMLFileName, String.valueOf(GameData.score), gameScoreFileName, logInFileName); + } catch (IOException e) { + e.printStackTrace(); + } + Stage stage = (Stage) scoreLabel.getScene().getWindow(); + stage.close(); + } + return result; + } + + public void gameOverTimeline () { + AtomicInteger result = new AtomicInteger(); + result.set(0); + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(10), + (event) -> result.set(gameOver (result.get())))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + } + + private void initializerArrayAndArrayList (ArrayList[] myArrayList, int[] myArrays, int fillingWith) { + for (int counter = 0; counter < 6; counter++) { + myArrays[counter] = fillingWith; + myArrayList[counter] = new ArrayList<>(); + } + } + + private void lawnMoverInitializer () { + int lawnMoverCount = 0; + lawnMoverCount = Plant.sizeYForDifficulty (); + for (int counter = 0; counter < lawnMoverCount; counter++) { + lawnMover[counter] = 1; + } + } + + public void initializer () { + initializerArrayAndArrayList (zombies, zombieNumber, 0); + initializerArrayAndArrayList (pea, peaNumber, 0); + initializerArrayAndArrayList (zombieHealth, lawnMover, -1); + lawnMoverInitializer(); + } + + public static int isPlatformFree () { + for (int row = 0; row < 6; row++) { + for (int column = 0; column < 10; column++) { + if (plant[row][column] == 0) { + return 1; + } + } + } + return 0; + } + + public static void squareFill (int fillingWhat[][], int maxRows, int maxColumn, int fillingWith) { + for (int row = 0; row < maxRows; row++) { + for (int column = 0; column < maxColumn; column++) { + fillingWhat[row][column] = fillingWith; + } + } + } + + public static void fillPlatformForEasyGame () { + squareFill (plant, 6,10, 0); + squareFill (plantHealth, 6,10, 0); + } + + public static void fillPlatformForMediumGame () { + squareFill (plant, 6,10, -1); + squareFill (plant, 5,9, 0); + squareFill (plantHealth, 6,10, -1); + squareFill (plantHealth, 5,9, 0); + } + + public static void fillPlatformForExtremeGame () { + squareFill (plant, 6,10, -1); + squareFill (plant, 4,8, 0); + squareFill (plantHealth, 6,10, -1); + squareFill (plantHealth, 4,8, 0); + } + + private void updatePlantAlive () { + for (int row = 0; row < 6; row++) { + for (int column = 0; column < 10; column++) { + if (plant[row][column] != 0 && plantHealth[row][column] == 0) { + plant[row][column] = 0; + } + } + } + } + + public void plantAliveUpdater () { + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(10), + (event) -> updatePlantAlive())); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + } + + private void updateScore (Label scoreLabel) { + scoreLabel.setText(String.valueOf(score)); + } + + private void scoreUpdater (Label scoreLabel) { + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(10), + (event) -> updateScore (scoreLabel))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + } + + private void setScoreLabel (Label scoreLabel) { + GamePlay.root.getChildren().addAll (scoreLabel); + scoreLabel.setTranslateX (400); + scoreLabel.setTranslateY (-275); + scoreLabel.setFont (new Font("Arial", 22)); + } + + public void addScore () { + Sun sun = new Sun (); + FileAndTools myTool = new FileAndTools (); + sun.addSunRectangle (400, -275, Color.GOLD); + ImageView myImageView = new ImageView (); + myTool.setImageView (myImageView, coinImage, 50, 50, 460, -275, true); + GamePlay.root.getChildren().add (myImageView); + setScoreLabel (scoreLabel); + scoreUpdater (scoreLabel); + } +} diff --git a/Plants VS Zombies/GameOverController.java b/Plants VS Zombies/GameOverController.java new file mode 100644 index 0000000..a8a9197 --- /dev/null +++ b/Plants VS Zombies/GameOverController.java @@ -0,0 +1,30 @@ +package ProjectFinal; + +import javafx.scene.control.Button; +import javafx.scene.control.Label; + +import java.io.IOException; + +public class GameOverController { + + String menuBarFXMLFileName = "myFXMLFile/Menu_bar.fxml"; + String logInFileName = "src/ProjectFinal/myFile/LogIn.txt"; + + public Button back_to_main_menu_button; + public Label your_score_label; + public Label your_high_score_label; + + FileAndTools myTool = new FileAndTools (); + + public void onClickBackToMainMenuButton () throws IOException { + myTool.createMenuPage (your_score_label, menuBarFXMLFileName, myTool.gettingLastUser(logInFileName)); + } + + public void setGameScoreLabel (String text) { + your_score_label.setText (text); + } + + public void setGameHighScoreLabel (String text) { + your_high_score_label.setText (text); + } +} diff --git a/Plants VS Zombies/GamePlay.java b/Plants VS Zombies/GamePlay.java new file mode 100644 index 0000000..b765562 --- /dev/null +++ b/Plants VS Zombies/GamePlay.java @@ -0,0 +1,55 @@ +package ProjectFinal; + +import javafx.scene.layout.StackPane; + +public class GamePlay { + + Sun sun = new Sun (); + Zombie zombie = new Zombie (); + GameData data = new GameData (); + LawnMover lawnMover = new LawnMover (); + final public static StackPane root = new StackPane(); + public static int gameDifficulty = 0; + public static boolean isItDay; + + private void switchDifficulty (int difficulty) { + switch (difficulty) { + case 1: + GameData.fillPlatformForEasyGame(); + break; + case 2: + GameData.fillPlatformForMediumGame(); + break; + case 3: + GameData.fillPlatformForExtremeGame(); + break; + } + } + + public static int sunDurationTime (boolean isDay) { + int sunDuration; + if (isDay) { + sunDuration = 10; + } + else { + sunDuration = 20; + } + return sunDuration; + } + + public void startGame (StackPane root, int difficulty, boolean isDay) { + gameDifficulty = difficulty; + isItDay = isDay; + data.plantAliveUpdater(); + data.initializer(); + sun.addSun (root, difficulty, false,0 ,0, sunDurationTime (isDay)); + sun.setSunLabelPicture(); + sun.setSunLabel (root); + root.getChildren().addAll (Plant.imageView); + data.addScore(); + lawnMover.lawnMowerSwitch(); + zombie.zombieAdder(); + data.gameOverTimeline(); + switchDifficulty (difficulty); + } +} diff --git a/Plants VS Zombies/JackInTheBoxZombie.java b/Plants VS Zombies/JackInTheBoxZombie.java new file mode 100644 index 0000000..6128a10 --- /dev/null +++ b/Plants VS Zombies/JackInTheBoxZombie.java @@ -0,0 +1,47 @@ +package ProjectFinal; + +import javafx.animation.Animation; +import javafx.animation.KeyFrame; +import javafx.animation.Timeline; +import javafx.scene.image.ImageView; +import javafx.util.Duration; + +import java.util.concurrent.atomic.AtomicInteger; + +public class JackInTheBoxZombie { + + public static int jackInTheBoxZombieHealth = 7; + + String bombAudio = "src/ProjectFinal/myAudio/bomb.wav"; + + PotatoMine potatoMine = new PotatoMine (); + FileAndTools myTool = new FileAndTools (); + + private int zombieBombCheck (ImageView myImageView, int yZombieBlock, int currentZombie, int result) { + int zombieXRowBlock = Plant.getWhereIsPlantXBlock (myImageView.getTranslateX (), -250); + int zombieHealth = GameData.zombieHealth[yZombieBlock].get (currentZombie); + if (zombieXRowBlock >= 0) { + if (zombieHealth > 0 && GameData.plant[yZombieBlock][zombieXRowBlock] != 0 && result == 1) { + result = 0; + myTool.audioPlayer (bombAudio); + potatoMine.deleteSquareOfPlants (zombieXRowBlock, yZombieBlock); + potatoMine.deleteSquareOfZombies (zombieXRowBlock, yZombieBlock); + } + } + + return result; + } + + private void zombieBombChecker (ImageView myImageView, int yZombieBlock, int currentZombie) { + AtomicInteger result = new AtomicInteger(); + result.set (1); + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(10), + (event) -> result.set(zombieBombCheck (myImageView, yZombieBlock, currentZombie, result.get())))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + } + + public void playJackInTheBoxZombie (ImageView myImageView, int yZombieBlock, int currentZombie) { + zombieBombChecker (myImageView, yZombieBlock, currentZombie); + } +} diff --git a/Plants VS Zombies/LawnMover.java b/Plants VS Zombies/LawnMover.java new file mode 100644 index 0000000..a0799ac --- /dev/null +++ b/Plants VS Zombies/LawnMover.java @@ -0,0 +1,116 @@ +package ProjectFinal; + +import javafx.animation.Animation; +import javafx.animation.KeyFrame; +import javafx.animation.Timeline; +import javafx.scene.image.ImageView; +import javafx.util.Duration; + +import java.util.Random; +import java.util.concurrent.atomic.AtomicInteger; + +public class LawnMover { + + String lawnMowerImage = "myPicture/LawnMower.png"; + FileAndTools myTool = new FileAndTools (); + + public boolean isAllLawnMowerDead () { + int result; + for (int counter = 0; counter < 6; counter ++) { + result = GameData.lawnMover[counter]; + if (result == 1) { + return false; + } + } + return true; + } + + private String backStringAliveLawnMower () { + StringBuilder result = new StringBuilder(); + for (int counter = 0; counter < 6; counter++) { + if (GameData.lawnMover[counter] == 1) { + result.append(counter); + } + } + return result.toString(); + } + + public int randomRowAdvance() { + String aliveLawnMover = backStringAliveLawnMower(); + Random rand = new Random (); + return Character.getNumericValue(aliveLawnMover.charAt (rand.nextInt(aliveLawnMover.length()))); + } + + private int lawnMowerDelete (Timeline timeline, ImageView myImageView, int currentLawnMower, int result) { + if (GameData.lawnMover[currentLawnMower] == 2 && result != 0) { + GamePlay.root.getChildren().remove (myImageView); + timeline.stop(); + result = 0; + } + return result; + } + + private void lawnMowerDeleter (Timeline lawnMowerTimeline, ImageView myImageView, int currentLawnMower) { + AtomicInteger result = new AtomicInteger(); + result.set(1); + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(10), + (event) -> result.set(lawnMowerDelete (lawnMowerTimeline, myImageView, currentLawnMower, result.get())))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + } + + private void lawnMoverMove (ImageView myImageView, int currentLawnMower) { + if (myImageView.getTranslateX () > 600) { + GameData.lawnMover[currentLawnMower] = 2; + } + int zombieCount = GameData.zombies[currentLawnMower].size(); + int zombieCoordinateX; + if (GameData.lawnMover[currentLawnMower] == 0) { + myImageView.setTranslateX (myImageView.getTranslateX () + 3); + for (int counter = 0; counter < zombieCount; counter++) { + zombieCoordinateX = GameData.zombies[currentLawnMower].get(counter); + if (myImageView.getTranslateX() <= zombieCoordinateX && zombieCoordinateX <= myImageView.getTranslateX() + 20) { + GameData.zombieHealth[currentLawnMower].set(counter, 0); + } + } + } + } + + private void lawnMowerMover (ImageView myImageView, int currentLawnMower) { + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(10), + (event) -> lawnMoverMove (myImageView, currentLawnMower))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + lawnMowerDeleter (myTimeline, myImageView, currentLawnMower); + } + + private void addLawnMower (int yBlock) { + ImageView myImageView = new ImageView (); + int translateY = (yBlock * Plant.squareSizeY()) - 200; + myTool.setImageView (myImageView, lawnMowerImage, 50, 50, -300, translateY,true); + GamePlay.root.getChildren().add (myImageView); + lawnMowerMover (myImageView, yBlock); + } + + private void lawnMowerAdder (int count) { + for (int counter = 0; counter < count; counter++) { + addLawnMower(counter); + } + + } + + public void lawnMowerSwitch () { + switch (GamePlay.gameDifficulty) { + case 1: + lawnMowerAdder (6); + break; + case 2: + lawnMowerAdder (5); + break; + case 3: + lawnMowerAdder (4); + break; + } + } + +} diff --git a/Plants VS Zombies/Main.java b/Plants VS Zombies/Main.java new file mode 100644 index 0000000..cc80061 --- /dev/null +++ b/Plants VS Zombies/Main.java @@ -0,0 +1,26 @@ +package ProjectFinal; + +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.scene.paint.Color; +import javafx.stage.Stage; +import javafx.stage.StageStyle; + +public class Main extends Application { + + @Override + public void start(Stage primaryStage) throws Exception{ + Parent root = FXMLLoader.load(getClass().getResource("myFXMLFile/UI.fxml")); + primaryStage.initStyle (StageStyle.TRANSPARENT); + Scene myScene = new Scene (root); + myScene.setFill (Color.TRANSPARENT); + primaryStage.setScene (myScene); + primaryStage.show(); + } + + public static void main(String[] args) { + launch(args); + } +} diff --git a/Plants VS Zombies/MenuBarController.java b/Plants VS Zombies/MenuBarController.java new file mode 100644 index 0000000..99cd7cb --- /dev/null +++ b/Plants VS Zombies/MenuBarController.java @@ -0,0 +1,140 @@ +package ProjectFinal; + +import javafx.fxml.FXML; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.RadioButton; +import javafx.stage.Stage; +import java.io.IOException; + + +public class MenuBarController { + + @FXML + private Label user_name_label; + @FXML + private Button play_button, records_button, log_out_button, exit_button; + @FXML + private RadioButton easy_radio_button, medium_radio_button, extreme_radio_button, day_radio_button, night_radio_button; + + String uIFXMLFileName = "myFXMLFile/UI.fxml"; + String recordingFXMLFileName = "myFXMLFile/recording_page.fxml"; + String CSSFileNameEasyDay = "myCssFile/BackgroundDayEasy.css"; + String CSSFileNameMediumDay = "myCssFile/BackgroundDayMedium.css"; + String CSSFileNameExtremeDay = "myCssFile/BackgroundDayExtreme.css"; + String CSSFileNameEasyNight = "myCssFile/BackgroundNightEasy.css"; + String CSSFileNameMediumNight = "myCssFile/BackgroundNightMedium.css"; + String CSSFileNameExtremeNight = "myCssFile/BackgroundNightExtreme.css"; + String signInFileName = "src/ProjectFinal/myFile/SignIn.txt"; + String gameScoreFileName = "src/ProjectFinal/myFile/GameScore.txt"; + + String tikAudio = "src/ProjectFinal/myAudio/tik.wav"; + + String linearGradient1 = "-fx-background-color: linear-gradient(to right top, #2cc17e, #506e53)"; + String linearGradient2 = "-fx-background-color: linear-gradient(to right top, #636e67, #425f44)"; + + FileAndTools myTool = new FileAndTools(); + GamePlay myGamePanel = new GamePlay (); + Seed seed = new Seed (); + + + private void buttonEventIn (Button myButton, String color, String audioFileName) { + myButton.setStyle (color); + myTool.audioPlayer (audioFileName); + } + + private void buttonEventOut (Button myButton, String color) { + myButton.setStyle (color); + } + + public void setUserNameLabel (String text) { + user_name_label.setText (text); + } + + @FXML + private void onMouseEnteredPlayButton () { + buttonEventIn (play_button, linearGradient1, tikAudio); + } + + @FXML + private void onMouseExitedPlayButton () { + buttonEventOut (play_button, linearGradient2); + } + + @FXML + private void onClickPlayButton () { + seed.createSeedButtons (GamePlay.root); + if (easy_radio_button.isSelected() && day_radio_button.isSelected()) { + myGamePanel.startGame (GamePlay.root, 1, true); + myTool.createGamePage (user_name_label, CSSFileNameEasyDay, GamePlay.root); + } + else if (medium_radio_button.isSelected() && day_radio_button.isSelected()) { + myGamePanel.startGame(GamePlay.root, 2,true); + myTool.createGamePage (user_name_label, CSSFileNameMediumDay, GamePlay.root); + } + else if (extreme_radio_button.isSelected() && day_radio_button.isSelected()) { + myGamePanel.startGame(GamePlay.root, 3,true); + myTool.createGamePage (user_name_label, CSSFileNameExtremeDay, GamePlay.root); + } + else if (easy_radio_button.isSelected() && night_radio_button.isSelected()) { + myGamePanel.startGame(GamePlay.root, 1, false); + myTool.createGamePage (user_name_label, CSSFileNameEasyNight, GamePlay.root); + } + else if (medium_radio_button.isSelected() && night_radio_button.isSelected()) { + myGamePanel.startGame(GamePlay.root, 2, false); + myTool.createGamePage (user_name_label, CSSFileNameMediumNight, GamePlay.root); + } + else if (extreme_radio_button.isSelected() && night_radio_button.isSelected()) { + myGamePanel.startGame(GamePlay.root, 3, false); + myTool.createGamePage (user_name_label, CSSFileNameExtremeNight, GamePlay.root); + } + + } + + @FXML + private void onMouseEnteredRecordsButton () { + buttonEventIn (records_button, linearGradient1, tikAudio); + } + + @FXML + private void onMouseExitedRecordsButton () { + buttonEventOut (records_button, linearGradient2); + } + + @FXML + private void onClickRecordsButton () throws IOException { + myTool.createRecordingPage (user_name_label, recordingFXMLFileName, signInFileName, gameScoreFileName); + } + + @FXML + private void onMouseEnteredLogOutButton () { + buttonEventIn (log_out_button, linearGradient1, tikAudio); + } + + @FXML + private void onMouseExitedLogOutButton () { + buttonEventOut (log_out_button, linearGradient2); + + } + @FXML + private void onClickLogOutButton () throws IOException { + myTool.createPage(user_name_label, uIFXMLFileName); + } + + @FXML + private void onMouseEnteredExitButton () { + buttonEventIn (exit_button, linearGradient1, tikAudio); + } + + @FXML + private void onMouseExitedExitButton () { + buttonEventOut (exit_button, linearGradient2); + } + + @FXML + private void onClickExitButton () { + Stage stage = (Stage) exit_button.getScene().getWindow(); + stage.close(); + } + +} diff --git a/Plants VS Zombies/Pea.java b/Plants VS Zombies/Pea.java new file mode 100644 index 0000000..d3172c1 --- /dev/null +++ b/Plants VS Zombies/Pea.java @@ -0,0 +1,63 @@ +package ProjectFinal; + +import javafx.animation.Animation; +import javafx.animation.KeyFrame; +import javafx.animation.Timeline; +import javafx.scene.image.ImageView; +import javafx.util.Duration; + +public class Pea { + + String peaImage = "myPicture/Pea.png"; + FileAndTools myTool = new FileAndTools (); + + private void peaThreadDelete (Timeline timeline, ImageView myImageView, int yPeaBlock, int nowWhatPea) { + if (myImageView.getTranslateX() > 600 || GameData.pea[yPeaBlock].get (nowWhatPea) == 700) { + GamePlay.root.getChildren().remove(myImageView); + timeline.stop(); + } + } + + private void peaThreadDeleter (Timeline peaTimeline, ImageView myImageView, int yPeaBlock, int nowWhatPea) { + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(1), + (event) -> peaThreadDelete (peaTimeline, myImageView, yPeaBlock, nowWhatPea))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + } + + public boolean isThereZombieInARow (int xPlantBlock, int yPlantBlock) { + for (int counter = 0; counter < GameData.zombies[yPlantBlock].size(); counter++) { + if (GameData.zombies[yPlantBlock].get (counter) > (Plant.squareSizeX() * xPlantBlock) - 180) { + return true; + } + } + return false; + } + + private void movePea (ImageView myImageView, int peaYRowBlock, int nowWhatPea) { + if (GameData.pea[peaYRowBlock].get (nowWhatPea) != 700) { + GameData.pea[peaYRowBlock].set (nowWhatPea, (int) Math.round(myImageView.getTranslateX ())); + } + myImageView.setTranslateX (myImageView.getTranslateX () + 3); + } + + private void peaThread (ImageView myImageView, int peaYRowBlock) { + int nowWhatPea = GameData.peaNumber[peaYRowBlock]; + GameData.pea[peaYRowBlock].add (nowWhatPea, (int) Math.round(myImageView.getTranslateX ())); + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(10), + (event) -> movePea(myImageView, peaYRowBlock, nowWhatPea))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + peaThreadDeleter(myTimeline, myImageView, peaYRowBlock, nowWhatPea); + GameData.peaNumber[peaYRowBlock]++; + } + + public void addPea (int xPlantBlock, int yPlantBlock) { + int xPlantSize = (Plant.squareSizeX() * xPlantBlock) - 180; + int yPlantSize = (Plant.squareSizeY() * yPlantBlock) - 180; + ImageView imageView = new ImageView (); + myTool.setImageView (imageView, peaImage, 25, 25, xPlantSize, yPlantSize, true); + peaThread (imageView, yPlantBlock); + GamePlay.root.getChildren().addAll (imageView); + } +} diff --git a/Plants VS Zombies/PeaShooter.java b/Plants VS Zombies/PeaShooter.java new file mode 100644 index 0000000..7d95fb5 --- /dev/null +++ b/Plants VS Zombies/PeaShooter.java @@ -0,0 +1,32 @@ +package ProjectFinal; + +import javafx.animation.Animation; +import javafx.animation.KeyFrame; +import javafx.animation.Timeline; +import javafx.util.Duration; + +public class PeaShooter extends Pea{ + + + FileAndTools myTool = new FileAndTools (); + + public static int health = 10; + + private void peaVolley (int xPlantBlock, int yPlantBlock) { + if (isThereZombieInARow(xPlantBlock, yPlantBlock)) { + addPea (xPlantBlock, yPlantBlock); + } + } + + private void peaVolleyThread (int xPlantBlock, int yPlantBlock) { + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(2000), + (event) -> peaVolley(xPlantBlock, yPlantBlock))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + myTool.plantThreadDeleter (myTimeline, xPlantBlock, yPlantBlock); + } + + public void peashooterPlay (int xPlantBlock, int yPlantBlock) { + peaVolleyThread (xPlantBlock, yPlantBlock); + } +} diff --git a/Plants VS Zombies/Plant.java b/Plants VS Zombies/Plant.java new file mode 100644 index 0000000..e5ae2d7 --- /dev/null +++ b/Plants VS Zombies/Plant.java @@ -0,0 +1,300 @@ +package ProjectFinal; + +import javafx.animation.Animation; +import javafx.animation.KeyFrame; +import javafx.animation.Timeline; +import javafx.event.EventHandler; +import javafx.scene.image.ImageView; +import javafx.scene.input.MouseEvent; +import javafx.util.Duration; + +import java.util.concurrent.atomic.AtomicInteger; + +public class Plant { + + String sunflowerImage = "myPicture/Sunflower2.png"; + String potatoMineImage = "myPicture/PotatoMine.png"; + String peaShooterImage = "myPicture/PeaShooter.png"; + String repeaterImage = "myPicture/Repeater.png"; + String wallNutImage = "myPicture/WallNut.png"; + String potatoMineUnderImage = "myPicture/PotatoMineUnder.png"; + + String sunflowerGif = "myPicture/gif/SunflowerGif.gif"; + String peaShooterGif = "myPicture/gif/PeaShooterGif.gif"; + String repeaterGif = "myPicture/gif/RepeaterGif.gif"; + String wallNutGif = "myPicture/gif/WallNutGif.gif"; + + public static ImageView imageView = new ImageView (); + + Sun sun = new Sun (); + PotatoMine potatoMine = new PotatoMine (); + PeaShooter peaShooter = new PeaShooter (); + Repeater repeater = new Repeater (); + FileAndTools myTool = new FileAndTools (); + + private double XMouse = 0, YMouse = 0; + + private final EventHandler setXY = event -> { + imageView.setTranslateX(event.getX() - 512); + imageView.setTranslateY(event.getY() - 335); + XMouse = event.getX(); + YMouse = event.getY(); + }; + + private String backFileName (int plantNum, String sunflower, String potatoMine, String peaShooter + , String repeater, String wallNut) { + String plantPicture = sunflower; + switch (plantNum) { + case 1: + plantPicture = sunflower; + break; + case 2: + plantPicture = potatoMine; + break; + case 3: + plantPicture = peaShooter; + break; + case 4: + plantPicture = repeater; + break; + case 5: + plantPicture = wallNut; + break; + } + return plantPicture; + } + + public static int squareSizeX () { + int result = 80; + switch (GamePlay.gameDifficulty) { + case 1: + result = 72; + break; + case 2: + result = 80; + break; + case 3: + result = 90; + break; + } + return result; + } + + public static int squareSizeY () { + int result = 96; + switch (GamePlay.gameDifficulty) { + case 1: + result = 80; + break; + case 2: + result = 96; + break; + case 3: + result = 120; + break; + } + return result; + } + + public static int sizeXForDifficulty () { + int result = 0; + switch (GamePlay.gameDifficulty) { + case 1: + result = 10; + break; + case 2: + result = 9; + break; + case 3: + result = 8; + break; + } + return result; + } + + public static int sizeYForDifficulty () { + int result = 0; + switch (GamePlay.gameDifficulty) { + case 1: + result = 6; + break; + case 2: + result = 5; + break; + case 3: + result = 4; + break; + } + return result; + } + + public static int getWhereIsPlantXBlock (double X, int startX) { + for (int counter = 0; counter < sizeXForDifficulty(); counter++) { + if ((counter * squareSizeX()) + startX < X && X < ((counter + 1) * squareSizeX()) + startX) { + return counter; + } + } + return -1; + } + + private int getWhereIsPlantYBlock (double Y) { + for (int counter = 0; counter < sizeYForDifficulty(); counter++) { + if ((counter * squareSizeY()) + 123 < Y && Y < ((counter + 1) * squareSizeY()) + 123) { + return counter; + } + } + return -1; + } + + private int placeForPlantX (int X) { + return (X * squareSizeX ()) - 210; + } + + private int placeForPlantY (int Y) { + return (Y * squareSizeY ()) - 170; + } + + private int plantCost (int plantNum) { + int result = 0; + switch (plantNum) { + case 1: + case 5: + result = 50; + break; + case 2: + result = 25; + break; + case 3: + result = 100; + break; + case 4: + result = 200; + break; + } + return result; + } + + private void plantChoose (int plantNum, int xPlantBlock, int yPlantBlock) { + switch (plantNum) { + case 1: + sun.addSun (GamePlay.root, GamePlay.gameDifficulty, true, xPlantBlock + , yPlantBlock, GamePlay.sunDurationTime(GamePlay.isItDay)); + break; + case 2: + potatoMine.potatoMinePlay (xPlantBlock, yPlantBlock); + break; + case 3: + peaShooter.peashooterPlay (xPlantBlock, yPlantBlock); + break; + case 4: + repeater.repeaterPlay (xPlantBlock, yPlantBlock); + break; + } + } + + private int getDecreaseHealth () { + int result = 0; + switch (GamePlay.gameDifficulty) { + case 1: + result = -1; + break; + case 2: + result = 0; + break; + case 3: + result = 1; + break; + } + return result; + } + + private int getPlantHealth (int plantNum) { + int result = 0; + switch (plantNum) { + case 1: + result = Sunflower.health - getDecreaseHealth(); + break; + case 2: + result = PotatoMine.health - getDecreaseHealth(); + break; + case 3: + result = PeaShooter.health - getDecreaseHealth(); + break; + case 4: + result = Repeater.health - getDecreaseHealth(); + break; + case 5: + result = WallNut.health - (getDecreaseHealth() * 5); + break; + } + return result; + } + + private int deadPlant (ImageView myImageView, int xPlantBlock, int yPlantBlock, int result) { + if (GameData.plant[yPlantBlock][xPlantBlock] == 0 && result == 0) { + GamePlay.root.getChildren().removeAll (myImageView); + result = 1; + } + return result; + } + + private void diePlant (ImageView myImageView, int xPlantBlock, int yPlantBlock) { + AtomicInteger result = new AtomicInteger(); + result.set(0); + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(10), + (event) -> result.set(deadPlant(myImageView, xPlantBlock, yPlantBlock, result.get())))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + } + + private int plantImageSize (int plantNum) { + int size; + if (plantNum == 5) { + size = 70; + } + else if (plantNum == 2) { + size = 30; + } + else { + size = 90; + } + return size; + } + + private void setPlantImage (ImageView myImageView, int xPlantBlock, int yPlantBlock, int plantNum) { + int size = plantImageSize(plantNum); + GamePlay.root.getChildren().addAll (myImageView); + myTool.setImageView (myImageView, backFileName (plantNum, sunflowerGif, potatoMineUnderImage, peaShooterGif + , repeaterGif, wallNutGif), size, size, 0, 0, false); + potatoMine.setPotatoMineImage (myImageView, plantNum); + myImageView.setTranslateX (placeForPlantX(xPlantBlock)); + myImageView.setTranslateY (placeForPlantY(yPlantBlock)); + } + + private void successfullyPlanting (int xPlantBlock, int yPlantBlock, int plantNum) { + ImageView myImageView = new ImageView(); + setPlantImage (myImageView, xPlantBlock, yPlantBlock, plantNum); + GameData.plant[yPlantBlock][xPlantBlock] = plantNum; + GameData.plantHealth[yPlantBlock][xPlantBlock] = getPlantHealth (plantNum); + Sun.amountOfSun -= plantCost (plantNum); + plantChoose (plantNum, xPlantBlock, yPlantBlock); + diePlant (myImageView, xPlantBlock, yPlantBlock); + } + + private void plantingAPlant (int plantNum) { + int xPlantBlock = getWhereIsPlantXBlock (XMouse, 261); + int yPlantBlock = getWhereIsPlantYBlock (YMouse); + imageView.setTranslateX (500); + imageView.setTranslateY (500); + GamePlay.root.removeEventHandler(MouseEvent.MOUSE_MOVED, setXY); + if (xPlantBlock != -1 && yPlantBlock != -1 && GameData.plant[yPlantBlock][xPlantBlock] == 0) { + successfullyPlanting (xPlantBlock, yPlantBlock, plantNum); + } + } + + public void setPictureOnDragMouse (int plantNum) { + myTool.setImageView (imageView, backFileName (plantNum, sunflowerImage, potatoMineImage, peaShooterImage, repeaterImage, wallNutImage), 50, 50, 0, 0, false); + GamePlay.root.addEventHandler (MouseEvent.MOUSE_MOVED, setXY); + imageView.setOnMouseClicked (mouseEvent -> plantingAPlant(plantNum)); + } +} diff --git a/Plants VS Zombies/PotatoMine.java b/Plants VS Zombies/PotatoMine.java new file mode 100644 index 0000000..c5452d2 --- /dev/null +++ b/Plants VS Zombies/PotatoMine.java @@ -0,0 +1,104 @@ +package ProjectFinal; + +import javafx.animation.Animation; +import javafx.animation.KeyFrame; +import javafx.animation.Timeline; +import javafx.scene.image.ImageView; +import javafx.util.Duration; + +import java.util.Timer; + +public class PotatoMine { + + public static int health = 10; + + String potatoMineGif = "myPicture/gif/PotatoMineGif.gif"; + + String bombAudio = "src/ProjectFinal/myAudio/bomb.wav"; + + FileAndTools myTool = new FileAndTools (); + + public void setPotatoMineImage (ImageView myImageView, int plantNum) { + if (plantNum == 2) { + Timer timer = new java.util.Timer(); + timer.schedule( + new java.util.TimerTask() { + @Override + public void run() { + myTool.setImageView (myImageView, potatoMineGif, 90, 90, 0, 0, false); + timer.cancel(); + } + }, + 15000 + ); + } + } + + public void deleteSquareOfPlants (int xPlantBlock, int yPlantBlock) { + for (int row = yPlantBlock - 1; row < yPlantBlock + 2; row++) { + for (int column = xPlantBlock - 1; column < xPlantBlock + 2; column++) { + if (column >= 0 && row >= 0 && column <= 6 && row <= 10) { + GameData.plantHealth[row][column] = 0; + } + } + } + } + + public void deleteSquareOfZombies (int xPlantBlock, int yPlantBlock) { + int zombieCount; + int startX = (Plant.squareSizeX() * (xPlantBlock - 1)) - 249; + int endX = (Plant.squareSizeX() * (xPlantBlock + 2)) - 249; + int zombieCoordinateX; + for (int row = yPlantBlock - 1; row < yPlantBlock + 2; row++) { + if (row >= 0 && row <= 6) { + zombieCount = GameData.zombies[row].size(); + for (int counter = 0; counter < zombieCount; counter++) { + zombieCoordinateX = GameData.zombies[row].get(counter); + if (startX <= zombieCoordinateX && zombieCoordinateX <= endX) { + GameData.zombieHealth[row].set(counter, 0); + } + } + } + + } + } + + private void potatoMineChecker (int xPlantBlock, int yPlantBlock) { + int zombieCount = GameData.zombies[yPlantBlock].size(); + int startFor = (Plant.squareSizeX() * xPlantBlock) - 249; + int endFor = (Plant.squareSizeX() * (xPlantBlock + 1)) - 249; + int zombieCoordinate; + for (int counter = 0; counter < zombieCount; counter++) { + zombieCoordinate = GameData.zombies[yPlantBlock].get(counter); + if (startFor < zombieCoordinate && endFor > zombieCoordinate) { + myTool.audioPlayer (bombAudio); + GameData.zombieHealth[yPlantBlock].set(counter, 0); + deleteSquareOfPlants (xPlantBlock, yPlantBlock); + deleteSquareOfZombies (xPlantBlock, yPlantBlock); + } + } + + } + + public void potatoMineCheck (int xPlantBlock, int yPlantBlock) { + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(10), + (event) -> potatoMineChecker (xPlantBlock, yPlantBlock))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + myTool.plantThreadDeleter (myTimeline, xPlantBlock, yPlantBlock); + } + + public void potatoMinePlay (int xPlantBlock, int yPlantBlock) { + Timer timer = new java.util.Timer(); + timer.schedule( + new java.util.TimerTask() { + @Override + public void run() { + potatoMineCheck (xPlantBlock, yPlantBlock); + timer.cancel(); + } + }, + 15000 + ); + } +} diff --git a/Plants VS Zombies/RecordingPageController.java b/Plants VS Zombies/RecordingPageController.java new file mode 100644 index 0000000..1406dea --- /dev/null +++ b/Plants VS Zombies/RecordingPageController.java @@ -0,0 +1,29 @@ +package ProjectFinal; + +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.ListView; +import java.util.List; +import java.io.IOException; + +public class RecordingPageController { + + String menuBarFXMLFileName = "myFXMLFile/Menu_bar.fxml"; + String logInFileName = "src/ProjectFinal/myFile/LogIn.txt"; + + FileAndTools myTool = new FileAndTools (); + + public Label game_records_label; + public Button back_to_main_menu_button_2; + public ListView list_view; + + public void setList (List myList) { + for (String s : myList) { + list_view.getItems().add(s); + } + } + + public void onClickBackToMainMenuButton2 () throws IOException { + myTool.createMenuPage (game_records_label, menuBarFXMLFileName, myTool.gettingLastUser(logInFileName)); + } +} diff --git a/Plants VS Zombies/Repeater.java b/Plants VS Zombies/Repeater.java new file mode 100644 index 0000000..938a3dd --- /dev/null +++ b/Plants VS Zombies/Repeater.java @@ -0,0 +1,23 @@ +package ProjectFinal; + +import java.util.Timer; + +public class Repeater extends PeaShooter{ + + public static int health = 10; + + public void repeaterPlay (int xPlantBlock, int yPlantBlock) { + peashooterPlay (xPlantBlock, yPlantBlock); + Timer timer = new java.util.Timer(); + timer.schedule( + new java.util.TimerTask() { + @Override + public void run() { + peashooterPlay (xPlantBlock, yPlantBlock); + timer.cancel(); + } + }, + 300 + ); + } +} diff --git a/Plants VS Zombies/Seed.java b/Plants VS Zombies/Seed.java new file mode 100644 index 0000000..e45fb9c --- /dev/null +++ b/Plants VS Zombies/Seed.java @@ -0,0 +1,109 @@ +package ProjectFinal; + +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.scene.control.Label; +import javafx.scene.image.ImageView; +import javafx.scene.control.Button; +import javafx.scene.layout.StackPane; +import javafx.scene.text.Font; + +public class Seed { + + public static int setPlant = 0; + + String sunflowerSeedImage = "myPicture/SeedPictures/SunflowerSeed.png"; + String potatoMineSeedImage = "myPicture/SeedPictures/PotatoMineSeed.png"; + String peaShooterSeedImage = "myPicture/SeedPictures/PeaShooterSeed.png"; + String repeaterSeedImage = "myPicture/SeedPictures/RepeaterSeed.png"; + String wallNutSeedImage = "myPicture/SeedPictures/WallNutSeed.png"; + + String notificationAudio = "src/ProjectFinal/myAudio/notification.wav"; + + Button sunflowerSeed = new Button(), potatoMineSeed = new Button(); + Button peaShooterSeed = new Button(), repeaterSeed = new Button(), wallNutSeed = new Button(); + + FileAndTools myTool = new FileAndTools(); + Plant plant = new Plant(); + + private void controlSeeds(int maxAmountOfSun, int plantNum) { + if (Sun.amountOfSun >= maxAmountOfSun && GameData.isPlatformFree() == 1) { + setPlant = plantNum; + plant.setPictureOnDragMouse (plantNum); + } + else { + setPlant = 0; + myTool.audioPlayer (notificationAudio); + } + } + + EventHandler sunflowerHandler = actionEvent -> controlSeeds(50, 1); + + EventHandler potatoMineHandler = actionEvent -> controlSeeds(25, 2); + + EventHandler peaShooterHandler = actionEvent -> controlSeeds(100, 3); + + EventHandler repeaterHandler = actionEvent -> controlSeeds(200, 4); + + EventHandler wallNutHandler = actionEvent -> controlSeeds(50, 5); + + private void setActions (Button seedButton, int plant) { + switch (plant) { + case 1: + seedButton.setOnAction (sunflowerHandler); + break; + case 2: + seedButton.setOnAction (potatoMineHandler); + break; + case 3: + seedButton.setOnAction (peaShooterHandler); + break; + case 4: + seedButton.setOnAction (repeaterHandler); + break; + case 5: + seedButton.setOnAction (wallNutHandler); + break; + } + } + + public Button getSeed (String imageFileName, Button seedButton, int X, int Y, int plant) { + ImageView imageView = new ImageView (); + myTool.setImageView (imageView, imageFileName, 80, 124, 0, 0, false); + seedButton.setGraphic (imageView); + seedButton.setTranslateX (X); + seedButton.setTranslateY (Y); + seedButton.setStyle ("-fx-background-color: Transparent;"); + setActions(seedButton, plant); + return seedButton; + } + + private void amountLabels(Label myLabel, String text, int Y) { + myLabel.setText (text); + myLabel.setTranslateX (-360); + myLabel.setTranslateY (Y); + myLabel.setFont (new Font("Arial", 15)); + } + + private void amountOfPlants (StackPane root) { + Label sunflowerAmount = new Label(), peaShooterAmount = new Label(), repeaterAmount = new Label(); + Label potatoMineAmount = new Label(), wallNutAmount = new Label(); + root.getChildren().addAll (sunflowerAmount, potatoMineAmount, peaShooterAmount, repeaterAmount, wallNutAmount); + amountLabels (sunflowerAmount, "50", -148); + amountLabels (potatoMineAmount, "25", -64); + amountLabels (peaShooterAmount, "100", 19); + amountLabels (repeaterAmount, "200", 102); + amountLabels (wallNutAmount, "50", 185); + } + + public void createSeedButtons (StackPane root) { + sunflowerSeed = getSeed (sunflowerSeedImage, sunflowerSeed, -400, -168, 1); + potatoMineSeed = getSeed (potatoMineSeedImage, potatoMineSeed, -400, -84, 2); + peaShooterSeed = getSeed (peaShooterSeedImage, peaShooterSeed, -400, -1, 3); + repeaterSeed = getSeed (repeaterSeedImage, repeaterSeed, -400, 82, 4); + wallNutSeed = getSeed (wallNutSeedImage, wallNutSeed, -400, 165, 5); + root.getChildren().addAll (sunflowerSeed, potatoMineSeed, peaShooterSeed, repeaterSeed, wallNutSeed); + amountOfPlants (root); + } + +} diff --git a/Plants VS Zombies/Sun.java b/Plants VS Zombies/Sun.java new file mode 100644 index 0000000..3b78a16 --- /dev/null +++ b/Plants VS Zombies/Sun.java @@ -0,0 +1,159 @@ +package ProjectFinal; + +import javafx.animation.*; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.scene.control.Label; +import javafx.scene.image.ImageView; +import javafx.scene.layout.StackPane; +import javafx.scene.control.Button; +import javafx.scene.paint.Color; +import javafx.scene.shape.Rectangle; +import javafx.scene.text.Font; +import javafx.util.Duration; +import java.util.Random; +import java.util.Timer; + +public class Sun { + + public static int amountOfSun = 50; + + Random rand = new Random (); + Label sunLabel = new Label(); + + TranslateTransition translate = new TranslateTransition(); + FadeTransition fade = new FadeTransition(); + FileAndTools myTool = new FileAndTools (); + Sunflower sunflower = new Sunflower (); + + String sunGif = "myPicture/gif/SunGif.gif"; + String sunImage = "myPicture/Sun.png"; + + private void setFadeRectangle (Rectangle rectangle) { + fade.setDuration(Duration.millis(5000)); + fade.setFromValue (10); + fade.setToValue (0.1); + fade.setCycleCount (1); + fade.setAutoReverse (true); + fade.setNode (rectangle); + fade.play (); + Timer timer = new java.util.Timer(); + timer.schedule( + new java.util.TimerTask() { + @Override + public void run() { + fade.stop (); + timer.cancel(); + } + }, + 2500 + ); + } + + public void addSunRectangle (int xSize, int ySize, Color rectangleColor) { + Rectangle rectangle = new Rectangle(); + rectangle.setTranslateX (xSize); + rectangle.setTranslateY (ySize); + rectangle.setWidth (100); + rectangle.setHeight (30); + rectangle.setArcWidth (40.0); + rectangle.setArcHeight (40.0); + rectangle.setFill (rectangleColor); + setFadeRectangle (rectangle); + GamePlay.root.getChildren().add (rectangle); + } + + public void setSunLabelPicture () { + addSunRectangle(-410, -275, Color.CYAN); + ImageView myImageView = new ImageView (); + myTool.setImageView (myImageView, sunImage, 75, 75, -460, -275, true); + GamePlay.root.getChildren().add (myImageView); + } + + private void transition (Button sunButton, int X, int Y) { + sunButton.setTranslateX (X); + sunButton.setTranslateY (-400); + translate.setByY(Y + 115); + translate.setDuration(Duration.millis((Y/Plant.squareSizeY())*1000)); + translate.setCycleCount(1); + translate.setAutoReverse(true); + translate.setNode(sunButton); + translate.play(); + } + + private void linearMoveSun (Button sunButton, int difficulty) { + int X = 0,Y = 0; + switch (difficulty) { + case 1: + X = rand.nextInt (10); + Y = rand.nextInt (6); + break; + case 2: + X = rand.nextInt (9); + Y = rand.nextInt (5); + break; + case 3: + X = rand.nextInt (8); + Y = rand.nextInt (4); + break; + } + X = (X * Plant.squareSizeX())-212; + Y = ((Y + 1) * Plant.squareSizeY ()); + transition (sunButton, X, Y); + } + + private void moveSun (Button sunButton, int difficulty, boolean isSunForSunflower, int XSunflower, int YSunflower) { + if (isSunForSunflower) { + sunflower.rotateMoveSun (sunButton, XSunflower, YSunflower); + } else { + linearMoveSun(sunButton, difficulty); + } + } + + private void updateSun () { + sunLabel.setText(String.valueOf(amountOfSun)); + } + + private void sunLine (Button sunButton, int difficulty, boolean isSunForSunflower, int XSunflowerBlock, int YSunflowerBlock, int sunDuration) { + Timeline myTimeline = new Timeline (new KeyFrame(Duration.seconds(sunDuration), + (event) -> moveSun(sunButton, difficulty, isSunForSunflower, XSunflowerBlock, YSunflowerBlock))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + if (isSunForSunflower) { + myTool.plantThreadDeleter (myTimeline, XSunflowerBlock, YSunflowerBlock); + } + } + + private void sunUpdater () { + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(10), + (event) -> updateSun())); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + } + + public void setSunLabel (StackPane root) { + root.getChildren().addAll (sunLabel); + sunLabel.setTranslateX (-400); + sunLabel.setTranslateY (-275); + sunLabel.setFont (new Font("Arial", 22)); + } + + public void addSun (StackPane root, int difficulty, boolean isSunForSunflower, int XSunflowerBlock, int YSunflowerBlock, int sunDuration) { + Button sunButton = new Button(); + EventHandler sunHandler = actionEvent -> { + amountOfSun += 25; + sunButton.setTranslateX(600); + sunButton.setTranslateY(600); + }; + ImageView imageView = new ImageView (); + myTool.setImageView (imageView, sunGif, 75, 75, 0, 0, false); + sunButton.setGraphic (imageView); + sunButton.setStyle ("-fx-background-color: Transparent;"); + sunButton.setOnAction (sunHandler); + root.getChildren().addAll (sunButton); + moveSun(sunButton, difficulty, isSunForSunflower, XSunflowerBlock, YSunflowerBlock); + sunLine (sunButton, difficulty, isSunForSunflower, XSunflowerBlock, YSunflowerBlock, sunDuration); + sunUpdater(); + } + +} diff --git a/Plants VS Zombies/Sunflower.java b/Plants VS Zombies/Sunflower.java new file mode 100644 index 0000000..f9a5918 --- /dev/null +++ b/Plants VS Zombies/Sunflower.java @@ -0,0 +1,24 @@ +package ProjectFinal; + +import javafx.animation.RotateTransition; +import javafx.scene.control.Button; +import javafx.util.Duration; + +public class Sunflower { + + public static int health = 10; + + public void rotateMoveSun (Button sunButton, int XSunflower, int YSunflower) { + int XSize = (XSunflower * Plant.squareSizeX()) - 222; + int YSize = (YSunflower * Plant.squareSizeY()) - 175; + sunButton.setTranslateX (XSize); + sunButton.setTranslateY (YSize); + RotateTransition rotate = new RotateTransition(Duration.millis(500), sunButton); + rotate.setByAngle(180); + rotate.setCycleCount(1); + rotate.setAutoReverse(true); + rotate.play(); + } + + +} diff --git a/Plants VS Zombies/UIController.java b/Plants VS Zombies/UIController.java new file mode 100644 index 0000000..1e26870 --- /dev/null +++ b/Plants VS Zombies/UIController.java @@ -0,0 +1,108 @@ +package ProjectFinal; + +import javafx.fxml.FXML; +import javafx.scene.control.Button; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.shape.Line; +import java.io.IOException; + +public class UIController { + + @FXML + private Label user_name_label, password_label; + @FXML + private Line user_name_line, password_line; + @FXML + private Button sign_in_button, log_in_button; + @FXML + private TextField user_name_text_field, password_text_field; + @FXML + public Label error_user_name_label, error_password_label; + + String signInFileName = "src/ProjectFinal/myFile/SignIn.txt"; + String logInFileName = "src/ProjectFinal/myFile/LogIn.txt"; + String gameScoreFileName = "src/ProjectFinal/myFile/GameScore.txt"; + String menuBarFXMLFileName = "myFXMLFile/Menu_bar.fxml"; + + String notificationAudio = "src/ProjectFinal/myAudio/notification.wav"; + String accessAudio = "src/ProjectFinal/myAudio/access.wav"; + String tikAudio = "src/ProjectFinal/myAudio/tik.wav"; + + String colorBlue = "-fx-stroke: blue;"; + String colorBlack = "-fx-stroke: black;"; + String colorOrange = "-fx-background-color: orange;"; + String colorDarkOrange = "-fx-background-color: #ff8c00;"; + + FileAndTools myTool = new FileAndTools (); + + private void textFieldEvent (Label myLabel, Label myLabel2, Line myLine, String label, String color, int changeX, int changeY) { + myLabel.setText (label); + myLabel2.setLayoutY (myLabel2.getLayoutY () + changeY); + myLine.setEndX (myLine.getEndX () + changeX); + myLine.setEndY (myLine.getEndY () + changeY); + myLine.setStartY (myLine.getStartY () + changeY); + myLine.setStyle (color); + } + + private void buttonEventIn (Button myButton, String color, String audioFileName) { + myButton.setStyle (color); + myTool.audioPlayer (audioFileName); + } + + private void buttonEventOut (Button myButton, String color) { + myButton.setStyle (color); + } + + @FXML + private void onMouseEnteredUserName () { + textFieldEvent (user_name_label, error_user_name_label, user_name_line, "User Name", colorBlue, 10, 10); + } + + @FXML + private void onMouseExitedUserName () { + textFieldEvent (user_name_label, error_user_name_label, user_name_line, "", colorBlack, -10, -10); + } + + @FXML + private void onMouseEnteredPassword () { + textFieldEvent (password_label, error_password_label, password_line, "Password", colorBlue, 10, 10); + } + + @FXML + private void onMouseExitedPassword () { + textFieldEvent (password_label, error_password_label, password_line, "", colorBlack, -10, -10); + } + + @FXML + private void onMouseEnteredSignIn () { + buttonEventIn (sign_in_button, colorDarkOrange, tikAudio); + } + + @FXML + private void onMouseExitedSignIn () { + buttonEventOut (sign_in_button, colorOrange); + } + + @FXML + private void onMouseEnteredLogIn () { + buttonEventIn (log_in_button, colorDarkOrange, tikAudio); + } + + @FXML + private void onMouseExitedLogIn () { + buttonEventOut (log_in_button, colorOrange); + } + + @FXML + private void onClickSignInButton () throws IOException { + myTool.signIn (signInFileName, gameScoreFileName, user_name_text_field.getText (), password_text_field.getText () + , error_user_name_label, error_password_label, notificationAudio, accessAudio); + } + + @FXML + private void onClickLogInButton () throws IOException { + myTool.logIn (signInFileName, logInFileName, menuBarFXMLFileName,user_name_text_field.getText (), password_text_field.getText () + , error_user_name_label, error_password_label, notificationAudio, accessAudio); + } +} diff --git a/Plants VS Zombies/WallNut.java b/Plants VS Zombies/WallNut.java new file mode 100644 index 0000000..83d8e7b --- /dev/null +++ b/Plants VS Zombies/WallNut.java @@ -0,0 +1,5 @@ +package ProjectFinal; + +public class WallNut { + public static int health = 50; +} diff --git a/Plants VS Zombies/Zombie.java b/Plants VS Zombies/Zombie.java new file mode 100644 index 0000000..ce782a1 --- /dev/null +++ b/Plants VS Zombies/Zombie.java @@ -0,0 +1,206 @@ +package ProjectFinal; + +import javafx.animation.Animation; +import javafx.animation.KeyFrame; +import javafx.animation.Timeline; +import javafx.scene.image.ImageView; +import javafx.util.Duration; + +import java.util.Random; +import java.util.concurrent.atomic.AtomicInteger; + +public class Zombie { + + public static int normalZombieHealth = 10; + + String zombieGif = "myPicture/gif/ZombieGif.gif"; + String coneHeadZombieGif = "myPicture/gif/ConeHeadZombieGif.gif"; + String jackInTheBoxZombieImage = "myPicture/JackInTheBoxZombie.png"; + + String eatAudio = "src/ProjectFinal/myAudio/eat.wav"; + + ConeHeadZombie coneHeadZombie = new ConeHeadZombie (); + JackInTheBoxZombie jackInTheBoxZombie = new JackInTheBoxZombie (); + FileAndTools myTool = new FileAndTools (); + LawnMover lawnMover = new LawnMover (); + Random rand = new Random (); + + private int getZombieHealth (int zombieHealth) { + int result = 0; + switch (GamePlay.gameDifficulty) { + case 1: + result = zombieHealth - 3; + break; + case 2: + result = zombieHealth; + break; + case 3: + result = zombieHealth + 3; + break; + } + return result; + } + + private int getZombiesHealth (int zombieNum) { + int result = 0; + switch (zombieNum) { + case 1: + result = getZombieHealth (normalZombieHealth); + break; + case 2: + result = getZombieHealth (ConeHeadZombie.coneHeadZombieHealth); + break; + case 3: + result = getZombieHealth (JackInTheBoxZombie.jackInTheBoxZombieHealth); + break; + } + return result; + } + + private void initializingZombieHealth (int health, int zombieYRowBlock, int nowWhatZombie) { + GameData.zombieHealth[zombieYRowBlock].add(nowWhatZombie, health); + } + + private void decreaseZombieHealth(ImageView myImageView, int zombieYRowBlock, int nowWhatZombie, int result) { + int decreasedHealth = GameData.zombieHealth[zombieYRowBlock].get(nowWhatZombie); + decreasedHealth--; + if (result != 0) { + if (zombieCrashedPea(myImageView, zombieYRowBlock)) { + GameData.zombieHealth[zombieYRowBlock].set(nowWhatZombie, decreasedHealth); + } + } + } + + private boolean zombieCrashedPea(ImageView myImageView, int zombieYRowBlock) { + int zombieXSize = (int) Math.round(myImageView.getTranslateX()); + int startFor = zombieXSize - (60 / 2); + int endFor = zombieXSize + (60 / 2); + int peaCoordinates; + for (int counter = startFor; counter < endFor; counter += 4) { + for (int counter2 = 0; counter2 < GameData.pea[zombieYRowBlock].size(); counter2++) { + peaCoordinates = GameData.pea[zombieYRowBlock].get(counter2); + if ((peaCoordinates - 13) < counter && (peaCoordinates + 13) > counter) { + GameData.pea[zombieYRowBlock].set(counter2, 700); + return true; + } + } + } + return false; + } + + private int zombieTimelineDelete (Timeline timeline, ImageView myImageView, int yZombieBlock, int nowWhatZombie, int result) { + decreaseZombieHealth (myImageView, yZombieBlock, nowWhatZombie, result); + int zombieHealth = GameData.zombieHealth[yZombieBlock].get (nowWhatZombie); + if (zombieHealth <= 0 && result != 0) { + GameData.score += 10; + GamePlay.root.getChildren().remove (myImageView); + GameData.zombies[yZombieBlock].set (nowWhatZombie, -350); + timeline.stop(); + result = 0; + } + return result; + } + + public void zombieTimelineDeleter (Timeline zombieTimeline, ImageView myImageView, int yZombieBlock, int nowWhatZombie) { + AtomicInteger result = new AtomicInteger(); + result.set(1); + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(5), + (event) -> result.set(zombieTimelineDelete (zombieTimeline, myImageView, yZombieBlock, nowWhatZombie, result.get())))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + } + + private void zombieChoose (ImageView myImageView, int zombieNum, int yZombieBlock, int currentZombie) { + switch (zombieNum) { + case 2: + coneHeadZombie.playConeHeadZombie (myImageView, yZombieBlock, currentZombie); + break; + case 3: + jackInTheBoxZombie.playJackInTheBoxZombie (myImageView, yZombieBlock, currentZombie); + break; + } + } + + private int moveZombie (ImageView myImageView, int counter, int zombieYRowBlock, int nowWhatZombie) { + counter++; + int zombieXRowBlock = Plant.getWhereIsPlantXBlock (myImageView.getTranslateX (), -250); + GameData.zombies[zombieYRowBlock].set (nowWhatZombie, (int) Math.round(myImageView.getTranslateX ())); + if (zombieXRowBlock >= 0) { + if (GameData.plant[zombieYRowBlock][zombieXRowBlock] == 0) { // moving zombie + myImageView.setTranslateX (myImageView.getTranslateX () - 0.2); + } + else if (counter % 30 == 0) { // if there is plant on the way + GameData.plantHealth[zombieYRowBlock][zombieXRowBlock]--; + myTool.audioPlayer (eatAudio); + } + } + else { + GameData.lawnMover[zombieYRowBlock] = 0; + } + return counter; + } + + private void zombieTimeline (ImageView myImageView, int zombieNum, int zombieYRowBlock) { + int nowWhatZombie = GameData.zombieNumber[zombieYRowBlock]; + initializingZombieHealth (getZombiesHealth(zombieNum), zombieYRowBlock, nowWhatZombie); + GameData.zombies[zombieYRowBlock].add (nowWhatZombie, (int) Math.round(myImageView.getTranslateX ())); + AtomicInteger counter = new AtomicInteger(); + counter.set(0); + Timeline myTimeline = new Timeline (new KeyFrame(Duration.millis(10), + (event) -> counter.set(moveZombie(myImageView, counter.get(), zombieYRowBlock, nowWhatZombie)))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + zombieChoose (myImageView, zombieNum, zombieYRowBlock, nowWhatZombie); + zombieTimelineDeleter (myTimeline, myImageView, zombieYRowBlock, nowWhatZombie); + GameData.zombieNumber[zombieYRowBlock]++; + } + + private void setZombieImage (ImageView imageView, int zombieNum, int whereZombieGrow) { + switch (zombieNum) { + case 1: + myTool.setImageView (imageView, zombieGif, 120, 80 + , 400, whereZombieGrow, true); + break; + case 2: + myTool.setImageView (imageView, coneHeadZombieGif, 150, 100 + , 400, whereZombieGrow - 10, true); + break; + case 3: + myTool.setImageView (imageView, jackInTheBoxZombieImage, 120, 80 + , 400, whereZombieGrow, true); + break; + } + } + + public void addZombie (int zombieNum) { + ImageView imageView = new ImageView (); + int randomYRowBlock = lawnMover.randomRowAdvance(); + int whereZombieGrow = (randomYRowBlock * Plant.squareSizeY()) - 185; + setZombieImage (imageView, zombieNum, whereZombieGrow); + zombieTimeline (imageView, zombieNum, randomYRowBlock); + GamePlay.root.getChildren().addAll (imageView); + } + + private int zombieLine (int result) { + if (!lawnMover.isAllLawnMowerDead()) { + result++; + for (int counter = 0; counter < result; counter++) { + addZombie(rand.nextInt(3) + 1); + } + } + return result; + } + + private void zombieLinear () { + AtomicInteger result = new AtomicInteger(); + result.set(1); + Timeline myTimeline = new Timeline (new KeyFrame(Duration.seconds(15), + (event) -> result.set(zombieLine (result.get())))); + myTimeline.setCycleCount (Animation.INDEFINITE); + myTimeline.play(); + } + + public void zombieAdder () { + zombieLinear(); + } +} diff --git a/Plants VS Zombies/myAudio/access.wav b/Plants VS Zombies/myAudio/access.wav new file mode 100644 index 0000000..ee8745c Binary files /dev/null and b/Plants VS Zombies/myAudio/access.wav differ diff --git a/Plants VS Zombies/myAudio/bomb.wav b/Plants VS Zombies/myAudio/bomb.wav new file mode 100644 index 0000000..1012377 Binary files /dev/null and b/Plants VS Zombies/myAudio/bomb.wav differ diff --git a/Plants VS Zombies/myAudio/eat.wav b/Plants VS Zombies/myAudio/eat.wav new file mode 100644 index 0000000..9fd9403 Binary files /dev/null and b/Plants VS Zombies/myAudio/eat.wav differ diff --git a/Plants VS Zombies/myAudio/notification.wav b/Plants VS Zombies/myAudio/notification.wav new file mode 100644 index 0000000..507de33 Binary files /dev/null and b/Plants VS Zombies/myAudio/notification.wav differ diff --git a/Plants VS Zombies/myAudio/tik.wav b/Plants VS Zombies/myAudio/tik.wav new file mode 100644 index 0000000..279959e Binary files /dev/null and b/Plants VS Zombies/myAudio/tik.wav differ diff --git a/Plants VS Zombies/myCssFile/Background/EasyDay.jpg b/Plants VS Zombies/myCssFile/Background/EasyDay.jpg new file mode 100644 index 0000000..cf9b822 Binary files /dev/null and b/Plants VS Zombies/myCssFile/Background/EasyDay.jpg differ diff --git a/Plants VS Zombies/myCssFile/Background/EasyNight.png b/Plants VS Zombies/myCssFile/Background/EasyNight.png new file mode 100644 index 0000000..69df1fe Binary files /dev/null and b/Plants VS Zombies/myCssFile/Background/EasyNight.png differ diff --git a/Plants VS Zombies/myCssFile/Background/ExtremeDay.jpg b/Plants VS Zombies/myCssFile/Background/ExtremeDay.jpg new file mode 100644 index 0000000..d12e82f Binary files /dev/null and b/Plants VS Zombies/myCssFile/Background/ExtremeDay.jpg differ diff --git a/Plants VS Zombies/myCssFile/Background/ExtremeNight.png b/Plants VS Zombies/myCssFile/Background/ExtremeNight.png new file mode 100644 index 0000000..561e67d Binary files /dev/null and b/Plants VS Zombies/myCssFile/Background/ExtremeNight.png differ diff --git a/Plants VS Zombies/myCssFile/Background/MediumDay.jpg b/Plants VS Zombies/myCssFile/Background/MediumDay.jpg new file mode 100644 index 0000000..76e614a Binary files /dev/null and b/Plants VS Zombies/myCssFile/Background/MediumDay.jpg differ diff --git a/Plants VS Zombies/myCssFile/Background/MediumNight.png b/Plants VS Zombies/myCssFile/Background/MediumNight.png new file mode 100644 index 0000000..2e7bbbb Binary files /dev/null and b/Plants VS Zombies/myCssFile/Background/MediumNight.png differ diff --git a/Plants VS Zombies/myCssFile/BackgroundDayEasy.css b/Plants VS Zombies/myCssFile/BackgroundDayEasy.css new file mode 100644 index 0000000..dd3ed5e --- /dev/null +++ b/Plants VS Zombies/myCssFile/BackgroundDayEasy.css @@ -0,0 +1,4 @@ +#pane { + -fx-background-image:url('Background/EasyDay.jpg'); + -fx-background-size:cover; +} \ No newline at end of file diff --git a/Plants VS Zombies/myCssFile/BackgroundDayExtreme.css b/Plants VS Zombies/myCssFile/BackgroundDayExtreme.css new file mode 100644 index 0000000..79e6bab --- /dev/null +++ b/Plants VS Zombies/myCssFile/BackgroundDayExtreme.css @@ -0,0 +1,4 @@ +#pane { + -fx-background-image:url('Background/ExtremeDay.jpg'); + -fx-background-size:cover; +} \ No newline at end of file diff --git a/Plants VS Zombies/myCssFile/BackgroundDayMedium.css b/Plants VS Zombies/myCssFile/BackgroundDayMedium.css new file mode 100644 index 0000000..55d6c33 --- /dev/null +++ b/Plants VS Zombies/myCssFile/BackgroundDayMedium.css @@ -0,0 +1,4 @@ +#pane { + -fx-background-image:url('Background/MediumDay.jpg'); + -fx-background-size:cover; +} \ No newline at end of file diff --git a/Plants VS Zombies/myCssFile/BackgroundNightEasy.css b/Plants VS Zombies/myCssFile/BackgroundNightEasy.css new file mode 100644 index 0000000..ff1b565 --- /dev/null +++ b/Plants VS Zombies/myCssFile/BackgroundNightEasy.css @@ -0,0 +1,4 @@ +#pane { + -fx-background-image:url('Background/EasyNight.png'); + -fx-background-size:cover; +} \ No newline at end of file diff --git a/Plants VS Zombies/myCssFile/BackgroundNightExtreme.css b/Plants VS Zombies/myCssFile/BackgroundNightExtreme.css new file mode 100644 index 0000000..7c1bde7 --- /dev/null +++ b/Plants VS Zombies/myCssFile/BackgroundNightExtreme.css @@ -0,0 +1,4 @@ +#pane { + -fx-background-image:url('Background/ExtremeNight.png'); + -fx-background-size:cover; +} \ No newline at end of file diff --git a/Plants VS Zombies/myCssFile/BackgroundNightMedium.css b/Plants VS Zombies/myCssFile/BackgroundNightMedium.css new file mode 100644 index 0000000..820a6c7 --- /dev/null +++ b/Plants VS Zombies/myCssFile/BackgroundNightMedium.css @@ -0,0 +1,4 @@ +#pane { + -fx-background-image:url('Background/MediumNight.png'); + -fx-background-size:cover; +} \ No newline at end of file diff --git a/Plants VS Zombies/myFXMLFile/Game_over.fxml b/Plants VS Zombies/myFXMLFile/Game_over.fxml new file mode 100644 index 0000000..70feccf --- /dev/null +++ b/Plants VS Zombies/myFXMLFile/Game_over.fxml @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Plants VS Zombies/myFXMLFile/UI.fxml b/Plants VS Zombies/myFXMLFile/UI.fxml new file mode 100644 index 0000000..6ac4d4b --- /dev/null +++ b/Plants VS Zombies/myFXMLFile/UI.fxml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Plants VS Zombies/myFXMLFile/recording_page.fxml b/Plants VS Zombies/myFXMLFile/recording_page.fxml new file mode 100644 index 0000000..de41e85 --- /dev/null +++ b/Plants VS Zombies/myFXMLFile/recording_page.fxml @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Plants VS Zombies/myFile/GameScore.txt b/Plants VS Zombies/myFile/GameScore.txt new file mode 100644 index 0000000..e811cea --- /dev/null +++ b/Plants VS Zombies/myFile/GameScore.txt @@ -0,0 +1,2676 @@ +Ahmad +0 +Amir +0 +Gheyme +0 +Ahmad +40 +Gheyme +50 +Ahmad +30 +Ghorme +0 +Ahmad +150 +Ghorme +70 +Ahmad +70 +Ahmad +60 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +40 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +50 +Ahmad +40 +Ahmad +50 +Ahmad +690 +Ahmad +140 +Ahmad +560 +Ahmad +410 +Ahmad +140 +Ahmad +220 +Arman +0 +Arman +270 +Ahmad +70 +Ahmad +330 diff --git a/Plants VS Zombies/myFile/LogIn.txt b/Plants VS Zombies/myFile/LogIn.txt new file mode 100644 index 0000000..1b8ac7a --- /dev/null +++ b/Plants VS Zombies/myFile/LogIn.txt @@ -0,0 +1 @@ +Ahmad \ No newline at end of file diff --git a/Plants VS Zombies/myFile/SignIn.txt b/Plants VS Zombies/myFile/SignIn.txt new file mode 100644 index 0000000..b07874d --- /dev/null +++ b/Plants VS Zombies/myFile/SignIn.txt @@ -0,0 +1,10 @@ +Ahmad +Asadi +Amir +King +Gheyme +Bademjoon +Ghorme +Sabzi +Arman +Ahmadi diff --git a/Plants VS Zombies/myPicture/2.png b/Plants VS Zombies/myPicture/2.png new file mode 100644 index 0000000..e1cdb5b Binary files /dev/null and b/Plants VS Zombies/myPicture/2.png differ diff --git a/Plants VS Zombies/myPicture/3.png b/Plants VS Zombies/myPicture/3.png new file mode 100644 index 0000000..6513c13 Binary files /dev/null and b/Plants VS Zombies/myPicture/3.png differ diff --git a/Plants VS Zombies/myPicture/5.png b/Plants VS Zombies/myPicture/5.png new file mode 100644 index 0000000..73d0bac Binary files /dev/null and b/Plants VS Zombies/myPicture/5.png differ diff --git a/Plants VS Zombies/myPicture/Background/BackGround.jpg b/Plants VS Zombies/myPicture/Background/BackGround.jpg new file mode 100644 index 0000000..fd17a06 Binary files /dev/null and b/Plants VS Zombies/myPicture/Background/BackGround.jpg differ diff --git a/Plants VS Zombies/myPicture/Background/GameOver.jpg b/Plants VS Zombies/myPicture/Background/GameOver.jpg new file mode 100644 index 0000000..367a0f9 Binary files /dev/null and b/Plants VS Zombies/myPicture/Background/GameOver.jpg differ diff --git a/Plants VS Zombies/myPicture/Background/MenuBackground.png b/Plants VS Zombies/myPicture/Background/MenuBackground.png new file mode 100644 index 0000000..62d6f26 Binary files /dev/null and b/Plants VS Zombies/myPicture/Background/MenuBackground.png differ diff --git a/Plants VS Zombies/myPicture/Chain-Transparent-Background-PNG.png b/Plants VS Zombies/myPicture/Chain-Transparent-Background-PNG.png new file mode 100644 index 0000000..6251f45 Binary files /dev/null and b/Plants VS Zombies/myPicture/Chain-Transparent-Background-PNG.png differ diff --git a/Plants VS Zombies/myPicture/Coin.png b/Plants VS Zombies/myPicture/Coin.png new file mode 100644 index 0000000..fd15098 Binary files /dev/null and b/Plants VS Zombies/myPicture/Coin.png differ diff --git a/Plants VS Zombies/myPicture/Gladiator.png b/Plants VS Zombies/myPicture/Gladiator.png new file mode 100644 index 0000000..95ab63b Binary files /dev/null and b/Plants VS Zombies/myPicture/Gladiator.png differ diff --git a/Plants VS Zombies/myPicture/Grave.png b/Plants VS Zombies/myPicture/Grave.png new file mode 100644 index 0000000..4a6a153 Binary files /dev/null and b/Plants VS Zombies/myPicture/Grave.png differ diff --git a/Plants VS Zombies/myPicture/JackInTheBoxZombie.png b/Plants VS Zombies/myPicture/JackInTheBoxZombie.png new file mode 100644 index 0000000..3e106ed Binary files /dev/null and b/Plants VS Zombies/myPicture/JackInTheBoxZombie.png differ diff --git a/Plants VS Zombies/myPicture/LawnMower.png b/Plants VS Zombies/myPicture/LawnMower.png new file mode 100644 index 0000000..4092326 Binary files /dev/null and b/Plants VS Zombies/myPicture/LawnMower.png differ diff --git a/Plants VS Zombies/myPicture/Leaf3.png b/Plants VS Zombies/myPicture/Leaf3.png new file mode 100644 index 0000000..c036e95 Binary files /dev/null and b/Plants VS Zombies/myPicture/Leaf3.png differ diff --git a/Plants VS Zombies/myPicture/Pea.png b/Plants VS Zombies/myPicture/Pea.png new file mode 100644 index 0000000..0296b36 Binary files /dev/null and b/Plants VS Zombies/myPicture/Pea.png differ diff --git a/Plants VS Zombies/myPicture/PeaShooter.png b/Plants VS Zombies/myPicture/PeaShooter.png new file mode 100644 index 0000000..8a89b75 Binary files /dev/null and b/Plants VS Zombies/myPicture/PeaShooter.png differ diff --git a/Plants VS Zombies/myPicture/PotatoMine.png b/Plants VS Zombies/myPicture/PotatoMine.png new file mode 100644 index 0000000..374d371 Binary files /dev/null and b/Plants VS Zombies/myPicture/PotatoMine.png differ diff --git a/Plants VS Zombies/myPicture/PotatoMineUnder.png b/Plants VS Zombies/myPicture/PotatoMineUnder.png new file mode 100644 index 0000000..b97284d Binary files /dev/null and b/Plants VS Zombies/myPicture/PotatoMineUnder.png differ diff --git a/Plants VS Zombies/myPicture/PvZ.png b/Plants VS Zombies/myPicture/PvZ.png new file mode 100644 index 0000000..310a494 Binary files /dev/null and b/Plants VS Zombies/myPicture/PvZ.png differ diff --git a/Plants VS Zombies/myPicture/Repeater.png b/Plants VS Zombies/myPicture/Repeater.png new file mode 100644 index 0000000..6ad173d Binary files /dev/null and b/Plants VS Zombies/myPicture/Repeater.png differ diff --git a/Plants VS Zombies/myPicture/SeedPictures/Cherry_Bomb_Seed_Packet.png b/Plants VS Zombies/myPicture/SeedPictures/Cherry_Bomb_Seed_Packet.png new file mode 100644 index 0000000..97580d7 Binary files /dev/null and b/Plants VS Zombies/myPicture/SeedPictures/Cherry_Bomb_Seed_Packet.png differ diff --git a/Plants VS Zombies/myPicture/SeedPictures/Jalapeno_Seed_Packet_%28PvZ2%29.png b/Plants VS Zombies/myPicture/SeedPictures/Jalapeno_Seed_Packet_%28PvZ2%29.png new file mode 100644 index 0000000..bcee6b7 Binary files /dev/null and b/Plants VS Zombies/myPicture/SeedPictures/Jalapeno_Seed_Packet_%28PvZ2%29.png differ diff --git a/Plants VS Zombies/myPicture/SeedPictures/PeashooterSeed.png b/Plants VS Zombies/myPicture/SeedPictures/PeashooterSeed.png new file mode 100644 index 0000000..d64163a Binary files /dev/null and b/Plants VS Zombies/myPicture/SeedPictures/PeashooterSeed.png differ diff --git a/Plants VS Zombies/myPicture/SeedPictures/PotatoMineSeed.png b/Plants VS Zombies/myPicture/SeedPictures/PotatoMineSeed.png new file mode 100644 index 0000000..a937957 Binary files /dev/null and b/Plants VS Zombies/myPicture/SeedPictures/PotatoMineSeed.png differ diff --git a/Plants VS Zombies/myPicture/SeedPictures/RepeaterSeed.png b/Plants VS Zombies/myPicture/SeedPictures/RepeaterSeed.png new file mode 100644 index 0000000..d7f4564 Binary files /dev/null and b/Plants VS Zombies/myPicture/SeedPictures/RepeaterSeed.png differ diff --git a/Plants VS Zombies/myPicture/SeedPictures/SunflowerSeed.png b/Plants VS Zombies/myPicture/SeedPictures/SunflowerSeed.png new file mode 100644 index 0000000..521bb7b Binary files /dev/null and b/Plants VS Zombies/myPicture/SeedPictures/SunflowerSeed.png differ diff --git a/Plants VS Zombies/myPicture/SeedPictures/WallNutSeed.png b/Plants VS Zombies/myPicture/SeedPictures/WallNutSeed.png new file mode 100644 index 0000000..61ff6d0 Binary files /dev/null and b/Plants VS Zombies/myPicture/SeedPictures/WallNutSeed.png differ diff --git a/Plants VS Zombies/myPicture/SignBoard.png b/Plants VS Zombies/myPicture/SignBoard.png new file mode 100644 index 0000000..bae24a6 Binary files /dev/null and b/Plants VS Zombies/myPicture/SignBoard.png differ diff --git a/Plants VS Zombies/myPicture/Sun.png b/Plants VS Zombies/myPicture/Sun.png new file mode 100644 index 0000000..df9a372 Binary files /dev/null and b/Plants VS Zombies/myPicture/Sun.png differ diff --git a/Plants VS Zombies/myPicture/SunFlower.png b/Plants VS Zombies/myPicture/SunFlower.png new file mode 100644 index 0000000..83c01be Binary files /dev/null and b/Plants VS Zombies/myPicture/SunFlower.png differ diff --git a/Plants VS Zombies/myPicture/Sunflower2.png b/Plants VS Zombies/myPicture/Sunflower2.png new file mode 100644 index 0000000..fa3c069 Binary files /dev/null and b/Plants VS Zombies/myPicture/Sunflower2.png differ diff --git a/Plants VS Zombies/myPicture/WallNut.png b/Plants VS Zombies/myPicture/WallNut.png new file mode 100644 index 0000000..9bb4cda Binary files /dev/null and b/Plants VS Zombies/myPicture/WallNut.png differ diff --git a/Plants VS Zombies/myPicture/Zombie.png b/Plants VS Zombies/myPicture/Zombie.png new file mode 100644 index 0000000..e9f4777 Binary files /dev/null and b/Plants VS Zombies/myPicture/Zombie.png differ diff --git a/Plants VS Zombies/myPicture/gif/ConeHeadZombieGif.gif b/Plants VS Zombies/myPicture/gif/ConeHeadZombieGif.gif new file mode 100644 index 0000000..e92ccf7 Binary files /dev/null and b/Plants VS Zombies/myPicture/gif/ConeHeadZombieGif.gif differ diff --git a/Plants VS Zombies/myPicture/gif/NewspaperZombie.gif b/Plants VS Zombies/myPicture/gif/NewspaperZombie.gif new file mode 100644 index 0000000..f244505 Binary files /dev/null and b/Plants VS Zombies/myPicture/gif/NewspaperZombie.gif differ diff --git a/Plants VS Zombies/myPicture/gif/PeaShooterGif.gif b/Plants VS Zombies/myPicture/gif/PeaShooterGif.gif new file mode 100644 index 0000000..6166eda Binary files /dev/null and b/Plants VS Zombies/myPicture/gif/PeaShooterGif.gif differ diff --git a/Plants VS Zombies/myPicture/gif/PotatoMineGif.gif b/Plants VS Zombies/myPicture/gif/PotatoMineGif.gif new file mode 100644 index 0000000..b92245f Binary files /dev/null and b/Plants VS Zombies/myPicture/gif/PotatoMineGif.gif differ diff --git a/Plants VS Zombies/myPicture/gif/RepeaterGif.gif b/Plants VS Zombies/myPicture/gif/RepeaterGif.gif new file mode 100644 index 0000000..382f418 Binary files /dev/null and b/Plants VS Zombies/myPicture/gif/RepeaterGif.gif differ diff --git a/Plants VS Zombies/myPicture/gif/SunGif.gif b/Plants VS Zombies/myPicture/gif/SunGif.gif new file mode 100644 index 0000000..a4fd8e8 Binary files /dev/null and b/Plants VS Zombies/myPicture/gif/SunGif.gif differ diff --git a/Plants VS Zombies/myPicture/gif/SunflowerGif.gif b/Plants VS Zombies/myPicture/gif/SunflowerGif.gif new file mode 100644 index 0000000..9d5736d Binary files /dev/null and b/Plants VS Zombies/myPicture/gif/SunflowerGif.gif differ diff --git a/Plants VS Zombies/myPicture/gif/WallNutGif.gif b/Plants VS Zombies/myPicture/gif/WallNutGif.gif new file mode 100644 index 0000000..7c39745 Binary files /dev/null and b/Plants VS Zombies/myPicture/gif/WallNutGif.gif differ diff --git a/Plants VS Zombies/myPicture/gif/ZombieGif.gif b/Plants VS Zombies/myPicture/gif/ZombieGif.gif new file mode 100644 index 0000000..42660f8 Binary files /dev/null and b/Plants VS Zombies/myPicture/gif/ZombieGif.gif differ diff --git a/Plants VS Zombies/myPicture/password.png b/Plants VS Zombies/myPicture/password.png new file mode 100644 index 0000000..6d9918f Binary files /dev/null and b/Plants VS Zombies/myPicture/password.png differ diff --git a/Plants VS Zombies/myPicture/user.png b/Plants VS Zombies/myPicture/user.png new file mode 100644 index 0000000..bb2db0c Binary files /dev/null and b/Plants VS Zombies/myPicture/user.png differ