HW# 20 Imitating Google Search: A Small Game App

Finally, I’ve come to homework #20! I can’t believe how time flies. We’ve covered a lot of stuff already and there are still many things I need to review and practice, otherwise I’ll get rusty soon. lol…

Anyway, after checking the relevant links below, I decided to do an app for the cast moon blocks or cast divination blocks, a very important custom in Taiwanese religious practice.

In Taiwanese, we call cast divination blocks “ poa̍h-poe”. When we pray to Gods or our ancestors, we sometimes ask them questions, then cast the divination blocks on the ground; and the answers with the divination blocks come into three kinds: good, bad, no answer (smile). See the following pictures:

This means it’s good.
This means it’s bad.
This means no answer or keep trying

For this game, I tried to integrate some of the stuff we did before, like SpriteKit with the snow particle effect.

Here is my simple code:

Part 1
Part 2

I was a bit stuck during the coding process but luckily I figured out the problem. It just needs a lot of patience when writing code, eh? Regarding the random cast connecting to the results of good, bad, and smile, I THIK I could do better some time later, like making the result words disappear when there is no cast being picked up randomly. This game, however, is just for fun. When casting your divination blocks, you should get the ‘good’ one to match the result word- good, which means you win; otherwise, you need to keep casting the blocks.

Alrighty, let’s take a look at the interface:

Tap CAST button to get your fortune!

Last, let’s see the gif of the app. I know it is not that great and I can’t compete with those who are designers. But hey, I think I’m getting more progress as the class is coming toward the end. I really appreciated many seniors’ works and of course our lecturer, Peter.

The link on Github:

Until next time, Happy New Year of 2022!!!

--

--

Jerski
彼得潘的 Swift iOS / Flutter App 開發教室

Studied Linguistics in university and have been intrigued by code writing. Now this journey of Swift just began.