Like A Girl

Pushing the conversation on gender equality.

Code Like A Girl

Why is my code working?? Don’t touch it.

Why is my code working? … Don’t touch it.

I am not a video game person. The last game I (willingly) played was Mario Kart on Nintendo 64 in elementary school. I think I missed the boat on shedding tears over older siblings unplugging your console right at the precipice of greatness.

However, what I did discover this week was how f*cking awesome games are for learning how to code.

An abridged tour of my inner-monologue this week:

  1. Why can’t I see anything on the page?
  2. WTF do you mean DOMDisplay isn’t defined?? It’s literally right. there.
  3. Why is my character moving like there’s a rocket under its ass??
  4. I swear I didn’t change a thing. Why is it working now?? Don’t touch it, Kamila. Don’t touch it.

This week I struggled with feeling okay with not knowing everything. My platform game was loosely built following a tutorial. A lot of the code was there along with ample explanation, but I did not feel comfortable with the extent to which I knew that I would not have been able to implement this game on my own.

As the week progressed, I took a step back and realized that that is precisely why the tutorial exists. If everyone following the tutorial already knew how to build the damn thing, it wouldn’t exist. Take a breath.

All said — I understood ~80% of my code, which is 100% more than I understood on Monday. I need to be kind to myself.

Here’s some nuggets that I took away from this week:

  1. ES6 makes it infinitely easier for me to compartmentalize my thoughts and follow game logic. Being able to see classes with clean method declarations all neatly organized is heaven sent. Even though this tutorial utilized ES5 syntax, I plan on refactoring this project in a few weeks using ES6 to see if I can’t glean a deeper understanding of some of the logic.
  2. I need to do some more exploration on .appendChild() . It was used heavily throughout the tutorial code, and I want to make sure I have a firm grasp on it.
  3. Implementing game motion is a ton of trial and error. Hence the aforementioned “why is my character moving like there’s a rocket under its ass???”. It takes a bunch of tries to get characters to move at a logical and smooth pace, while mimicking “gravity” as they fall from platform to platform.
  4. I am 100% no longer intimidated by having to connect HTML, CSS, and JavaScript files together. I don’t know why this task always seemed daunting to me. I am happy to have that competency checked off.
Check out my GitHub repo for this bad boy!