Code Monkey home page Code Monkey logo

plants_vs_zombies's Introduction

Plants Vs. Zombies

Implemented a complete and functioning game inspired by Plants vs Zombies in java, comprising of 5 Levels. The game was developed using JavaFX and employs multithreading, and a handful of design patterns.

Pics

Getting Started

This project is not a standalone executable and thus requires the latest JDK and JavafX to be installed on system before you run the game, Thus use a IDE for doing the same. (Preferably IntelliJ - in which it was originally designed and developed)

Design

We have incorporated various design patterns in our javafx based Plants Vs Zombies game including:

  • Adapter design pattern is inclusive in the communication and interaction between the backend logic and the GUI of the game, controller functions help to communicate between the two.
  • State Design pattern: The state of the game elements( Screen , backyard , zombie etc.) keep changing their behaviour in different situations.
  • Factory Design pattern: Whenever a plant is dragged or a pea is shooted, or a zombie is created , an object creation mechanism takes place that develops new objects for each type
  • Observer: There are many components in the game that are dependent on the state of other objects and their behaviour, for eg. the scoreboard that depends on how many zombies are being killed and other states of the backyard.

Implementation

We have implemented our game using javafx for communication with the GUI elements. Here’s a brief runthrough.

  • Main screen is started. 3 option buttons are provided for loading game, starting new , choosing level.
  • As the user chooses the button an event handler is called for the respective button and the control is transferred to the next required screen.
  • Saving is achieved through serialization of the PlantsVsZombies class object. Which is loaded into a file.
  • Image view, labels, text boxes, Grid panes etc. are used to implement gui units in the game
  • Sound effects are added
  • 5 Different Levels are implemented with increasing difficulty.
  • 4 different types of plant classes and three different zombies have been implemented.

Built With

  • Java
  • JavaFX

Version Info

Version : 1.0.1

Authors

plants_vs_zombies's People

Contributors

asmitks avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.