dop2000's Forum Posts

  • PICTURE_SET: Set animation to Array_PICTURE_NAME.At(AdvancedRandom.Permutation(0), (n)) (play from beginning)

    Try this:

    PICTURE_SET: Set animation to Array_PICTURE_NAME.At(0, AdvancedRandom.Permutation(n)) (play from beginning)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • On Every Tick: ProgressBar Set Progress to var

  • what "System: LoopIndex < 100" does?

    It prevents infinite loop. Normally it does nothing, but if you make a mistake in your code and create an infinite loop, the preview window or even the editor window may freeze.

    That's why I always add this condition to While loops.

  • Since every quiz question is a separate animation, you can do this easier without arrays. Put an instance with each animation on the layout (off-screen). Then in "On start of layout" event pick a random instance and move it to the layout. Repeat 6 times.

    This will work for numbers, letters, colors, or any mix of them. All you need to do is put the correct instances on the layout.

  • means all data from JSON Alphabet, Number, Color, will come randomly.

    You should have mention this before..

    If you are not planning to make frequent changes to this array, maybe it would be easier if you made it 1D. Put all values on one X axis (in one line), numbers first, then letters, then colors. Without empty spaces between them.

    Then you can use my method with Advanced Random, but for numbers you create premutation table with length 10 starting from 0. For letters - length 7 starting from 10. For colors - length 8 starting from 17. For mix of everything - length 25 starting from 0.

  • mesh transform?

    No, two physics joints and a few round sprites.

    Actually, using mesh transform may be a good idea. When I made that demo mesh transform was not yet available in C3.

  • Can I ditch the Preview_PICTURE_SET entirely? and just use another instance of "PICTURE_SET" for the preview purpose?

    Yes, you can. Just make sure it's not picked in the event where you assign random animations. You can use a boolean instance variable isPreview for this.

    When you need to pick the preview instance, use "isPreview set" condition

    When you need to pick all random instances, use "isPreview is NOT set"

  • That's not a script. It's events.

    Please study a few templates, they are extremely useful for a beginner.

  • 1. I don't know. You have lots of objects with long names, I have no idea about their purpose.

    2. Simply add "Sprite set animation frame to random(self.AnimationFrameCount)" after you set a random animation to the sprite.

  • You need to share your project file (C3P), not the exported game.

  • You can do something like this:

    Global Variable CoinsBalance=0
    
    Player on collision with Coin
     Coin destroy
     Add 1 to CoinsBalance
     CoinsText set to "Coins: " & CoinsBalance
    

    If you want to make a nice effect when picking coins, check out the new template "World to HUD Position" in beta version of Construct.

    https://editor.construct.net/#open=world-to-hud-position

  • Empty cells in the array make the task more difficult. You should either copy non-empty cells into a temporary array, and shuffle it. Or use this method with Advanced Random:

    dropbox.com/s/elkhyxz8u75syzb/QuestionForDop2000%20%28With%20Layouts%29.c3p

  • I don't understand what you are trying to achieve, even with the project file.

    Can you explain?

    If you need to shuffle 2D array, can you post two pictures - the original array and shuffled (manually, just as an example)?

  • If it's a simple linear gradient you may be able to calculate rgb values.

    You can also post it on a DrawingCanvas and read pixel data from it.

    If you are making a color picker, check out this page:

    howtoconstructdemos.com/hsv-color-picker-tool-c3p