How to trigger a Next Button for Drag and Drop Game
Dude6230
Member Posts: 15
Hi there, I am a newbie and I am creating a spelling drag and drop game. I have worked out how to drag and drop into specific slots thanks to tutorials but my next issue is activating a 'Next' button.
I have attached an image of the scene thus far and I would simply like to trigger/activate a 'Well Done' and then a 'Next' button once the correct letters have been dragged unto the boxes like in the image attached.
I do not have an idea as to how one can go about doing so, so any help would be awesome.
https://www.dropbox.com/s/9iu5rpglvjoqmlo/Screen Shot 2014-04-02 at 13.37.24.png
Comments
You'll need to figure out what rule condition(s) would allow the player to go to the next scene. This depends on how you're storing the letters that the player drags onto the boxes. Are they actor attributes, game attributes, or are they in tables?
How would you describe the correct letters in the correct places by using the terminology of GameSalad (attributes, positions, tableCellValues, etc.)? That will help you figure out what to do next.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks for your input. Well, the letters are in actual fact actors, so actor attributes.
I think I would describe them as attributes then again positions sounds more appropriate.
How would you go about it?
I've attached the link below so you can see my progress so far
https://dropbox.com/s/wjza5r38zgmjhy2/Spellinator%20Game1.gameproj
That Dropbox file won't open. Plus, it's 476 bytes (an empty project file is 6000 bytes). Can you compress it as a .zip file and re-upload it to Dropbox?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Sure thing buddy. I've attached it below and zipped it. https://dropbox.com/s/lctu1fbimw4cyno/DragDrop%20Game.zip
Note: The scene I am talking about is the 'Space story' scene
This would be easiest with the Release Candidate since you can manipulate text strings, but let's assume you're using the Stable Build of Creator. Here's how I'd do it:
Give each letter actor a self attribute (text) called self.myLetter. Manually enter the letter in as the default value for each actor. Then add these rules:
When touch is released AND letter actor collides with box actor 1 Change tableValue(tableName,1,1) to self.myLetter When touch is released AND letter actor collides with box actor 2 Change tableValue(tableName,1,2) to self.myLetter etc.
The idea is that you are building a word by storing each letter in a table cell (column). You would then need a rule that checks to see if the concatenation of all of those table cells equals some target word.
Because you're using multiple letter actors and multiple box actors, you'll need to code for each possible actor, as I've begun to show above. As you get more familiar with GameSalad, you may find that it's easier to use a single letter actor and a single box actor and to create instances (scene copies) of each with unique self attributes.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thank you very much sir/miss. I will follow your advice from tomorrow morning and I will let you know how I got on. Many thanks.
(Sir) You're welcome. What you're setting out to do is fairly complicated so don't be surprised if it takes some time to get it to work properly.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Well I agree with you there as earlier spent hours researching how to create this rule but to no avail. I retry again. I have so far stored the letters as you mentioned above into a table I created.