Home / Topic / puzzles

puzzles

Viewing 12 posts - 1 through 12 (of 12 total)
  • baya.zidi99
    Participant
    #9668

    Hi GuysIm busy Rnd'ing (? if thats a word) a puzzle page for an upcoming app. I've got most of it sorted and working properly but I need some "logic"/ coding guidance. What needs to happen is this: Once the puzzle is complete, an audio file must play, congratulating the player on the successful build of the puzzle. Also a button needs to animate in once the last piece is in place - however, how do I let Kwik know what piece is the "last" one without having a linear puzzle build experience? The user need to be able to finish the puzzle on any number of ways depending on the amount of pieces right? So how do I let kwik know to assign each piece an ID and update every time a piece is in place. So when the user reaches the last ID, it triggers the action "reset button" and "congrats sound." (I'm assuming one would need to add and ID of some kind to the pieces - I might be wrong.)Any comments/ suggestions/ "hey buddy you're on the wrong track!!" welcome 😉Thanks again to Alex for the great "magnet snapping" tut on the website.

    adriakuehnmg5524
    Participant
    #13459

    Seems to me that you need a set of variables, one for each piece. Let's say you have 3 pieces, a, b, and c. Create a variable for each piece like a_place, b_place, and c_place with values “notplaced” (for example, it can be named whatever you like). Once each piece is in its place in the puzzle, is should change the variable that corresponds with it to something indicating it is now in place, (i.e “placed”). The puzzle is complete once all three values=”placed”, regardless of which order they where added in. Make sense?To achieve this there should be an action that occurs every time a puzzle piece is placed properly. The action uses Code/Edit Variable to change its piece's corresponding variable from "notplaced" to "placed" and it should run Condition/IF checks to see if all the variables for the puzzle now equal "notplaced". If that condition exists (a_place ,b_place ,& c_place ="placed", then the puzzle is complete and your game over actions can be called.

    baya.zidi99
    Participant
    #13460

    many thanks Otterslide, that is super helpful. I'll wrap my head around it this morning and see if i can get it to work.awesome sauce!

    19
    Participant
    #13461

    I found out how to play a sound, every time a piece fall into place.Using play audio before the end if.But how do I get it to play a different sound, or do anything else after all the pieces are in place.?I have tried for 5 hours now without success. :'(Can somebody Please show me a real example.

    baya.zidi99
    Participant
    #13462

    Hi rollesYea also did that, problem is though that even if the piece is in place and the user's finger is still on the pieces, it repeats the sound. I think for the other questions you have best follow Otterside's advice for now. I havn't tried it myself yet. It seems do-able, but with a bit of extra scripting.good luck, hope you come right. I will post any new findings as well.hein

    lizochka_simova
    Participant
    #13463

    I'm using the magnetics in my picture book app on a page where the users can put the toys back in the basket after it tips and spills them all.  It gets a little complicated by the fact that the toy layers have to first be behind the basket, then in front of the basket (as “dynamic” bodies), then behind again.  I have figured out how to do all that using duplicates that show/hide, and by changing the object with physics properties from static to dynamic, then back again. My problem now is that once the toy is in the basket, with the physics object hidden and bodyType="static", it is still draggable.  So if the user happens to drag this invisible object to another place on the page, it effects the other toys that are still "dynamic" causing odd behaviors.  I need to either make these objects not draggable once they are trapped, or to remove them altogether. Does anyone know the code I need to add to do one or the other?  Thanks!

    Anonymous
    #13464

    Instead of using copies of layers all around, my suggestion is to set the object being moved toFront (for example, if the object name is abc, use abc:toFront()). then, when you need to set the basket to front again, you follow the same principle: basket:toFront()

    lizochka_simova
    Participant
    #13465

    I thought about that, Alex, but I have about 10 toy layers, so if one toy is trapped and the basket comes toFront, the other nine “dynamic” objects will be behind it as well.  🙁

    stacy.castillo
    Participant
    #13466

    Otterslide how I can tell to the K2 all this variables? a_place ,b_place ,& c_place ="placed"I have to created one if for each or exist a way to tell to K2 all this like you write: a_place ,b_place ,& c_place ="placed"

    Anonymous
    #13467

    you must use an external code here (because the native IF interaction only works with up 2 conditions):

    Code:
    if (a_place == 1 and b_place == 1 and c_place == 1) then  --you action goes hereend

    stacy.castillo
    Participant
    #13468

    Thank very much you Alex!I have one doubt.--you action goes here ( is out of the external code? ) If is into the external code can you tell me how I can call a action from inside external code? Thank you again 🙂

    Anonymous
    #13469

    you can use the external code just for the IF statement, then use all other interactions (action call, END statement, etc) from Kwik

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.

Privacy Preference Center

Strictly Necessary

these coolies are for WP-SpamShield, gdpr-wp, woocommerce, paypal

PHPSESSID, SJECT16, JCS_INENREF, JCS_INENTIM, gdpr, woocommerce_cart_hash, woocommerce_items_in_cart, woocommerce_recently_viewed, wordpress_, wordpress_logged_in_, wordpress_sec_, wordpress_test_cookie, wp_woocommerce_session_, AKDC, akavpau_ppsd

Functionality

WordPress cookie created when auto-saving a post in the editor.

wp-saving-post, wp-settings-, wp-settings-time-

Performance

google analytic

__utma,__utmb,__utmc,__utmz,_ga,_gid,_gat

Advertising