(Week 23) LET'S COALESCE??
SUMMARY:
- STORE ITEM MOUSE HOVER- We got item descriptions to update in realtime.
- COALESCING??- A clean and simple way to live and program.
- MOUSE HOVER MAGIC- We wrote a button.onHover() script you can download and use.
- TASK TRACKER GOLD IN 1 WEEK (AGAIN, AGAIN) - Continuing to add teams members as our ultimate feature.
PLAY THE GAME
STORE ITEM MOUSE HOVER
This week we added a mouse hover mechanic in the store so you get more details about the upgrade items you're buying.
Originally we wanted to move on to get shoe upgrades working (shoe betcha!) but unfortunately it felt important to make this work.
On the flipside, our store system is done and we can move on to upgrades next week instead, nonetheless the delay was worth it.
COALESCING??
One thing we learned was the coalescing operator. It's a fancy way of saying "if null, then do this".
But as you can see from our example below, it helps to keep our code clean and simple as well as easier to maintain.
Example
<br> //Long version <br><br> Button myButton= button.GetComponent<MyCompoment>() ? button.GetComponent<MyCompoment>() : button.gameObject.AddComponent<MyCompoment>();<br>
<br> //Simple version with COALESCING<br><br> Button myButton= button.GetComponent<MyCompoment>() ?? button.gameObject.AddComponent<MyCompoment>();<br> <br>
One thing I've learned in my career is that it's better to take your time and keep your code clean as early as you can, even if it takes longer. This way, it'll stand the test of time and you won't end up wasting hours, maybe days, trying to figure out what your past self was trying to do. Spaghetti is great for lunch, bad for code.
MOUSE HOVER MAGIC
BEFORE
AFTER
You can see above a MAJOR improvement in how mouse hover works. Unity doesn't have a Button.onHover() event, so we wrote one ourselves.
Long story short, we extended the functionality of the Unity Button by making our custom script act as a wrapper. It adds events for OnHover and OnExit.
To make this work we attach our script to the button prefab.
TASK TRACKER GOLD IN ONE MORE, ONE MORE, ONE MORE WEEK
The Team Invite feature is STILL taking longer than expected (any day now) but it's close. Here you see our contact search feature working.
You can find any current members of your team and add them.
If they're not in our directory, the notifications window prompts you to send then an invite so they can open an account and join your team!
We're hoping to make it easier than ever to have friends join you in keeping track of goals or tasks for your project.
Our test run worked well this week but deployment may take a little longer, perhaps by the weekend or early next week.
Visit Task Tracker's Public TODO List and sign up FREE!
That's it for this week! Hope you try out the game and check out our list on Task Tracker Pro! To be continued....
GabeArts305
Can You Dig It? (Yes You Can)
The treasure game of finding buried riches under Fortune Park's vast terrain with aid of a trusty shovel and detector!
Status | Prototype |
Author | Monarch Games Net |
Genre | Simulation, Puzzle, Strategy |
Tags | Exploration, First-Person, Indie, nature, Open World, Sandbox, treasure |
More posts
- (Week 56) IN THE BAGJan 24, 2024
- Week 56 - Progression Makes Perfect!Jan 23, 2024
- (Week 30) JACKPOTJul 09, 2023
- (Week 28) Á LA KARTJun 25, 2023
- (Week 27) SWEAT AND TIERSJun 18, 2023
- (Week 26) DETECT: THE ALMIGHTYJun 11, 2023
- (Week 25) UPGRADES UP-DATE!Jun 04, 2023
- (Week 24) SHOE BETCHAMay 28, 2023
- (WEEK 22) DELEGATE YOUR WEAKNESSMay 13, 2023
Leave a comment
Log in with itch.io to leave a comment.