Creating a simple AR game
As we discussed previously, the idea is to create a simple game where we can move our player while moving a real-life image and also put in some enemy spawners by just tapping where we want them to be, such as a wall, the floor, a table, and so on. Our player will automatically shoot at the nearest enemy, and the enemies will shoot directly at the player, so our only task will be to move the player so that they avoid bullets. We are going to implement these game mechanics using scripts very similar to the ones we used in this book’s main project.
In this section, we will develop the following AR game features:
- Spawning the player and enemies
- Coding the player and enemy behavior
First, we are going to discuss how to make our players and enemies appear in the app, specifically in real-world positions, and then we will make them move and shoot each other to create the specified gameplay mechanics. Let’s start with...