Inspiration
The platformer genre is a staple among video game genres, and home to classic characters like Mario, Sonic, Kirby, Megaman, Crash Bandicoot, the list goes on. But there's only so many ways that new platformers can innovate upon the classic formula until people grow tired of the genre. So that begs the question: What's next for platformers? We believe the answer to that question is converting real world images to functional levels using Facebook's image segmentation API, "Detectron".
Instructions
To run our game, you must first launch our central manager and have a file named "HTNE_image.jpg" in the same directory as the game files. The manager will then call on a Google Colaboratory/Colab notebook and run Facebook's image segmentation AI. The program will run on its own, likely over the course of 30 seconds, but you will be prompted to put in an image. After you run the image through Facebook's Detectron AI, the program will output the original image and a version of the image that the game uses to make platforms. You must then download these images and put them in the same directory as the game files. Once both images are located in the game files the game is automatically launched in a Pygame window. This may take 10 seconds You then decide the locations of the Star to complete the level, the obstacles to avoid and the player spawn location! Use "WASD" to move, "Space" to jump, "R" to restart and "T" to toggle between regular image view and what the program sees.
How we built it
The entirety of this project was coded in Python and split into three programs. The first program is a central manager file that uses the os, keyboard and webbrowser python libraries to call on the other programs our directory. The second program was created in Google Colab and it calls on Facebook Detectron AI and runs the user-inputted image to do so. The last program is our game file that uses Pygame and calls upon the various images that we made and the Colab code generated to run. We designed the player sprites as well!
Challenges we ran into
The biggest difficulties we had when coding this project were opening and running Google Colaboratory from the Manager.py program, dealing with irregular shapes generated by the AI and producing viable stages using the Facebook Detectron API. We considered a variety of different additional downloads and libraries to run our program and make sure it was as user-friendly as possible but we ultimately concluded that the tools we used were the best for the job and we are very satisfied with the results!
Accomplishments that we're proud of
This project was filled with a lot of firsts! One of our members had never even used Python before Friday! From new libraries and new APIs to executing code in the terminal from IDLE and Google Colaboratory, there was a lot of new skills that we picked up for our project. So the fact that we managed to create a fully functioning game that works how we want it to means the world to us.
What's next for Stick-Man in Photo-Land
Saving, sharing and a streamlined photo import process.
Built With
- facebook-detectron
- google-colaboratory
- pygame
- python
- python-package-index

Log in or sign up for Devpost to join the conversation.