Sprint #2.5 - Creating an HTML5 Game Engine
Product: Tetris2P AI
Sprint #1: July 20 - August 05
Scrum Board: Link
Deliverable: mini5-engine Github Repo
Goals:
- Develop a custom game engine for javascript and HTML5 Canvas - COMPLETED
- Deploy the game engine as a node_module - COMPLETED
- Write an API/Usage Documentation - IN PROGRESS
Method/Metrics:
The goal has been met once the project has been deployed to the npm public repository.
Summary:
So the goals of this project was to make a game engine for javascript and HTML5 canvas. The idea is to make the game completely contained within one html5 canvas, and to closely follow the programming architecture of Unity (with gameObjects and components) but with more flexibility. The main features I made sure to implement were: self contained scenes, click (single, double, drag, hold) detection, key presses, position anchors, and elementary collision detection.
Apart from the game engine, I learned how to create and publish node modules as well as how to use Grunt to minify my project files. There’s much more work I can do to improve the engine before I invite the public to use it, but I’ve made the decision to continue with the Tetris AI project (the main goal of this entire thing) and figure out networking implementations.
Daily Scrums
Saturday [07/20/2019]
Objectives Completed:
- outlined a bit more of what a game engine needs to do
- this was a break day
Sprint #2.5 - Daily Scrum #01
Sunday [07/21/2019]
Objectives Completed:
- designed and detailed required function and variables for the `scene` class
- outlined gameObjects necessary for a tetris game for reference
Sprint #2.5 - Daily Scrum #02
Monday [07/22/2019]
Objectives Completed:
- created engine.js, scene.js, and gameObject.js files/classes
- created the first initial prototype of a scene containing a background and bouncing ball gameObject
Sprint #2.5 - Daily Scrum #03
Tuesday [07/23/2019]
Objectives Completed:
- added keypress and click detection on the canvas along with timers and positions
- started researching how to handle collision detection with AABB's
- fixed issue with onkeyup events not registering when windows/tabs
Sprint #2.5 - Daily Scrum #04
Wednesday [07/24/2019]
Objectives Completed:
- finished creating clickable objects/click detection
- added an `allowClickDetection` function for developers to indicate an object is clickable
Sprint #2.5 - Daily Scrum #05
Thursday [07/25/2019]
Objectives Completed:
- created position anchors for gameObjects so they can describe their position relative to other objects rather than just the canvas
- researched and outlined functions that a '2d physics engine' needs to do/provide
Sprint #2.5 - Daily Scrum #06
Friday [07/26/2019]
Objectives Completed:
- watched tutorial videos of how Unity provides physical object functionality and colliders for reference
Sprint #2.5 - Daily Scrum #07
Saturday [07/27/2019]
Objectives Completed:
- n/a
Sprint #2.5 - Daily Scrum #08
Sunday [07/28/2019]
Objectives Completed:
- added layers for scene objects to organize the order for drawing gameObjects onto the canvas
- outlining how to resolve collisions after detecting them
Sprint #2.5 - Daily Scrum #09
Monday [07/29/2019]
Objectives Completed:
- discussed how to detect direction of collisions and how to resolve them accordingly
Sprint #2.5 - Daily Scrum #10
Tuesday [07/30/2019]
Objectives Completed:
- outlined assumptions and necessary checks to detemine the direction of a collision
Sprint #2.5 - Daily Scrum #11
Wednesday [07/31/2019]
Objectives Completed:
- finished a rewriting a collision function and resolving collision for a mini platformer
- created a mini state machine for sprite rendering in my platformer example
Sprint #2.5 - Daily Scrum #12
Thursday [08/01/2019]
Objectives Completed:
- started researching how to create and deploy node modules
- defined purpose and functions of npm, grunt and bower
Sprint #2.5 - Daily Scrum #13
Friday [08/02/2019]
Objectives Completed:
- went through both npm and grunt tutorials
- learned how to create and add production and developer dependencies to a node package
Sprint #2.5 - Daily Scrum #14
Saturday [08/03/2019]
Objectives Completed:
- researched difference between scope and unscoped packages
Sprint #2.5 - Daily Scrum #15
Sunday [08/04/2019]
Objectives Completed:
- finally set up official github repo and deployed mini5-engine to npm! :)
Sprint #2.5 - Daily Scrum #16
Sprint Review
What went well?
For the first half of the sprint I did a good job of setting goals and staying focused enough throughout the day to complete them, or at least make significant progress towards them. I think this was partly since there was a lot more visual and interactive testing, which made progress more gratifying and enjoyable. In addition, there was more overhead software design to figure out which I guess I also enjoy. Also, heading to cafe’s to get more work done was very helpful, giving me the feeling of having an ‘office’ or a space specifically for productivity. The only thing is that it limits me to doing work on my chromebook. Which isn’t that bad since I can do 90% of what I need to on my chromebook :)
What didn’t go well?
Halfway through I started experiencing a bit of burnout I think? This was mostly in regards to the publishing to the npm part. This might have been since I was struggling processing too many new technologies at the same time (npm, bower, grunt), and figuring out how to make it suit my needs/vision. Not trying to get technical here, but the game engine is mostly aimed towards ‘client side’ javascript, so deploying it as a node package was a little confusing. Also, during the sprint I started playing minecraft, and I indulged in it a little too much and ruined my sleep and productivity schedule. :)
This sprint also took much longer than I expected, since I was tackling it on a day by day basis, rather than working with a schedule.
What to do next time?
Once again, I need to set a more reasonable sprint schedule with reasonable goals. I included figuring out the functions of a game engine within the sprint, when I should’ve done that first so I could split the project into subgoals and add deadlines in.
I think my note taking process was fine and I should continue with it. The only issues was that it takes too long to transfer all the daily scrums into jekyll posts (the notes are originally taken in google docs), so maybe I should make the jekyll posts on a daily basis before I sleep instead.
I’m gonna make my RPI work clock project before I start the next sprint so I can ‘clock into my productivity mode’ at home also.
I also want to start rating my days based on my performance and productivity.