Group Group Group Group Group Group Group Group Group

raywenderlich.com Forums

How to Make a Waiting Game Like Farmville with SpriteKit and Swift

In this SpriteKit tutorial, you'll learn how to make your very own waiting game — just like Farmville — with SpriteKit and Swift.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/881-how-to-make-a-waiting-game-like-farmville-with-spritekit-and-swift

Thanks for the update. I always enjoyed mucking around with this tutorial!

1 Like

Hi,
I have been following along this tutorial - and have ran into a snag here:

“Build and run your project. Tap on a stock item and you’ll see the timer count down to zero. Then the item switches to the stocked state. That coin in front of the cookies indicates that they are ready to be sold.”

When I build and run, tapping on the left and middle price tags for the cookies shows the count down, and the correct money balance is displayed - $14.

After the timers count down, a coin appears in the middle of an empty cookie tray.
I waited a while to see if the cookies would show up, but they never do - I just get a single coin on the two trays.

I have gone over additions I was supposed to make to the starter project to this point - and verified I have made them.

I have added debugs, and one of them shows the discrete progress bar for the cookies is counting up to 7, which doesn’t have a corresponding image. Not sure if this is an error or not, I haven’t had time to figure that out yet.

My repo is here:

I’m sure it’s just a simple typo on my part someplace - the project builds and runs fine - so it’s nothing blatant…

Very fun tutorial. One part which doesn’t seem to work for me is the display of the milkshake progress. Instead of the “liquid” draining to the bottom, it stays completely full a long time, then when it finally starts to disappear, it disappears from both the top and the bottom simultaneously. I believe that this is the code inside ContinuousProgressBar.swift, but it isn’t obvious. It appears as if there is some sort of scaling and centering which is happening to the maskTexture/fullSprite objects which I can’t understand. When i break into the code, percentage gets to about .20 before any of the full sprite is actually visibly masked. having not really worked with the mask nodes i wanted to try to figure this out, but not having much luck…

This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]