A simple, yet addictive turn-based game of buying and selling, in which users compete against scenarios to maximize their profits and pay off their bank loan.
I created this game as part of a Web Development course I took in the Winter/Spring of 2019.
Farmer's Market is a simple game of buying and selling.
The premise of the game is simple: You begin with $1000 loan to start your fruit and vegetable stand.
Every day, you are given a new scenario will cause produce prices to fluctuate. Your goal is to take advantage of swings in the market to earn a profit – buy low, sell high!
Each day you may make one transaction - buy, sell, or doing nothing (also considered a transaction).
But be on the look out, the bank comes knocking every 7 days and collects $25 from your cash on hand.
If you can survive till your loan is paid off, you win!
However, if you default on your debt - it's straight to debtor's prison! you lose!
This app was my first project during a Software Engineering Immersive course at General Assembly in Washington, DC.
It uses HTML, CSS, and Javascript, and attempts to use SVG graphics as often as possible.
To play the game, feel free to visit the live site at: https://pnblake.com/farmers-market-game/
If you would like to tinker with the code, feel free to fork this repository and clone it.
In the future, it'd be nice to completely refresh the UI, as well as add a "net worth" section with takes into account cash-on-hand and the value of fruit held in the inventory.
I'd also like to add a leaderboard (90s arcade style) for those finish the game.
And, it would be nice to tweak the loan amount so that gameplay is not nearly as long as it is right now.
I'd also like to considing making the sun "set" and "rise" with each newDay() function call, as a visual signal to the user that a new day has begun.
I'm open to receiving pull-requests, and/or receiving issues. Thanks for helping out!
- Paul Blake - Portfolio
This project is licensed under the GNU GPL v3 - see the LICENSE.md file for details
A number of websites and apps were used to help make this project possible and as part of my learning process. They are listed below in no particular order.
-
https://mycolor.space/ --> Used for defining a color palette.
-
Vectors by vecteezy.com
-
The Boxy SVG App --> https://boxy-svg.com/ --> Used to edit SVG graphics.
-
https://css-tricks.com/using-svg/ --> For some basics of SVG.
-
https://www.the-art-of-web.com/css/3d-transforms/ --> For understanding CSS animation
-
https://codepen.io/vitoralberto/pen/OPYyYB --> For help with inifinate rotation animation.
-
https://www.css-gradient.com/ --> For generating a background gradient.
-
https://codepen.io/sandstedt/pen/NxNGPd --> For blurring elements using CSS (in this case, the sun graphic)
-
https://stackoverflow.com/questions/1527803/generating-random-whole-numbers-in-javascript-in-a-specific-range --> For help with generating random numbers in a defined range.
-
https://stackoverflow.com/questions/3163070/javascript-displaying-a-float-to-2-decimal-places --> For help manipulating some of my larger floating point number variables.
-
https://stackoverflow.com/questions/9561625/checking-value-of-radio-button-group-via-javascript --> For help with working with radio button forms.
-
https://www.favicon-generator.org/ --> For quickly and easily generating FavIcons of the necessary size.
-
https://www.webdesignerdepot.com/2012/10/creating-a-modal-window-with-html5-and-css3/ --> For help creating the opening modal.