Coder Social home page Coder Social logo

nbayrouti3 / farm-world-javafx-game Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amfatykhova/farm-world-javafx-game

0.0 1.0 0.0 20.67 MB

This is a game that I developed along with my project team for CS 2340 at Georgia Tech

CSS 2.18% Python 14.27% Java 83.55%

farm-world-javafx-game's Introduction

Farm World Game Demo Video

Watch the video

These are the Java class files for the Farm World game for CS 2340.

Main.java: this is the main class that launches the javaFX game

  • harvest mechanism
  • market place mechanism
  • inventory opened
  • all UI elements created Methods: - start() - startGame() - configFarmUI() - openInventory() - configOptionsScreen() - configFarmScreen() - goToGameOverScreen() - setUpPlots() - setPlantingListeners() - plantAction() - setUpMarket() - updatePlots() - refreshBox() - main()

Player.java: this is the player object that stores:

  • String name
  • Inventory inventory
  • FarmWorldConfigurations.Difficulty difficulty
  • int balance
  • int day
  • int plotHarvestLimit
  • int plotsHarvestedToday
  • int plotWateringLimit
  • int plotsWateredToday Methods: - Player() - init() - sellItem() - buyItem() - incrementDay() - getRandomEvent() - getName() - getInventory() - getBalance() - getDay() - setName() - getPlotsHarvestedToday() - getPlotHarvestLimit() - incrementPlotsHarvested() - getPlotsWateredToday() - getPlotWateringLimit() - incrementPlotsWatered() - getDifficulty()

FarmWorldConfigurations.java: this is the configurations object that stores:

  • Difficulty difficulty (enum)
    • EASY(1.0)
    • MEDIUM(0.75)
    • HARD(0.5)
  • String seed
  • String season Methods: - FarmWorldConfigurations() - getDifficulty() - setDifficulty() - getSeed() - setSeed() - getSeason() - setSeason() - getStartingMoney() - getStartingItems()

Farm.java: this is the farm object

  • int money
  • int day Methods: - Farm() - incrementDay() - setMoney() - getMoney() - getDay()

Inventory.java: this is the inventory object

  • Map<Item, Integer> items
  • int capacity
  • int size Methods: - Inventory() - remove() - add() - getItemMap() - getCapacity() - getSize()

Item.java: this is the item enum (implements Marketable)

  • MELON
  • POTATO
  • PUMPKIN
  • WHEAT
  • MELON_PESTICIDES
  • POTATO_PESTICIDES
  • PUMPIN_PESTICIDES
  • WHEAT_PESTICIDES
  • PESTICIDE
  • FERTILIZER
  • TRACTOR
  • IRRIGATION
  • PLOTS
  • int basePrice
  • int startingQuantity Methods: - Item() - getDisplayName() - toConcat() - getPrice() - getQuantity() - setPrice()

Market.java: this is the market object

  • Map<Item, Integer> prices Methods: - Market() - getItemMap()

Marketable.java: this is the Marketable interface Methods: - getPrice() - getQuantity()

Maturity.java: this is the maturity enum

  • EMPTY
  • SEED
  • SPROUT
  • IMMATURE
  • MATURE
  • DEAD
  • String order Methods: - Maturity() - getOrder()

MediaControler.java: this is the media controller class

  • MediaPlayer introPlayer
  • MediaPlayer buttonPlayer
  • MediaPlayer plantPlayer
  • MediaPlayer gameOverPlayer
  • MediaPlayer winPlayer Methods: - playIntro() - playClick() - playHarvest() - playPlant() - playGameOver() - playWin() - stopIntro() - stopGameOver()

Plot.java: this is the plot object

  • Item plant
  • Maturity maturity
  • Button button
  • int size
  • boolean hasPesticides
  • int minWater
  • int maxWater
  • int waterLevel
  • int minFertilizerLevel
  • int maxFertilizerLevel
  • int fertilizerLevel Methods: - Plot() - grow() - getButton() - getPlant() - setPlant() - getMaturity() - harvest() - plantSeed() - setTooltip() - waterPlot() - waterUp() - waterDown() - getWaterLevel() - waterLevelCheck() - kill() - applyPesticides() - removePesticides() - getPesticides() - getFertilizerLevel() - addFertilizer() - decrementFertilizerLevel()

farm-world-javafx-game's People

Contributors

kennyakers avatar amfatykhova avatar nbayrouti3 avatar

Watchers

James Cloos 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.