VirusShooter – A Webcam-Based Game


Somewhere around the third year of my undergraduate studies, I once played an interesting game on my friends cellphone. The name of the game is ‘Attack of The Killer Virus‘. It is a shooting game, but the interesting part about this game is that it uses the cellphone’s camera for its gameplay. So, you are ‘like’ scanning your surrounding with the cellphone’s camera for killer virus and trying to shoot it by putting it in your crosshair. Everytime you move around to scan for the viruses, the game somehow detects your movement from the image feed and adjust the viruses’ position accordingly. So, it looks like the viruses were there in your surrounding, but only visible from your cellphone’s camera. It was very fun. Too bad, this game can not be played during a class because you need to move around to find the viruses.

At that time, I was just a third year student trying to survive in the jungle of aerospace engineering. I don’t know a thing about image processing and how does the game work. So, I just borrowed my friend’s cellphone and played the game until his battery died. Now, that I’ve done my thesis on particle image velocimetry, I kinda understand how it works a little.  However, it is not until earlier this month that I suddenly remembered this game and decided to make the simpler version of it for my MATLAB Fun Toolbox. So, there goes my free time for this month, for making a webcam-based shooting game. (Oh Yeah!)

After two weeks of experimenting and code drafting, I finally finished coding the game. Unfortunately, I don’t have any USB webcam or other compatible image acquisition device. As the consequence, I, like it or not, must use my integrated webcam to check the code. So, yesterday morning, I went to my lab, ran the game, and moved around with my laptop like a retard, trying to check the code. Luckily, the code works just find, although it started to make error in the movement detection when the laptop is moving too fast. However, I was satisfied and decided to share it here anyway. So, here it is, a video of me, playing VirusShooter with my integrated webcam:/.

As usual, I’m going to share this code in my MATLAB Fun Toolbox page. I’ve also uploaded the code MathWorks file exchange site, so you can download it from there  (but it is still being reviewed by the time I posted this post, so you may need to wait for a while:D). I’m also going to explain the algorithm of this game, but I’m going to save it for my next post. It’s 2AM now in the morning and my eyes are killing me. So, I’m going to bed now.

Regards,

0X_R

Update for this post: VirusShooter – The Algorithm

This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s