unity+ German positioning =pokemon Go Cottage demo Android version

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

These two weeks have tried to use the German geolocation and unity to make a fake Pokemon go demo, which can only be used under Android.


Video game process:

http://www.bilibili.com/video/av6836823/


APK Download:

http://download.csdn.net/detail/wuyt2008/9665294


SOURCE Download:

http://download.csdn.net/detail/wuyt2008/9665311

http://download.csdn.net/detail/wuyt2008/9665336


Scene One



Here is a page to get the current location and set up a pet location.

This is a place where you do your own German geo-positioning,


This is set to one-time positioning. You can set how far away your pet is from the current location and the sensing radius.

The sensing radius is recommended to be no less than 40 meters.

The information set is kept in Pokemoninfo.



Scene II (Real map)


Because the Gaodean SDK map shows that I can't get it, I used the Web API.

This is a lazy solution, if you go far, there will be no map.

When you click Start, you'll visit the German Web API to get a static picture of a map centered on the current location.


This image has about 700k, the network is not good will be broken, so added a button to refresh the map.

A function for calculating the direct distance between two latitude and longitude is found on the Internet, and the difference between the pet and the current position is calculated and displayed. There is an error, but it can be accepted.

Calculate function Source

Http://www.cnblogs.com/chenkh/p/5661097.html


The map shows two ways of going north and south.



One is when the mobile phone level, the north of the map will point to the reality of the north, there will be a certain jitter and offset. This feature is made with the Gyrodroid plugin.




When the phone's current position is within the sensing distance, a button appears and a sound is indicated.

This function was originally intended to use the high-gold geo-fence to achieve, so the computation in the high-power server, when there are many times easier to achieve.

But, do not have the ability, had to calculate by oneself. (Master must teach me how to call the Android notification in unity what Ah, kneel beg)

The positioning time here is set at 5 seconds.


Scene Three


The Vuforia plugin is used to display the contents of the camera. Although I can write, but the effect is not good. Anyway, just take a camera in the AR SDK to use it.


The location of the pet is set by the current location of the phone and the location of the pet when entering the scene.


In order to realize the mobile phone to see different directions, but also used the gyrodroid plug-in.



The model is in the Unity Mall, where the trajectory of the ball is implemented with the Itween plugin. The pet will be knocked down after clicking.

public void Throwball () {Gameobject ball = instantiate (ballperfab); ball.transform.position = new Vector3 (2, -2f, 0); Itwee N.moveto (Ball, Itween.hash ("position", new Vector3 (pokemon.transform.position.x,pokemon.position.y+1f, POKEMON.TRANSFORM.POSITION.Z), "Time", 1f, "Easetype", iTween.EaseType.linear); Itween.moveto ( Ball.transform.FindChild ("Sphere"). Gameobject, Itween.hash ("Y", 2, "Time", 0.53f, "islocal", True, "Easetype", ITween.EaseType.easeInOutSine, "Looptype", ITween.LoopType.pingPong));}








Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.