There are many ways to find some locations. You’ll have to replace the (0, 0) coordinates with something closer to your physical location. Here you create three enemies with hard-coded locations and descriptions. Let thirdTarget = ARItem(itemDescription: "dragon", location: CLLocation(latitude: 0, longitude: 0)) Let secondTarget = ARItem(itemDescription: "wolf", location: CLLocation(latitude: 0, longitude: 0)) Let firstTarget = ARItem(itemDescription: "wolf", location: CLLocation(latitude: 0, longitude: 0)) Open MapViewController.swift and add an import for CoreLocation along with a property to store your targets: Create a new Swift file and name it ARItem.swift.Īdd the following code after the import Foundation line in ARItem.swift:Īn ARItem has a description and a location so you know the kind of enemy - and where it’s lying in wait for you. Adding Enemies To The Mapīefore you can go out and fight enemies, you’ll need to know where they are.
#POKEMON GAME MAKER TUTORIAL HOW TO#
Basic things like constraints and outlets are already done for you, so you can concentrate on the important parts of this tutorial on how to make an app like Pokemon Go. MapViewController will be used to show a map with your current location and some enemies around you. ViewController.swift contains a UIViewController subclass you’ll use to show the AR part of the app. The project contains two view controllers along with the folder art.scnassets, which contains all the 3D models and textures you’ll need. Getting Startedĭownload the starter project for this tutorial on how to make an app like Pokemon Go.
#POKEMON GAME MAKER TUTORIAL FULL#
It’s not a full pre-requisite to this tutorial to show you how to make an app like Pokemon Go, but it contains lots of valuable information about math and augmented reality that won’t be covered here. If you’re new to working with augmented reality, take the time to read through our introductory location-based augmented reality tutorial before you start. The game has a map to show both your location and your enemies’ locations, a 3D SceneKit view to show a live preview of the back camera, and 3D models of enemies. In this tutorial on how to make an app like Pokemon Go, you will create your own augmented reality monster-hunting game.