Wormhole's Forum Posts

  • Thanks, dop2000 bro, that was amazing.

    Two quick questions.

    Question 1. In another scenario, I have an array of a certain height and width and data on it. How can I replace an index of the array? eg. Value of index 1 is "1" when Player collide with an object or by clicking a button I want set it something else, for eg. "23".

    I don't want something like this. (Via)

    Because my array would contain mostly numbers, the same value might be repeated on several indexes.

    Question 2

    How to make the addition of all the value from the array.

    eg.

    How do I calculate all the array value and store in on a global variable? For example here if we add all the numbers the value would be 20.

  • Hi guys, me again. Happy New Year to everybody.

    Thing is, I want to make the array (which is imported from JSON) to random. Means every time I restart the layout or click a button the array value should be shuffled.

    I tried this way, but couldn't succeed.

    Please check this dropbox.com/s/kmns0c2u8g84rwf/Array%20Shuffle%20Exp.c3p

  • I'm not sure really what you are trying to do but maybe this will help.

    First, given the image, your events aren't going to choose a specific text object. You are using the system compare 2 variables event. This will trigger if it finds a value that matches but no object is selected so you don't know which object the system will choose. Most likely it will be all text objects.

    Instead, you should use a text event and compare it's variable. This is what your events would change to:

    Also, you can cut down your events simply by using the instance variable as the array index.

    WOW! This is what I wanted. Now I understand it. Thanks, you are awesome. :D

  • Hi, guys, me again. posting another noob question, sorry I just exploring array and instance variable and continuously having several questions.

    How do I set text of a text object by referring its instance variable?

    I tried to compare it by its instance variable but not working.

  • Posted this (Current) Question on the morning but it wasn't reflected to the community, it was not showing on my topic list either perhaps posted another, but now this question suddenly pop up out of nowhere, anyways, it was really a LOL moment for me because the solution you gave seems so simple and I was hunting it for all day (literally all day) _--_

    btw thanks.

  • I tried to load Array.JSON file to array object, and want to retrieve array value from certain index, eg, from index 6, used this expression "MyArray.At(6)" but it seems like the AJAX import is not properly working, all the value it import from the json array stored in only only index.

    Kindly check this dropbox.com/s/5yzwumg4g3ym29c/Array%20Json%20Question.c3p

  • You do not have permission to view this post

  • You do not have permission to view this post

  • Thanks, bro for your response, :) Actually, I couldn't able to put it properly, "No animation should be repeated" I mean to say that on the same round, COLOR RED shouldn't appear twice, but it's fine if it appears once again on the very next round.

    In my opinion, the easiest way to do this is with an array containing the animation names. When the game starts, you create the array and fill it. At the start of each round, you pick 3 random items from the array and set the text and image objects from them, then remove them from the array.

    > I'm trying to make this matching game as an endless one...

    > ...//probably 100 different animation

    I just want to point out, if you have 100 animations, showing 6 at a time and don't ever want an image to appear more than once, this project won't be an "endless one." The most levels the player will be able to play is 17. For an endless game, I would suggest not having the requirement that an image not show more than once. Since the images are chosen randomly, it is very unlikely that an image will appear right after it already has. Statistically, with a high number of images, it should be a while before you see the same image again (with these numbers, an image should show 1 time in 17 rounds).

  • InDWrekt Bro one question, it might be the lengthy one,

    Thanks to you I have come to this far, I'm trying to make this matching game as an endless one, every time user matches the 6 objects successfully, instead of going to the next stage, it will restart the same layout, but now the 6 animations will come randomly and the corresponding 6 text object will have the name based on the 6 animations name. But two condition, (1), Out of those 6 COLOR, no animation should be repeated, means, Color Red should not be coming twice. and (2), the sequence of either colour image or colour text should be different.

    What I have tried,

    Gave another instance variable to both Color Text & Color image.

    On the start of the layout, set the COLOR animation and "choose("RED", "GREEN", "YELLOW","BROWN""PINK""PURPLE""WHITE""BLACK" . .....//probably 100 different animation)" while comparing when Color_IV = 1. (IV = Instance variable)

    For the text, On the start of the layout, set the ColorText to "Color.AnimationName" while comparing when ColorText_IV = 1. (IV = Instance variable)

    But it's not working, I know I missed a hell lot of things, should have been used array or something, but couldn't able to fig out.

  • Thank you so much, bro, you are amazing, The way you pulled this things is another level :)

    In this image, I modified the tap ColorName action. It is now an on tap action which clears the color of the text with a subevent picking the tapped text object and sets its font size and color. In this version I am also using a global variable instead of the highlights variable.

    As for your comment:

    > InDWrekt ...

    > (I know "ColorNameHighlight" is kinda compulsory, so I made it invisible on the startup)

    >

    > Please help. Thank you.

    Nothing in the code I sent you is "compulsory." You can do everything I showed you many different ways. I try to emphasize this to newer Construct users. Nothing I show you is "The right way." It's just ONE way.

    I have modified the original project. There are now 2 different event sheets. The first layout is using the new event sheet. Instead of using the highlights, I added 2 instance variables to the TriesCountLabel that hold the last chosen color and name. I scale up the selected text and color squares and change the color of the text object. The new version still keeps score the same way, disables colors and names that have been correctly selected and continues to the next level when all 3 colors are chosen.

    Remember, there are many different paths that lead to the same result. The most important thing for you, is to learn the tool and decide which path works best for your needs.

    Good luck with your project.

  • InDWrekt A small doubt, Instead of placing the "ColorNameHighlight" over the text for Text Highlights purpose, how to change the text colour to something else (eg. from BLACK to RED) and return to its original colour when the user clicks to other text.

    (I know "ColorNameHighlight" is kinda compulsory, so I made it invisible on the startup)

    Please help. Thank you.

  • Redownload the project. I made some modifications to it.

    Thank you so much, Never thought this can be pulled only using just a few lines of code, love you, bro. :)

  • Thank you, InDWrekt, it was so helpful.

    Now having fewer doubts xD

    1. Still unable to crack The wrong answer, for wrong audio sound purpose, please check the .c3p

    2. Added the Score, but how to track the total attempt by the user including correct one and wrong one (Created a "text_TotalTry" text and gave an instance variable)

    3. Struggling to reset the "Highlights"s position.

    Everything else is now cracked :), Once again thank you :)

    Please help.

  • Thanks InDWrekt for your response.

    I did exactly what you have suggested from that .c3p I'm surprised the way you pulled that on just 3 line of code. AMAZING.

    Few things where I need your assist

    1. The preview pan. I still confused how to do that here :(

    2. When user click the wrong one, how to give a wrong sound,(I already gave the correct ones sound)

    3. How to RESET the highlight's position when user got correct/right. Or can we destroy the highlight?

    4. When user match the 1 pair of animal & text, currently the animal image is destroy, how to destroy the animal text too.

    5. (this question is similar to the previous question) Instead of destroying I have made the opacity to 30%, but it still clickable. How to make it unclickable.

    6. How to add the text when user is correct (Score part), and how to count a total try for that session. (I already made 2 text and 2 global variable not sure where to put it)

    Please check this .c3p I have complied that using your code.

    Please help.