Android native game — open a pet coffee shop!

I am participating in the team competition of Nuggets Community Game Creative Submission Contest. For details, please see: Game Creative Submission Contest

introduce

This is a business simulation — take care of your pets, make more money when you’re in business (pets’ status and weather (via IP address query) have an impact), and buy more items, more pets. Share your progress with your friends and visit their stores to leave a comment.

Using MVVM architecture, to achieve some simple custom view (pull refresh pull up load, sliding nesting, event distribution), there is a simple back end to save a variety of game data, the local use of room database, back end for Spring Boot +mongodb.

Now let’s show the function

1. Login page

Can save the password, registration and login (because there is no money so rent the server is not very good, the login may not go in, can be a few more 😭

2. Main interface of the game

The game progress and money above is DataBinding, and the bottom bar from left to right is backpack, Store, business, Pet, friends

3. Store interface

Spend money to buy equipment and food for pets, after the purchase of a simple animation

4. Pet interface

Pets can be stroked (a little 💗 pops up), and the interface is a left-right swiping ViewPager. Click on pet to wash (restore cleanliness) and feed (restore fullness)

5. Business is open

Long press open in the middle to start business when the progress bar is full. Pets here can also be touched. The transaction generates money and generates a random event based on the status of the pet and sends a Notification of the transaction result

6. Friends list

Friends list allows you to view friends and search users. Click item to view user information. The sliding of the ItemTouchHelper implementation was removed

7. Friend information

You can add friends and visit each other’s coffee shops

8. Message board function

Leave a message to friends, use the drop-down refresh of the custom View, and rewrite the Behavior in CoordinatorLayout to fold the top bar when sliding up. There is also a Button that can drag and adsorb in imitation of Zhihu

conclusion

This is the whole freshman learning side of the demo, coinciding with the nuggets of activity sent up. Many functions are not perfect, hope light spray.

In fact, most of the time, this little game is made for learning a certain knowledge point (for example, pet stroking to learn custom view, sliding nesting and CoordinatorLayout writing message board, so it looks very different. But through this small game did learn a lot of things ———— code from Java to Kotlin, architecture from the beginning of what all written in the Activity of a mess to see JetPack after the gradual iteration to MVVM

The amount of code is still relatively large, so the above only attached to the code link github.com/Watermelon9…

The APK package is v0.9.1 in the Release of the connection