Actors and Coming back to a game: Saved? In progress?
Hello -
I'm currently working on a clicker type game, which stores values in a table (if you happen to remember my most recent post(s)).
When you click on a particular item, an actor (representative of what you are purchasing) appears on the screen. So let's say you've clicked on "red ball" four times; as a result, four red balls would appear on the screen.
The problem is as follows: Using GS Viewer, the values of the items clicked are stored in a table, and the representative actors appear. If I hit the home button, or even if I quit GS Viewer, the values are saved, so I'd restart with three red balls, but the balls (representative actors) are not there.
Has anyone death with this before? Would I go about it creating a loop spawning representative actors (in this case 3, the value stored) at game.time = 0 or the like? Is there another way to approach this?
Thanks, regards.
Comments
Yes, you would need to spawn the actors (or use the Replicate behavior) to display the ball actors at the start of the scene.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Hello -
I'm bringing this one back from the dead.
I have two scenes, a "tap to start" intro scene, and a game scene.
In the tap to start scene, I created a temp variable to obtain the value from the score table where I should be storing the number of actors I acquired at the "store" with my "earned clicks". I know that the value is stored, since I have another actor display the stored value in the game scene.
Another portion of the game scene should show a spawned actor which is a graphical representation of the numerical value. For example, if my table value is 2, then 2 humans should spawn in a "pen" (confined area). I tried to spawn those actors with a loop that while the number of spawns is less than the saved value, then spawn another human actor. But it's simply not spawning anything; a new human is spawned if I click on one in the store.
BTW, every time I click on the purchase actor, the value is written to the table and then I save the table through the Save Table behavior.
Any ideas where I am doing it wrong?
My Blog / App Store / Google Play
Eureka! I rechecked the loop, and noticed there was a timer in there which mucked things up. I removed the timer, and it's now working again.
My Blog / App Store / Google Play