A game is the complete exploration of freedom within a restrictive environment.
Vineet Raj Kapoor
Let my web-game-creating career begin π₯³!
Today, I would like to present my first game for the web called Simon Says, and I did it all using web components.
Without further ado, let's just jump in.
The game
Here she is: the web game component more powerful than Superman, Batman, Spider-Man, and the Incredible Hulk put together!
In Simon Says, once the game starts, the CPU π€ will light up some boxes on the screen. Your objective is to tap the boxes that were lit up by the CPU π€, but you'll have to wait your turn to do so.
This version of Simon Says resembles the electronic version more than the kids version.
You could see it more-or-less like a memory game β or a game of "follow the leader"πΆββοΈπΆββοΈπΆββοΈ.
A little history
This is not my first time making this game. I made it back while I was in college NOT studying for my classes. I made the game in C++ with a GUI framework called Qt. I really wanted to make a game because I knew that was what C++ was mostly made for (at least so I thought).
That project was successful but I ran into an issue: I lost all the code! How it happened doesn't matter. The whole incident proves why the web could be a better solution for (some) games. If I had the game online, maybe I would still be playing it by now; all I would need to do is host it.
That is definitely not the only reason I prefer web to native game development. Here are a couple more:
- The web has no build steps. Goodbye to waiting for 2 hours of compilation for 2 lines of changes to source code.
- I can add games as part of any web page just by dropping a web component in.
- You can add games as part of your web pages by just copying and pasting my web component. (Don't worry, you couldn't go to jail even if I wanted to snitch π.)
- It's cross-platform. Players can use the browsers on their phones, laptops, desktops, tabs, smart TV, Raspberry Pis etc. to access web games.
- Everyone uses the web, making marketing and discoverability easy.
- I can update my game whenever I want. Players get the latest updates as long as they are online.
- I can send a link to anyone and they get instant access to the game.
- I could get and control analytics if I want. (I don't.)
- The web is ubiquitous; you can play anywhere, anytime.
"Why'd you do it?"
- To see if I could get web components working on my blog.
- To see if I could build a full game using JavaScript without losing my sanity.
- For fun.
- To prove the simplicity involved in creating games for the web.
"How can I use it in my website?"
Simple. Add this to your HTML page:
<script type="module" src="https://mmhq.me/static/js/wc/simon-says/simon-says.js"></script>
<simon-says></simon-says>
Future plans
I plan to fix any bugs and to enhance it much more with animations and better scoring when I get the chance.
I also plan to make more game web components and display them all in an upcoming Wall of Game. Stay tuned!
The bottom line
I hope you have as much fun playing this game as I had making it.
Feel free to send feedback via email of your the highest score or complaints, criticisms, comments, or compliments you have on your mind.
And yes of course, 3D games are coming next (in 2034 π).