Develop a game that is currently not on the Google Play Store — Part 1

SHRINATH BHAT
14 min readJan 26, 2023

--

Image Credits: https://www.sourcecodester.com

There are a wide variety of games available on the Google Play Store for Android devices. These games range from simple casual games like Angry Birds and Candy Crush to more complex and immersive games like Minecraft and Grand Theft Auto.

There are also a variety of different genres of games available, such as action, adventure, puzzle, racing, and strategy. In addition to traditional games, there are also many games that are designed for virtual reality, augmented reality, and other innovative technologies. The Google Play Store makes it easy for users to find and download games that suit their interests and preferences. The store also offers a rating system that allows the users to check the rating of the game before downloading it and also provides the users to leave a review after playing the game. Overall, the Google Play Store offers a vast selection of games for users to enjoy, and new games are being added all the time.

What are a few examples of games that are currently not available on the Google Play Store?

There are many games that currently are not available on the Google Play Store. Here are a few examples:

  1. Text-based adventure games: These games are based on interactive storytelling and can be coded using Python or other programming languages.
  2. Platformers: These games feature a character jumping and running through different levels, and can be coded using game engines like Unity or Unreal Engine.
  3. Puzzle games: These games can include logic-based puzzles, match-3 games, and other types of brain teasers, and can be coded using game development frameworks like Cocos2d or Pygame.
  4. Multiplayer games: These games can include online multiplayer games like first-person shooters, battle royale games, and MOBAs, and can be coded using game development frameworks like Unity or Unreal Engine.
  5. Virtual reality games: These games can be coded using game development frameworks like Unity or Unreal Engine and require a virtual reality headset to play.

Let’s look at text-based adventure games!

Here is an example of a simple text-based adventure game implemented in Python:

def start_game():
print("Welcome to the adventure game!")
print("You find yourself in a dark forest. What would you like to do?")
print("1. Explore the forest")
print("2. Look for a way out")
print("3. Give up and go home")
choice = input("Enter your choice: ")
if choice == "1":
explore_forest()
elif choice == "2":
look_for_way_out()
elif choice == "3":
give_up()
else:
print("Invalid choice. Please try again.")
start_game()

def explore_forest():
print("As you explore the forest, you come across a clearing.")
print("In the clearing, you see a small cabin.")
print("What would you like to do?")
print("1. Approach the cabin")
print("2. Continue exploring the forest")
choice = input("Enter your choice: ")
if choice == "1":
approach_cabin()
elif choice == "2":
continue_exploring()
else:
print("Invalid choice. Please try again.")
explore_forest()

def approach_cabin():
print("As you approach the cabin, you notice that the door is slightly ajar.")
print("What would you like to do?")
print("1. Enter the cabin")
print("2. Knock on the door")
choice = input("Enter your choice: ")
if choice == "1":
enter_cabin()
elif choice == "2":
knock_on_door()
else:
print("Invalid choice. Please try again.")
approach_cabin()

def enter_cabin():
print("As you enter the cabin, you see an old man sitting by the fireplace.")
print("He greets you and offers you a warm meal.")
print("You accept his offer and spend the night in the cabin.")
print("The next morning, the old man tells you the way out of the forest.")
print("You thank him and continue on your journey.")
end_game()

def knock_on_door():
print("As you knock on the door, you hear a growling noise from inside.")
print("You quickly realize that the cabin is home to a bear.")
print("You run back into the forest, narrowly escaping the bear.")
continue_exploring()

def continue_exploring():
print("As you continue exploring the forest, you come across a river.")
print("What would you like to do?")
print("1. Try to cross the river")
print("2. Follow the river upstream")
choice = input("Enter your choice: ")
if choice == "1":
cross_river()
elif choice == "2":
follow_river()
else:
print("Invalid choice. Please try again.")
continue_exploring()

def cross_river():
print("As you try to cross the river, you slip and fall into the water.")
print("You struggle to stay afloat, but eventually manage to reach the other side.")
print("You are cold and wet, but you continue on your journey.")
continue_exploring()

def follow_river():
print("As you follow the river upstream, you come across a waterfall.")
print("You notice a cave behind the waterfall.")
print("What would you like to do?")
print("1. Enter the cave")
print("2. Continue following the river")
choice = input("Enter your choice: ")
if choice == "1":
enter_cave()
elif choice == "2":
continue_following_river()
else:
print("Invalid choice. Please try again.")
follow_river()

def enter_cave():
print("As you enter the cave, you notice that it is a dead end.")
print("You turn around and head back outside.")
follow_river()

def continue_following_river():
print("As you continue following the river, you eventually reach the edge of the forest.")
print("You are relieved to have found your way out.")
end_game()

def give_up():
print("You decide to give up and go home.")
print("You never find out what was in the forest.")
end_game()

def end_game():
print("The adventure is over.")

def look_for_way_out():
print("You decide to look for a way out of the forest.")
print("As you walk, you come across a fork in the path.")
print("Which way would you like to go?")
print("1. Go left")
print("2. Go right")

choice = input("Enter your choice: ")

if choice == "1":
go_left()
elif choice == "2":
go_right()
else:
print("Invalid choice. Please try again.")
look_for_way_out()

def go_left():
print("As you go left, you come across a dense thicket.")
print("You struggle to make your way through, but eventually reach the other side.")
print("You find yourself at the edge of a cliff.")
print("What would you like to do?")
print("1. Look for a way down")
print("2. Turn back")

choice = input("Enter your choice: ")

if choice == "1":
look_for_way_down()
elif choice == "2":
turn_back()
else:
print("Invalid choice. Please try again.")
go_left()

def go_right():
print("As you go right, you come across a narrow path.")
print("You follow the path and eventually reach a clearing.")
print("You see a sign pointing to the exit of the forest.")
print("You are relieved to have found your way out.")
end_game()

def look_for_way_down():
print("As you look for a way down the cliff, you notice a rope ladder.")
print("You decide to climb down the ladder.")
print("At the bottom of the ladder, you find yourself at the edge of a river.")
print("What would you like to do?")
print("1. Try to cross the river")
print("2. Follow the river upstream")

choice = input("Enter your choice: ")

if choice == "1":
cross_river()
elif choice == "2":
follow_river()
else:
print("Invalid choice. Please try again.")
look_for_way_down()

def cross_river():
print("As you try to cross the river, you notice that it is too deep and fast-flowing.")
print("You decide to turn back and follow the river upstream instead.")
follow_river()

def follow_river():
print("As you follow the river upstream, you come across a waterfall.")
print("You notice a cave behind the waterfall.")
print("What would you like to do?")
print("1. Enter the cave")
print("2. Continue following the river")

choice = input("Enter your choice: ")

if choice == "1":
enter_cave()
elif choice == "2":
continue_following_river()
else:
print("Invalid choice. Please try again.")
follow_river()

def enter_cave():
print("As you enter the cave, you notice that it is a dead end.")
print("You turn around and head back outside.")
follow_river()

def continue_following_river():
print("As you continue following the river, you eventually reach the edge of the forest.")
print("You are relieved to have found your way out.")
end_game()

def turn_back():
print("You decide to turn back.")
print("As you make your way back, you come across a fork in the path.")
print("Which way would you like to go?")
print("1. Go back the way you came")
print("2. Take a different path")

choice = input("Enter your choice: ")

if choice == "1":
go_back()
elif choice == "2":
take_different_path()
else:
print("Invalid choice. Please try again.")
turn_back()

def go_back():
print("As you go back the way you came, you notice that you are getting lost.")
print("You decide to give up and go home.")
print("You never find out what was in the forest.")
end_game()

def take_different_path():
print("As you take a different path, you come across a sign pointing to the exit of the forest.")
print("You are relieved to have found your way out.")
end_game()

start_game()

This uses the input() function to get user input, and the output is displayed in the console.

Adding a graphical interface with Pygame

To add a graphical interface to the text-based adventure game using Pygame, you would need to first install Pygame by running pip install pygame in the command line.

Once Pygame is installed, you can import it into your game code and use it to create a window for the game, display images, play sound and music, and handle user input, etc.

Here’s an example of how you could use Pygame to create graphical interface for the same text-based adventure game:

import pygame

def start_game():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("Welcome to the adventure game!", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You find yourself in a dark forest. What would you like to do?", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("1. Explore the forest", True, (0, 0, 0)), (50, 150))
screen.blit(font.render("2. Look for a way out", True, (0, 0, 0)), (50, 200))
screen.blit(font.render("3. Give up and go home", True, (0, 0, 0)), (50, 250))
pygame.display.update()

# Get player choice
choice = None
while choice is None:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.unicode in ["1", "2", "3"]:
choice = event.unicode

if choice == "1":
explore_forest()
elif choice == "2":
look_for_way_out()
elif choice == "3":
give_up()
else:
screen.blit(font.render("Invalid choice. Please try again.", True, (0, 0, 0)), (50, 300))
pygame.display.update()
start_game()

def explore_forest():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you explore the forest, you come across a clearing.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("In the clearing, you see a small cabin.", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("What would you like to do?", True, (0, 0, 0)), (50, 150))
screen.blit(font.render("1. Approach the cabin", True, (0, 0, 0)), (50, 200))
screen.blit(font.render("2. Continue exploring the forest", True, (0, 0, 0)), (50, 250))
pygame.display.update()

# Get player choice
choice = None
while choice is None:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.unicode in ["1", "2"]:
choice = event.unicode

if choice == "1":
approach_cabin()
elif choice == "2":
continue_exploring()
else:
screen.blit(font.render("Invalid choice. Please try again.", True, (0, 0, 0)), (50, 300))
pygame.display.update()
explore_forest()

def approach_cabin():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you approach the cabin, you notice that the door is slightly ajar.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("What would you like to do?", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("1. Enter the cabin", True, (0, 0, 0)), (50, 150))
screen.blit(font.render("2. Knock on the door", True, (0, 0, 0)), (50, 200))
pygame.display.update()

# Get player choice
choice = None
while choice is None:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.unicode in ["1", "2"]:
choice = event.unicode

if choice == "1":
enter_cabin()
elif choice == "2":
knock_on_door()
else:
screen.blit(font.render("Invalid choice. Please try again.", True, (0, 0, 0)), (50, 250))
pygame.display.update()
approach_cabin()

def enter_cabin():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you enter the cabin, you see an old man sitting by the fireplace.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("He greets you and offers you a warm meal.", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("You accept his offer and spend the night in the cabin.", True, (0, 0, 0)), (50, 150))
screen.blit(font.render("The next morning, the old man tells you the way out of the forest.", True, (0, 0, 0)), (50, 200))
screen.blit(font.render("You thank him and continue on your journey.", True, (0, 0, 0)), (50, 250))
pygame.display.update()
end_game()

def knock_on_door():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you knock on the door, you hear a growling noise from inside.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You quickly realize that the cabin is home to a bear.", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("You run back into the forest, narrowly escaping the bear.", True, (0, 0, 0)), (50, 150))
pygame.display.update()
continue_exploring()

def continue_exploring():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you continue exploring the forest, you come across a river.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("What would you like to do?", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("1. Try to cross the river", True, (0, 0, 0)), (50, 150))
screen.blit(font.render("2. Follow the river upstream", True, (0, 0, 0)), (50, 200))
pygame.display.update()

# Get player choice
choice = None
while choice is None:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.unicode in ["1", "2"]:
choice = event.unicode

if choice == "1":
cross_river()
elif choice == "2":
follow_river()
else:
screen.blit(font.render("Invalid choice. Please try again.", True, (0, 0, 0)), (50, 250))
pygame.display.update()
continue_exploring()

def cross_river():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you try to cross the river, you slip and fall into the water.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You struggle to stay afloat, but eventually manage to reach the other side.", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("You are cold and wet, but you continue on your journey.", True, (0, 0, 0)), (50, 150))
pygame.display.update()
continue_exploring()

def follow_river():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you follow the river upstream, you come across a waterfall.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You notice a cave behind the waterfall.", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("What would you like to do?", True, (0, 0, 0)), (50, 150))
screen.blit(font.render("1. Enter the cave", True, (0, 0, 0)), (50, 200))
screen.blit(font.render("2. Continue following the river", True, (0, 0, 0)), (50, 250))
pygame.display.update()

# Get player choice
choice = None
while choice is None:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.unicode in ["1", "2"]:
choice = event.unicode

if choice == "1":
enter_cave()
elif choice == "2":
continue_following_river()
else:
screen.blit(font.render("Invalid choice. Please try again.", True, (0, 0, 0)), (50, 300))
pygame.display.update()
follow_river()

def enter_cave():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you enter the cave, you notice that it is a dead end.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You turn around and head back outside.", True, (0, 0, 0)), (50, 100))
pygame.display.update()
follow_river()

def continue_following_river():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you continue following the river, you eventually reach the edge of the forest.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You are relieved to have found your way out.", True, (0, 0, 0)), (50, 100))
pygame.display.update()
end_game()

def give_up():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("You decide to give up and go home.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You never find out what was in the forest.", True, (0, 0, 0)), (50, 100))
pygame.display.update()
end_game()

def end_game():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("The adventure is over.", True, (0, 0, 0)), (50, 50))
pygame.display.update()

def look_for_way_out():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("You decide to look for a way out of the forest.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("As you walk, you come across a fork in the path.", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("Which way would you like to go?", True, (0, 0, 0)), (50, 150))
screen.blit(font.render("1. Go left", True, (0, 0, 0)), (50, 200))
screen.blit(font.render("2. Go right", True, (0, 0, 0)), (50, 250))
pygame.display.update()

# Get player choice
choice = None
while choice is None:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.unicode in ["1", "2"]:
choice = event.unicode

if choice == "1":
go_left()
elif choice == "2":
go_right()
else:
screen.blit(font.render("Invalid choice. Please try again.", True, (0, 0, 0)), (50, 300))
pygame.display.update()
look_for_way_out()

def go_left():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you go left, you come across a dense thicket.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You struggle to make your way through, but eventually reach the other side.", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("You find yourself at the edge of a cliff.", True, (0, 0, 0)), (50, 150))
screen.blit(font.render("What would you like to do?", True, (0, 0, 0)), (50, 200))
screen.blit(font.render("1. Look for a way down", True, (0, 0, 0)), (50, 250))
screen.blit(font.render("2. Turn back", True, (0, 0, 0)), (50, 300))
pygame.display.update()

# Get player choice
choice = None
while choice is None:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.unicode in ["1", "2"]:
choice = event.unicode

if choice == "1":
look_for_way_down()
elif choice == "2":
turn_back()
else:
screen.blit(font.render("Invalid choice. Please try again.", True, (0, 0, 0)), (50, 350))
pygame.display.update()
go_left()

def go_right():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you go right, you come across a narrow path.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You follow the path and eventually reach a clearing.", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("You see a sign pointing to the exit of the forest.", True, (0, 0, 0)), (50, 150))
screen.blit(font.render("You are relieved to have found your way out.", True, (0, 0, 0)), (50, 200))
pygame.display.update()
end_game()

def look_for_way_down():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you look for a way down the cliff, you notice a rope ladder.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You decide to climb down the ladder.", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("At the bottom of the ladder, you find yourself at the edge of a river.", True, (0, 0, 0)), (50, 150))
screen.blit(font.render("What would you like to do?", True, (0, 0, 0)), (50, 200))
screen.blit(font.render("1. Try to cross the river", True, (0, 0, 0)), (50, 250))
screen.blit(font.render("2. Follow the river upstream", True, (0, 0, 0)), (50, 300))
pygame.display.update()

# Get player choice
choice = None
while choice is None:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.unicode in ["1", "2"]:
choice = event.unicode

if choice == "1":
cross_river()
elif choice == "2":
follow_river()
else:
screen.blit(font.render("Invalid choice. Please try again.", True, (0, 0, 0)), (50, 350))
pygame.display.update()
look_for_way_down()

def cross_river():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you try to cross the river, you notice that it is too deep and fast-flowing.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You decide to turn back and follow the river upstream instead.", True, (0, 0, 0)), (50, 100))
pygame.display.update()
follow_river()

def follow_river():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you follow the river upstream, you come across a waterfall.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You notice a cave behind the waterfall.", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("What would you like to do?", True, (0, 0, 0)), (50, 150))
screen.blit(font.render("1. Enter the cave", True, (0, 0, 0)), (50, 200))
screen.blit(font.render("2. Continue following the river", True, (0, 0, 0)), (50, 250))
pygame.display.update()

# Get player choice
choice = None
while choice is None:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.unicode in ["1", "2"]:
choice = event.unicode

if choice == "1":
enter_cave()
elif choice == "2":
continue_following_river()
else:
screen.blit(font.render("Invalid choice. Please try again.", True, (0, 0, 0)), (50, 300))
pygame.display.update()
follow_river()

def enter_cave():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you enter the cave, you notice that it is a dead end.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You turn around and head back outside.", True, (0, 0, 0)), (50, 100))
pygame.display.update()
follow_river()

def continue_following_river():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you continue following the river, you eventually reach the edge of the forest.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You are relieved to have found your way out.", True, (0, 0, 0)), (50, 100))
pygame.display.update()
end_game()

def turn_back():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("You decide to turn back.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("As you make your way back, you come across a fork in the path.", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("Which way would you like to go?", True, (0, 0, 0)), (50, 150))
screen.blit(font.render("1. Go back the way you came", True, (0, 0, 0)), (50, 200))
screen.blit(font.render("2. Take a different path", True, (0, 0, 0)), (50, 250))
pygame.display.update()

# Get player choice
choice = None
while choice is None:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
if event.unicode in ["1", "2"]:
choice = event.unicode

if choice == "1":
go_back()
elif choice == "2":
take_different_path()
else:
screen.blit(font.render("Invalid choice. Please try again.", True, (0, 0, 0)), (50, 300))
pygame.display.update()
turn_back()

def go_back():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you go back the way you came, you notice that you are getting lost.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You decide to give up and go home.", True, (0, 0, 0)), (50, 100))
screen.blit(font.render("You never find out what was in the forest.", True, (0, 0, 0)), (50, 150))
pygame.display.update()
end_game()

def take_different_path():
screen.blit(background_image, (0, 0))
pygame.display.update()
screen.blit(font.render("As you take a different path, you come across a sign pointing to the exit of the forest.", True, (0, 0, 0)), (50, 50))
screen.blit(font.render("You are relieved to have found your way out.", True, (0, 0, 0)), (50, 100))
pygame.display.update()
end_game()

# Initialize pygame
pygame.init()

# Set screen size and caption
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("Welcome to the Adventure Game!")
background_image = pygame.image.load("forest.jpg").convert()
background_image = pygame.transform.smoothscale(background_image, screen.get_size())
# Set font
font = pygame.font.SysFont("bahnschrift", 25)
start_game()

# Main game loop
running = True
while running:

for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False

# Exit pygame
pygame.quit()
quit()

The `pygame.display.set_mode()` function creates a window for the game with the specified width and height. The `pygame.display.set_caption()` function sets the title of the window. The `pygame.image.load()` function is used to load an image and display it as the background of the game. The `pygame.font.Font()` function is used to create a font object that can be used to render text on the screen. The `pygame.event.get()` function is used to handle user input and the `pygame.display.update()` function is used to update the screen.

Note: Click on the link to read part 2 where I cover adding more functionalities to the game!

Reference: This article is written with the help of ChatGPT Open AI

--

--

SHRINATH BHAT

IIT Madras 2020 graduate. Senior Data Scientist at AB Inbev with 3 years of versatile experience in Machine Learning, Advanced Analytics & Al