zatyka's Forum Posts

  • I may be misunderstanding the issue, but you shouldn't have to set the characters widths for each new text within a project. The widths should carry over to each instance of the spritefont. If you're using multiple spritefont objects, and want to set all their character widths, you could add them to a family, and set the character widths of the family.

  • Demo

    Capx

  • You can loop through each letter in the textbox, check if it's a certain letter, and if so, add 1 to a local variable. I'm not at my main PC, so I can't upload a capx, but it would be something like:

    Local varaible "A Count" = 0

    Repeat (len(textbox.text))

        {

        If lowercase(mid(textbox.text,loopindex,1)) = "a"

            {

            add 1 to local variable "A Count"

            }

         }

    If you're still having difficulty, let me know and I'll upload a capx when I get a chance.

  • I imagine it's done with masking and careful Z ordering. Something like this:

    Demo

    Capx

    I hope this helps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As someone who uses keyboard shortcuts as much as possible, I support this suggestion.

  • No. You have 3 possible tokens, but you have to remember that they're zero based when using tokenat. The expression round(random(3)) returns 4 possible values (0,1,2,3..even though it's not completely random... see below). Therefore, the expression tokenat(JSON_,3,"|") looks for a 4th token, which doesn't exist. Using floor(random(3)) ensure only 3 possible values (0,1,2).

    It's not a good idea to use round(random(x)) since it's usually not truly random. Round(Random(3)) is twice as likely to result in a 1 or 2 rather than a 0 or 3. Using floor(random(x)) is usually a better option.

  • The way you have things set up, the array loads some of the time, and other times it tries to load a token that doesn't exist because you're rounding the random value instead of flooring it. Change the expression to:

    tokenat(JSON_,floor(random(0,tokencount(JSON_,"|"))),"|")

  • sosensible

    I replied to your other topic regarding the image editing/saving methods I used. Was there any other aspects of the application you had questions about?

    I'd actually upload the capx for you, but the code is a hot mess since I was trying to finish the app in 48 hours.

  • The method I used to make Paint Share is relatively straight forward.

    Create a 3 dimensional array, with each cell on the X and Y axis representing a pixel. Use the Z axis to save the pixel's color data. In the application's editor, create a "pixel sprite" for each X and Y element, place it appropriately, and set its color. To keep things simple in Paint Share, I limited the palette to only 10 colors, and created a different frame for each color within the pixel sprite. I did this to make sure the game would work on platforms using Canvas2D (IE Mostly). If you're targeting WebGL enabled devices, you could probably get away with a single white sprite, and set it's color using shader effects.

    Anytime the user makes an edit to the image, the appropriate cells and pixel update. To show a preview of an edit (like when drawing a shape/line), the appropriate pixels change color when the mouse button is down, and the appropriate cells are updated when the mouse button is released.

    When you save a drawing locally, the array data is saved to webstorage. When the application is restarted, the array data is retrieved, and the image is redrawn in the application's editor. If a user wants to upload their image to the web for others to see, the canvas size changes to the size of the image, a screenshot is taken, the canvas size goes back to normal, and the png data goes to my server. That way, other users download images as png's rather than an array that renders a sprite per pixel.

    Believe it or not, the hardest part about making the app was creating a flood fill tool.

    Good luck!

  • One way to do it is to record the sprite's X and Y position from the previous tick, and set the sprite's angle based on the angle between its previous position, and its current position.

    Demo

    Capx

  • It's not the most elegant solution, but it gets the job done:

    Demo

    Capx

    I hope this helps.

  • That was quite fun. The words, but moreso the specific letter combinations, felt very foreign to my fingers, which added to the difficulty of the game. However, I managed to squeeze out a 184. I did notice two things you may want to consider fixing/changing:

    1. After the end of a round, the restart box would sometimes drop, and other times it wouldn't. In the case of the latter, the game behaves as if I had typed "restart", and a new stack of words would fall. I couldn't consistently make either behavior occur.

    2. The text can be difficult to read when placed on top of a lighter colored block. This becomes more evident with the text turns yellow.

    Really nice job overall.

    EDIT:

    Now that I'm not half asleep, I wanted to see if I could best my score. I ran into another issue. I was unable to get past hyphenated words. I could type up to the hyphen, but couldn't make it past.

    Also, new high score - 204

  • Dalal

    One option is to create your own word wrapping system using events. Here's one way to do it that wraps in between words.

    Demo

    Capx (annotated)

    I hope this helps.

  • Instead of trying to parse the save data to try and find the relevant info, I'd recommend separately saving the stats you want shown to the player in web storage (or online if you've got that set up). Make sure to somehow associate the save data with the stats in web storage, so the save files can be selected, and retrieved at a later date.

    When the player is selecting a save file, display the stats in web storage to discerne between the save files.

  • DatapawWolf

    True, but not everyone has/qualifies for a credit card. Back when I was a teenager, I would have loved to have prepaid cards to make online purchase.