0 Favourites

How do I make it work again?

  • Hi all

    I made a game of Japanese Spelling. Last night when I tried to do spelling by comparing two texts, it worked. But when I tried it again this morning, it doesn't work now. And now I'm super confuse.

    Here is the .capx

    drive.google.com/open

    It is on the Battle tab. I am using the Drag and Drop feature, it will append words on the text after put the letters on the grey box.

  • You need to provide more information - instructions on how to play (not all of us here know Japanese ), how the game is supposed to work, what exactly is the problem?

  • I am using a drag and drop feature, the words that supposed to be spelled are below the layout, like sensei, ashita, mikan, gakusei and so forth. Each letter are assigned with texts that have been included in the event sheet.

    By dragging each letter to the grey box, letters will be appended in the Word plugin text. When tap on the attack button, if the words are correct by comparing the words of Word text and the other plugin texts which are outside of the layout, animation for the player should start, else the skeleton will animate.

    When the first time I tried it, it worked. But now it doesn't. There are some bug in the game, but I will fix it later.

    I need to know what is wrong with the current error. T-T

  • I don't know any of the Japanese alphabets and have no idea which letters to choose.

    What I can say after a quick look at your project is that it's very inefficient.

    Your letters sprites are HUGE - 1367x1368 pixels each! This greatly affects performance, memory usage and project size.

    Resize them and add all to just one sprite as different animations.

    Then you'll be able to remove about 70 events from your "Letters" group!

    And your project will likely reduce in size from 26Mb to 1-2Mb.

    (image clickable)

    Also, you should name your objects correctly. You have about 150 sprites named "SpriteXXX", and a dozen of tilemaps named "Tilemap". How can you possibly find the right object in this mess?

  • I'm sorry, I should've mentioned you that I am still a newbie and learned everything from Youtube. I will rename and resize it to make it more efficient.

    Here are the letters that can be used to formed the word "sensei".

    "add all to just one sprite as different animations" and I have no clue what does this word meant.

  • See my screenshot above -

    A sprite object in C2 can have many animations. Each animation may have many frames.

    You can have just one sprite named "Letters". When you double click it, there will be a small window with the list of animations.

    Create separate animation inside this sprite for each letter.

    When you add a sprite instance to your layout, you can select (on the left panel) which animation and frame of the sprite will be displayed.

  • Your code doesn't work because your event 78 checks if Word contains all words!

    It basically says "if text is sensei AND arigatou AND ashita AND ..."

    It should be an OR block.

    But again, this code is extremely inefficient... You shouldn't use Text objects just to store single words.

    I fixed this event, created Letters sprite with a few animations (you should add other letters) and cleaned up your Battle event sheet:

    Of course, there are still a lot of unresolved issues -

    1. I can drop letters on top of each other.

    2. If I used "se" letter once, I am unable to use it again. (sensei needs two letters)

    3. If I pick up letters again after I dropped them, or if I change their order, the Word.text should be recalculated. Currently a letter is just appended at the end, which is wrong.

    etc..

  • For the unresolved issues of 1 and 3, I'm still searching for tutorials on Youtube and tutorials in this forum.

    As for number 2, there are two character sprites of "se" in the layout.

    I downloaded your .capx provided and I still can't figure out how you display the sprite. I'm confused. You said that use sprite instance, which I don't see it. Is it the instance variable because I don't see any changes there though

  • "Letters" sprite is an object.

    When you add copies of "Letters" sprite to the layout, you create its instances.

    For each instance you can select different animation and other properties, set different values for instance variables.

    It's one of the very basic principles in Construct 2.

    All these letters on the layout are different instances of the same Letters sprite.

    To sum up:

    Having 100 letters as 100 different sprite objects is bad.

    Having 100 letters as 1 sprite object with 100 instances is good.

  • I see. I think this part of making it work have been solved. Thank you.

    Right now I just need to figure out how to fix the issues you mentioned.

    And there is one other problem. Should I open a new topic or post it here? Because it talks about the animation and spawn to the current animation.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • It's up to you.

    Here are a few tips:

    1. I can drop letters on top of each other.

    Add isOccupied instance variable to your Sprite133 (grey box). Set it to True when letter is dropped to it. Set it to False when letter is dragged from it.

    You can also add instance variables startX and startY to the Letters sprite. On start of the layout, save X and Y position of Letters instances to these variables.

    Then if the letter is dropped on an occupied grey box, return it to (startX, startY) position.

    3. If I pick up letters again after I dropped them, or if I change their order, the Word.text should be recalculated. Currently a letter is just appended at the end, which is wrong.

    You can try something like this:

    Word set text to ""
    Sprite133 -> boolean variable isOccupied set   // this will pick all occupied boxes
       For Each Sprite133 order by Sprite133.UID   // This will loop through occupied boxes
           Sprite133 is overlapping Letters   // This will pick a letter on each box
               Word append text  Letters.AnimationName    // and add this letter to Word
    [/code:1rsijhor]
    
    You can make this a function and call it every time any letter changes its position.
  • By the way, I still can't figure out how you change the letters on the layout. I tried it myself this past few days, but I still can't figure out.

    Put letter sprite on layout, add animation, then I see no changes. How do you do it? All of this instances is very new to me

  • max2612 It's on the properties panel:

  • Okay got it. Thank you.

    You can also add instance variables startX and startY to the Letters sprite. On start of the layout, save X and Y position of Letters instances to these variables.

    Then if the letter is dropped on an occupied grey box, return it to (startX, startY) position.

    About this one, is it a plugin? I don't seem to have that startX or startY though.

  • Okay got it. Thank you.

    You can also add instance variables startX and startY to the Letters sprite. On start of the layout, save X and Y position of Letters instances to these variables.

    Then if the letter is dropped on an occupied grey box, return it to (startX, startY) position.

    About this one, is it a plugin? I don't seem to have that startX or startY though.

    Instance variables are covered in the Manual. Please try to do a little research for yourself - this is how you will speed up your understanding of the Event system.

    Obviously, there is no problem asking for help, but your questions show you have not really read and understood the manual yet.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)