PubNub

How to Build Interactive 2d Games

Download Unity, follow a few Youtube tutorial videos and learn how to build your own game, publish it, and make millions. It’s that easy right? There’s a lot to consider when building your own 2d game:

  • What platform are you building for - web, mobile, or something else?
  • Are you adding chat or other real-time player interactions to stimulate player engagement?
  • Do you have a plan to scale your game as you get more players? What will you do if your game grows too fast?

In this how-to we’ll cover these questions and more by exploring what you need to think about before you build a real-time interactive 2d game.

So you want to build a 2d game?

According to a study conducted by the Entertainment Software Association, “Today, 66 percent of Americans—more than 215 million people of all ages and backgrounds—play video games regularly.” That’s a large market to create games for and that’s just America; The worldwide number of people playing video games is continuing to grow as well.

Interactive 2d games are a great way to produce a video game because 2d games are the simplest type of game to build. 2d video games only allow for 2 axes of motion - left/right and up/down. Without a full range of 3d motion there is less to worry about mechanically or visually. This means image assets, including the characters, objects, and environment, are 2d since you only view them from a fixed perspective.

For a further comparison of 2D versus 3D games, check out this post by Make Use Of on 2D Games vs. 3D Games: What Are the Differences?

2d games first became popular in the early 1970’s with interactive 2d arcade games like Pong. Coin activated arcade style games were the main way players consumed 2d games and the primary driving force behind all early 2d interactive games. Today, most 2d games are played on computers or mobile devices. Mobile gaming has grown so much that according to Statista, “Revenue in the Mobile Games segment is projected to reach US$152.50bn in 2022.”

Developers making interactive 2d games in the 1970’s and developers making interactive 2d games in 2022 both still have the same core obstacle to overcome: How to build an interactive 2d game in the fastest way possible with as little resources as possible.

Fortunately, interactive 2d games developers have a lot more tools and options for building 2d games now. Thanks to interactive 2d game engines developers don’t have to start from scratch and they can easily deploy games to many different mobile devices, computers, or to the web. There are now even no-code 2d game development engine options that don’t require you to do any programming - just supply the art and graphics.

Types of 2d games you can easily build

Here are a few popular types of 2d interactive games that you could create:

Role-Playing Games or RPGs

There are various definitions of what is considered to be an RPG. However, an RPG is usually defined as having:

  • A protagonist that completes a journey through stats
  • Menu based combat
  • Interactions with game elements

Pokemon is a popular example of an RPG style interactive 2d game.

Platformers

Platformers are games where players encounter levels and obstacles with increasing difficulty. Players move by jumping and climbing to progress.

Super Mario Bros. is an example of a platformer style interactive 2d game and it’s one of the most popular platformer games.

Quizzes

Quiz games are games where participants answer questions on one or more topics. Some quiz games consist of a single player answering questions for points while others may be a tournament style game with thousands of players.

Trivia Crack is a popular example of a quiz style interactive 2d game.

Puzzles

Puzzle games are games that ask participants to complete some type of problem or puzzle solving. This category is broad and includes games that require using logic, pattern recognition, sequence solving, spatial recognition, and other solving skills.

Candy Crush Saga is a popular example of a tile-matching style puzzle interactive 2d game.

Steps for building a 2d game

Step 1. Pick a type of game. The style of game you want to build with may change what game engine you pick to create your game.

Step 2. Pick a game engine. There are a ton of different game engines. You’ll need to decide how much you want to spend, what platforms you want to develop for, and if you plan to create your own image assets. Consider these to get started:

  • Unity - Unity is a staple of the indie game industry. Unity also has a sizeable community and an active Asset Store with both free and pay-to-use assets at your fingertips.
  • GameMaker Studio - Has an easy-to-learn drag-and-drop interface and you can work hands-on with the engine's own scripting language, GML.
  • Ren’Py - Open source and cross-platform. You only need to know how to use a text-editor and photo editing software to get started.

Step 3. Start Learning. Your development process will depend on your game and the tools you decide to use. Each of those game engines has tutorials on their websites. We also recommend looking for YouTube videos of projects similar to yours.

Making your 2d games interactive, social, and engaging

If you want to keep players coming back to your game you’ll also need to consider adding social features to keep it engaging. Game developers can use technologies like real-time messaging to build social features that drive player engagement and retention, to sync state between players, and to drive powerful analytics and player telemetry that shed light on player activity.

Build online/offline player rosters and use notifications to drive engagement - Know who is on and offline, send alerts to bring gamers back, and highlight in-game events, as they happen.

Use live statistics, scores and leaderboards for competition - Stream live score updates and player statistics to dashboards in real time.

Embed in-app chat for amazing gaming experiences - Keep control over content moderation, and analyze content for insights and analytics that inform game usage trends.

PubNub makes it easy to build all of these features and more.

How to add interactive chat to 2d games

PubNub has powerful chat features that are perfect for 2d games. Check out this blog post on how In-Game Chat Fuels Player Engagement and Boosts Retention to learn all about how you can use PubNub to build interactive chat for a 2d game.

How to add game stats and leaderboards to 2d games

You can build a real-time leaderboard easily with PubNub. Check out this blog post on How to Add a Score System in Unity for Real-Time Streaming to learn all about how you can use PubNub to build a leaderboard for a 2d game.

How to add alerts and push notifications to 2d games

You can add push notifications and alerts to your 2d game easily with the PubNub Mobile Push Gateway. Check out this How to For Push Notifications to learn more about using Push Notifications with PubNub.

Getting Started with PubNub to make your 2d games interactive

Using PubNub SDKs, game developers can easily build chat and real-time game features without having to sacrifice a large amount of time learning, creating, and managing the mechanics behind sending chat messages or player data in real time. PubNub manages all of the scaling and infrastructure for you and provides easy-to-use API’s so your game "just works." With PubNub, you can focus on the front-end of your game without worrying about the infrastructure behind it.

No need to worry about scaling - PubNub will handle it for you!

Learn more about PubNub and Gaming with these great resources:

Want more help building games with PubNub? Reach out to our team of experts.