And my part in this project was to make a "Estate" where the person can see his assets. Can see what level he has reached. And there are some perks which get unlocked when he gradually progress in game.
A 2D isometric game scene, where the user can place the buildings. It's my first very successful attempt for a 2D isometric scene. Here are few steps I would like to share:
- Use Orthographic camera projection. And make sure you have all the building assets as a 2D art(.PNG). Yeha! one more point make sure this art is created considering the isometric projection. If you get a good artist around you he will be aware of that. And what next ?
- As there is no depth of field. You have to use sorting order for overlapping. And yeah for rendering those building sprites use a Sprite Renderer component.
- And how are we suppose to detect the user touch/click ? We use a box collider which covers whole of the sprite and the sprite object is the child of the box collider object. See the picture.
Sprite Renderer component in a child object of the parent. Note the rotation of the sprite.
- Rotate the sprite accordingly. I rotated the sprite for 53 deg on y axis. Also rotate the camera 45, 45 on x, y axis.
After fixing up everything in place. The look of the game feels great. I coded some panning and pinch and zoom functions as well. So I can plan around the plain to see where I want my building to be placed.
Now the user data will be coming from outside. (Web, IOS, Android) So I have to make a json script where I can save the information about user. I gone through forums researching about it. Got help from some of my friends as well. And here I share my conclusion.
- Json is a javascript object notion. Its a convention used to exchange data and its independent of the platform. In this project I was receiving json from android, ios and web. So I made a script which takes the json string as a parameter and parse it accordingly.
- I attach this script to one of the object, which will be called specifically from the Native end.
- Firstly, deserialize whole of the data. Use IDictionary data type for that. Always remember to deserialize the data in same order the elements in the json script are coming.
- Create a list for each element and add the data respectively.
- Here by, you can start the constructors to load the user information and his buildings , unlockables, accordingly.