loading...
Cover image for ๐ŸŽฎ Gaming platform powered by SMS!

๐ŸŽฎ Gaming platform powered by SMS!

vladodev profile image Vladimir Mikulic Updated on ใƒป3 min read

I am very excited to announce that I've built a gaming platform powered by Twilio SMS & Node.js!

๐Ÿคฏ SMS & Gaming, wait, what!?

That's right. Sounds impossible? Well, more on that part later. Essentially, the user can choose between 2 modes in which he/she wants to play. Each mode has it's own features/commands.

Commands allow a user to perform an action. This concept is inspired by Telegram's bot commands. Each command has this format: /<letter>

Some examples of commands that the platform exposes:

  • /s - switch to the single-player mode
  • /m - switch to multi-player mode
  • /h - help message explaining available commands in the current mode

โญ Single-player mode

In the single-player mode, the user can choose a game to play by typing its number.

At the moment, the single-player mode has 5 games to choose from. The platform is extendible so if you have a game idea that is a perfect fit for SMS gaming style, feel free to submit the PR and expand our collection. ๐Ÿค You can read the platform architecture and guide on contributing here.

โœจ Multi-player mode

Multi-player mode doesn't have any games by default.

The reason why multi-player mode was made is that it allows users to be creative. They are not limited to X number of games to play. They can create their own game, invite their friends (or make new friends!) and have a great time like Vladimir and James down below. ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

As you can see on the first image, Vladimir uses /c command to create a game session. He enters the name of the game and the number of users the game can have.

We have James on the other side. James has switched to multi-player mode and uses /g command to check if there are any game sessions available to join. He sees Vladimir's game session and joins it with /j command. As each user sends a message, the platform broadcasts them to other players. Just like a WhatsApp group! They can quit the game with /q command.

After they quit the game, they can do whatever else they want to do! Create another game session, list available game sessions, join them, switch to single-player mode. Lots of possibilities!

๐Ÿค” How did you build that?

To be honest, it was a bit challenging. The codebase itself is not very large (1000+ LOC), but there is a lot of state... cough, cough, session management going on behind the scenes. I wanted it to be as simple as possible so everything is stored in memory. This is great because it's a live chat and users want response FAST.

I've left out Redis/Memcached/<put something in here> on purpose because it would add a bit of complexity to the project and also make it harder for everyone to try out. The detailed platform architecture is explained here.

๐Ÿฆ„ Project

Category: Exciting X-Factors
Thumbnail image provided by Freepik
The project is hosted on Github and licensed under MIT license.

๐ŸŽ€ Conclusion

At the end of this post, I want to thank DEV and Twilio for sponsoring this hackathon. The project was fun to build, and I am looking forward to more hackathons in the future.

Have you participated in hackathon & what do you think about my project?
I would like to hear your thoughts in the comment section.
Thank you for reading and bye till the next time!

Posted on by:

vladodev profile

Vladimir Mikulic

@vladodev

Passionate JavaScript Developer | Linux Enthusiast | Google Code-In '19 Winner

Discussion

markdown guide
 

Looks great Vladimir, do you have plans for stuff like using images in the messages ? I'm thinking of something like a battleship that replies with your side of the board

It also reminded me of those old text-based Interactive Fiction type of games like Photopia, although those are closer to reading a book

 

Thank you, Carlos. I like your battleship game idea.
Twilio SMS API supports images, so we can use them.

 

I really like the idea Vladimir. In fact, I'm impressed. And I want our projects to collaborate in some way. I spoke with a lady who has created a project using Flow Studio. All very exciting. I'll look at your code on the weekend.

I haven't checked my LOC total. Maybe a thousand too. Probably more.

 

Thank you very much for your kind words. I am open to collaboration ๐Ÿ‘
I'll have the ARCHITECTURE.md and a small refactor done by the weekend so it will be ready for you to review :)

 

it sounds so interesting,how i wish i can build such a project,thanks to hackathon and twilio,github and dev

 

I appreciate your message, Alex! Don't worry though, the world is full possibilities :)
I am sure that we'll have more hackathons in the future where you'll have a chance to show your skills ๐Ÿš€

 

"It's an interesting gaming platform. I read a lot about it. Since I love gambling, it is interesting to implement this platform in gaming machines. Why do I ask? I like to play online casinos. Recently found a site schweizercasinoclub.com/fr/payment... where a lot of useful information about online casinos for Swiss players. On this site you can also find information about neteller casino bonus. In itself, the gaming industry as a platform for incredible development and innovation.