Creating A Game Using Pictoblox Machine Learning With Hand Gestures

 Creating A Game Using Pictoblox Machine Learning With Hand Gestures

Have you ever thought about creating a game? Maybe yes... but you couldn't because you never got the chance to do it or maybe you didn't how to.

Well, I have just the right thing- Pictoblox! 

Pictoblox is a software created by MIT for kids to do simple block coding or even advanced Python coding. It's available for free and you can download it from Google on your PC. It's easy. Just go to the following link to download the app.


Set up the app by creating an account and signing in. After installing, you'll see this default homepage.















Click on the 'Add Blocks' button and add the Hand Pose Classifier type of project in The Create New Project option.



















You'll see this window and then add classes 'Up', 'Down', 'Left', 'Right' and 'Nothing'. 

















Open the Webcam option for every class one at a time and click at least 500 pictures of yourself holding your hand in different positions respective to the class name. While doing the 'Nothing' class just click random pictures when the blue dots appear.

















After doing that click on the Train Model option and let it train the model for a couple of minutes.
















After the model training is complete, test your model by clicking the option on the right side. After testing the model, export the model in the 'Blocks' option.



















After exporting the model, add a sprite named Beetle from the sprite option and add 2 backdrops- one from your computer and one from the backdrop option.



















The backdrop you have to upload is a maze image without an apple👆.

The second one you have to upload is the Maze backdrop with the apple👇.



















After doing this, add the following code step-wise as provided in the following images...

1. In this step, we define the position, direction and size of the beetle when we click the green flag.

2. In this step, we see our Machine Learning blocks which we have to add later.

3. In this step, we add the Hand Pose identifying block so that it will identify the direction of our hand and the beetle would move in the same direction.

4. In this step, we add the sensing blocks so that if the beetle touches the maze's border it'll come to the starting spot again and when it touches the apple the backdrop would change to a Maze without an apple.


After this, save the project, rename it and then start playing!

I've provided a video below of me playing the game. ENJOY!


Thank You!






















Comments

Popular posts from this blog

Creating a Home Automation Project Using Xiao board and Wi-Fi

Making a Neon LED Sign Board

Creating a Home Automation Project Using MIT App Inventor