Notifications
Article
Milky Way Hotel
Updated a month ago
437
2
Milky Way Hotel
Milky Way Hotel Is a pixel style, simulated hotel management game. The hotel is located on a very, very small planet in the Milky Way galaxy.You will be the Boss of the hotel.The boss needs to build a fun place for all to come and stay. If you're ready, please get in the car ;) .
While playing, there will be all kinds of strange aliens coming to the hotel. As boss, you must build many different hotel rooms, houses, decorations and facilities to satisfy the needs of aliens. There are many staffs are there to help you. However, it is your job to train them and place them at correct roles for the business to run smoothly.
You will be holding various events regularly in order to attract your customers. For instance, holidays and music festivals.
After work, the boss also has a garden island, work and life are important.
Boss should often go to some other planets to explore or travel, the vast universe is wonderful everywhere.
Boss can change clothes and hairstyle here and customize your favorite role.
Ok, have a good time. The following are two packages of unity2D that we used.
【2D Pixel Perfect】
This package is great for pixel games and is indispensable.
Without this package, pixel distortion often happens in the game, and the game screen is terrible:
After use, there is no deformation of the pixel, reaching the perfect pixel. Finally, we can use the perfect pixel style:
Install the 2D Pixel Perfect Camera in the Package Manager:
MainCamera Add Component Pixel Perfect Camera:
Assets Pixels Per Unit = 100(We use the default value of 100)
Reference Resolution.x=1024(We use 1024X768)
Reference Resolution.y=768
Set each image:
1.PPU=100(How many pixels does a unity unit have),We use the default value of 100。
2.Filter Mode=Point
3.Compression=None
If Sprite Mode is set to Multiple and there are multiple Sprite elements, then a pivot point must be set for each individual Sprite element.
Under the Sprite settings, select *Custom* from the *Pivot* drop-down menu. Then select *Pixels* from the *Pivot Unit Mode* drop-down menu. This allows you to input the pivot point's coordinatess in pixels, or drag the pivot point around freely in the Sprite Editor and have it automatically snap to pixel corners.
Change all gameObject.position in Hierarchy.The precision of position is 1/PPU.our PPU=100,So position precision is the two decimal places(1/100=0.01f). Also note that when moving objects and cameras at the same time, their position precision is the two decimal places.
If the precision is three or four decimal places, the 2D Pixel Perfect Camera will automatically correct the value back to the two decimal places, causing the image to look like it is shaking when the Camera moves. In fact, it is caused by the correction of the position.
We can use this function to correct position precision.Prevent shaking when moving.
float PPU = 100f; //ppu private Vector3 valueInPixels = Vector3.zero; public Vector3 RePosition(Transform trans) { valueInPixels.x = trans.position.x * PPU; valueInPixels.x = Mathf.Round(valueInPixels.x); valueInPixels.x = valueInPixels.x * (1 / PPU); valueInPixels.y = trans.position.y * PPU; valueInPixels.y = Mathf.Round(valueInPixels.y); valueInPixels.y = valueInPixels.y * (1 / PPU); valueInPixels.z = 0f; return valueInPixels; }
We can also use Snap Settings to correct position precision(You can choose to use this or RePosition() function ).
Edit > Snap Settings
For **Move X/Y/Z**, set their values to '1 divided by the Asset Pixels Per Unit (PPU) value'
Snap settings are not applied retroactively. If there are any pre-existing GameObjects in the Scene, select each of them and click *Snap All Axes* to apply the Snap settings
### Pixel Snapping
Enable this feature to snap Sprite Renderers to a grid in world space at render-time. The grid size is based on the **Assets Pixels Per Unit** value.
**Pixel Snapping** prevents subpixel movement and make Sprites appear to move in pixel-by-pixel increments. This does not affect any GameObjects' Transform positions.
【2D Cine Machine】
This package is very useful for cameras. What we're using is its 2d follow function.
When the boss moves, the camera is used to smoothly follow the boss to move, and the effect is very good.
Install:
After installation, we used 2D Camera, the menu Cinemachine-> to Create 2D Camera
After clicking, a Cinemachine Brain component will be automatically installed under the main camera
The Hierarchy also automatically generates a "CM vcam1" gameobject
Follow = boss, and the camera will move with boss.
CM vcam1 has 3 ranges, 1 is dead zone, the boss in this range, the camera will not move.
2.soft zone: when the boss is in this range, the camera will follow the protagonist smoothly at the speed set by us.
3.Outside soft zone, camera will move quickly.
CM vcam1 also has a moving boundary, after the camera reaches the boundary, it will not continue to follow the movement.
Adding boundary components:
Choose “Confine 2D”:
The boundary needs to be drawn for a polygon collider. Once assigned, beyond the polygon collider2d range, the camera will no longer be able to follow.
Drag this GameObject in it:
well, here are some drawings of our design.
Trains cars and ships:
Inside the mysterious island:
Some water effects:
Set up the tracks:

Choose a direction:
Choose two directions:
Building train station:
Take the train:
Hippo car:
Building the road:
Unity version: 2018.2.19f1
At last,this game is produced by Warm Star Walker studio.
We are a small studio with only two people (dracula and why0813).
We have been established for two years, and This game, Milky Way Hotel, is our very first game.
During the past two years, we had enormous pressure in our life. (Both financiall and mentally) We are especially grateful for our family's support. If you are exciting about this game, feel free to email your idea/comments to the following email address. We can't wait to hear from you.
Our Email:why0813@qq.com
#Unity2DChallenge #Unity2DChallenge#

why0813
1
Comments
DH
Ding Hui
11 days ago
加油!
0
zheng shuo
a month ago
nice game, can't wait to play it :)
0