Cornstar – A corn growing game

 

 

 

 

 

Update:

The game is finished. Play Cornstar. 

title

Hello. I’m Jimmy, a famous corn star. I grow corn and sell it to make money so I can buy more seeds to grow corn. My life is like watching grass grow. Except it’s corn.

 Proposition

For this task, I plan on creating a very simple HTML game that allows users to plant seeds and grow corn. There will be 3 types: baby corn, juicy corn, and golden corn. The baby corn is cheap to buy and cheap to sell, but takes a lot less time to grow (3 hours). The golden corn is slightly more expensive, sells for a lot more but takes 40 hours to grow. More patient users will use this option. The juicy corn sits in the middle of these. In addition to this, once the user can afford it, they can expand their farm.

The idea is that people farm the corn to earn money, and are rewarded for patience, better corn takes longer. Expanding their farm gives them more space to grow more corn, and the cycle continues. Users can then look at their friend’s farms and compare them and their current riches.

The database will need to store user data, crop data, and a link table between the crops, which user, and where the crop is planted. The user data will also contain the user’s currency and stats including the number of each type of corn sold.

For advanced features I’ll be setting up a vhost on my local machine. This is an Apache “virtual host” that lets me have multiple root domains on my local machine without having to change settings or move folders. In addition to this, I will put the game up on a real server with a database to show it off to friends.

Another feature, if I get more time, is to add more varieties of corn. For example red corn, popcorn corn and blue corn. These could be unlocked over time. Another feature could be a bad guy crow that eats your corn unless you get a scarecrow. The scarecrows could be upgraded to be scarier for larger farms.

The game will use javascript for the clicking of corn, but the page will need to be refreshed to see progress of corn growth. However, because the corn will be stored as “time planted”, this can be utilized to show at real-time how long until a corn is fully grown.
Although it would be an interesting feature to have plants die if they are unattended, I want the game to allow users to come back at any time in the future and have their fully grown plants ready to harvest as having them die would annoy some users.

Detailed Plan

Login

Behind the scenes, the first part of the system will be the login screen. Without being logged in, the user will be able to view their farm but won’t be able to plant anything. The user must use a login button at the top of his or her screen to login and make edits.
The actual login screen will be a home-page type of screen displaying a logo and fields to enter their username and password. Once this is done, it will redirect to the user’s farm page.

Farm view

In the farm view, when logged in, there will be displayed the current user logged in, the money they have, and a drop-down (select box) for which seed they would like planted, defaulted to normal corn.

Below this is the game board which will look like a typical chess board, but each corn image will be drawn from top to bottom and can grow higher than the square by 3 times.

20140327035728

 

By default, and no upgrades, the user will have a 6 X 2 large farm and must grow corn in this area to afford to upgrade to a larger one, 8 x 3. The next upgrade will be 10 x 4, then 12 x 6, then every upgrade after that adds 4 to the Y axis, for example 12 x 10, 12 x 14 etc. This is because web pages typically are scrolled down rather than across.

When editing, the user selects the square at the base of the corn. Clicking an empty space of ground will plant the selected seed. Clicking on fully grown corn will harvest it and give the player money. If the user doesn’t have enough money for a seed, they cannot plant any corn. The user will be able to see their friend’s farms, but need to be logged in to make edits of their own.

When viewing a user’s farm while not logged in, there will be a big bright button telling users to create their own corn farm.

Leave a Reply

Your email address will not be published. Required fields are marked *