Reset Button/Link sprites


I've created a hidden object game that's pretty basic - you click on the sprite and a circle appears around the object. 

What I want to do is threefold:

1 - when they click on the found object, it automatically crosses the item found off a list that is next to the image.

2 - I would like the game to have a reset button for when they want to start over.

3. I would like the game to congratulate them when they find all the sprites.


Can someone please help!?

Comments 1 to 15 (16 total)


In short:

1. There are many ways to do it, but personally I would make the list so it contains several SceneObjects, one for each of the hidden objects that you have to find. These SceneObjects in the list should contain two sprites: one TextSprite with the name of the item, one normal Sprite with a line (to cross things off the list). Each line sprite should be set to be invisible (visible = false), and the Sprite name should be line.

Then you need a way to "link" your hidden objects to the corrensponding entry in the list. You could do this by using a naming convention, so if your hidden objects are called catdog, banana, etc. then your objects in the list could be called list_catlist_doglist_banana.

If you do that, and you are using a behavior for your hidden objects, in the behavior's onClick or onMouseDown function:

_['list_' + this.owner.getName()].getSprite('line').setVisible(true);

2. Just add a SceneObject for your button, and in its onMouseDown function:

wade.loadScript('myScene.wsc', null, null, true);

Where myScene.wsc should be replaced with the current file name.

3. Keep track of how many objects there are and how many have been found. You can create an event in the scene's timeline (in the Scene Properties in the editor) at time 0, and you can use it to initialize a variable like this: = 10; = 0;

Then in your hidden object behavior's onMouseDown function:

if ( == {

Where congrats.wsc is a scene files with whatever you want to show to congratulate the player.

I hope this helps, good luck :)


Sweet! I will certainly try this! I'll post a link to the current game as soon as I get approval. 


Nevermind. lol 


Ok...I'm not sure what I'm doing wrong... for the congrats.wsc, i just added an image that should switch out. No code or anying. 

Also, the reset button does not work... my scene is named scene1.wsc adn that's what I put...but it keeps acting if the sprite is not there. 




Looking at that screenshot, I think there is simply a typo: you have called your file congrtats.wsc (there's an extra t), and are trying to load congrats.wsc


Well, lol! Who knew! Thank you! 



I'm still working on linking sprites. Here's my trouble:

I have an image where the list of items already noted. All the sprites are loaded into the image, where when you run the game, you click on the image indicated in the list, and a circle will appear around it. 

What I'm trying to do is to, when that circle appears around the item, a line appears across the pre-printed list that is on the image. 

I tried the code provided, but I couldn't get it to work. 

Can you give me some advice?




Can you show me the code that you're using to display the circles?


On Mouse Down for each sprite, this is the code:

if ( == {



Here is the link to the finished game - hopefully that will give you an idea what I was trying to do. LOL



That looks nice, I like the graphics :)

I think if you're doing it this way, the best option would be to add an extra sprite to your scene objects. This sprite should be a line, that you can position in the right place over the list for each sprite by setting the sprite offset in the editor. It should be initially invisible, and i would call it "line". Note that this is the Sprite's name, not the SceneObject's name.

Once you have done that, just add this line to your onMouseDown functions:


This would be easier if it was all done with behaviors (you wouldn't have to duplicate your code in that case), but seeing  as you've already got it working this way, I believe this would be the easiest solution.


Thanks. It's a statewide literacy campaign. 

Sorry, I'm a bit confused.

I tried as you suggested, and it made the 3rd sprite bigger but didn't allow me to move it anywhere. In fact, making any edits to the two sprites I already have on the scene object, by adding a third and trying to move it just moves the entire scene object. 

When adding this code, even with adjusting the offset, the line does not appear. 


Would it be possible to do this as a scene object instead? 


However, I do this and I get a TypeError that SceneObject is not a function. 

If I try to do it by adding the line as a SceneObject with Sprite Name line1, it gets the error message that it cannot read property.



You can do it either way.

1. Adding a sprite, and then moving it by changing its offset (not by moving the SceneObject):


2. Creating a separate SceneObject, however the correct syntax is 


or better (less typing, but it's exactly the same):




OMG - that last one worked! Amazingly well. 

THank you so much!


Post a reply
Add Attachment
Submit Reply
Login to Reply