neoplants's People
neoplants's Issues
Make errors display properly on the views
There are validations in place on all Plant attributes. The desired behavior is for errors to display at the top of the current page whenever an attempt is made to update a Plant with an invalid attribute. The current behavior is that the screen goes completely blank.
Investigate/resolve why `Plant.time_alive` is called multiple times on create
On create, time_alive
is called 6 times, which is interestingly the same amount of validations we have on Plant
- Investigate why that is happening!
- Make it... not happen
- profit!
Offer different kinds of plants and display them on the plant show page
Let's give several options of types of plant (cactus, fern, tulip, tomato plant, etc.).
We can display either a picture of the type of plant on the plant show page, or maybe ASCII art!
We can alter the plant's behavior based on the type of plant (cactuses can go a long time without water, for example).
Prevent plants from being zombies
A plant dies when it reaches zero health. Currently, you can resurrect it by giving it more food, water, etc. and then passing the time by a day. Once a plant is dead, it should be gone forever, so let's make it unalterable once it's dead.
- add
alive
field to DB, withdefault: true
- whenever a plant reaches 0 health,
alive: false
- early return in
update
if plant is not alive - remove ability to update plant on front-end if plant is not alive (remove links)
Add a worker to update plants on a schedule
Current behavior is that the "current time" for the plant is set at creation and is just the time the plant was created, then the user has to move time forward by clicking the "Fast-forward" button. Desired behavior would be to add a background job to update the "current time" regardless of user interaction. The background job will move time forward by one day every 30 minutes so the plant will progress automatically and encourage more frequent user interaction.
Add info about how long a plant has been alive + affirmations
The plant show page should show in plain English how long the plant has been alive, in days.
The plant show page should also display an affirmation based on how long the plant has been alive. The longer a plant has been alive, the more intense the affirmations become! These can be the equivalent of a "badge" or "trophy", so users can accumulate affirmations. The plant show page would then show a five-day affirmation on day 5, then on day 10 it will show both a ten-day affirmation with the five-day affirmation underneath, and so on.
- Create a hash on the Plant model with affirmations for different amounts of time (start with 5, 10, 15, 30 days) (consider moving this to its own Affirmations model later)
- Add
time_alive
method toPlant
class that returns an integer for how long the plant has been alive, in days - On
show
page, at the top, render#{@plant.name} has been alive for #{@plant.time_alive} days
- Under that, display the affirmations according to how long the plant has been alive. Display all affirmations from most to least recent.
Use Action Cable to update front-end when worker updates plant in the background
#3 has to be implemented first though :)
Add ability for plants to grow / change size
If a plant is continuously in a good mood and has good health over a given period of time, it should grow! Let's add a size
attribute with a default of 1
and check every five days to see if the plant is ready to grow. Whether or not a plant grows should take into account its disposition, mood, and overall health. There should not be a maximum size for plants (let's grow some GIANT PLANTS).
Plants do not shrink, but maybe we'd want to include a pruning option in future iterations?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.