A sprout of a game
August 18, 2017
Wooooo, I started coding!
- Live demo here: Click within the top half of the soil to plant a seed, then keep clicking the
<canvas>
to make the plant grow from the seed! It’ll grow in a different random walk each time. - Source code at this point in history
And here’s a video of the action:
The actual game will not involve clicking a canvas to make the plant grow - you’ll need to give it water and love and attention etc. But I’m going with this for now, just to get the random generation part working.
Implementation Notes
- I’m just coding everything in raw HTML, CSS and JavaScript (ES6+), using
canvas
andfillRect
. - I made this
CanvasGrid
object that keeps track of each “pixel” of the world, then different objects (such asPlant
andGround
) update it. We’ll see if this structure works long-term. - Hehe object-oriented design for games is fun. You have code like this, where
ground.addSeed
returns aPlant
:)
Pixel Art Notes
The art of this game is important to me (and to the game!), but I’m very new to pixel art. I found MortMort’s YouTube channel super helpful for tips on creating pixel drawings, esp this video:
I’ve already incorporated the “Avoiding doubles” tip in my plant generation, for a smoother pixel line. I think on Monday I’ll try to incorporate his “Avoid jaggies” suggestion as well.
Presentation
- I also gave a little presentation on Thursday on “Beginning” a project, for the beginner-themed Thursday presentations.
- lol rambled too much about Tamagotchis and the “millenials and plants” phenomenon to get to much actual content, but it was fun! Giving a talk was a nice way to force me to make some progress on the game, haha, and it sparked some super fun conversations afterward.
- (Sparse slides here, if you insist)
For Monday
- Decide how vines should split
- Avoid Jaggies when growing vines
- Implement!