How do I load a random non-sequential image from the project files folder?

0 favourites
  • 5 posts
From the Asset Store
With this template you can create your own archer game and customize it however you want.
  • If I have

    car.png

    truck.png

    bus.png

    in the files section of the project, how can I randomly load one of them using load image from url. I know how to do it if they have the same base and a number.

    I've read every old post that seems related, and nothing. It would be terribly disappointing if this is not possible. Seems like it should definitely be doable.

    I also can't figure out how to simply load the first one, and then advance through them as the user clicks some sort of next trigger.

    Thanks for any assistance.

  • Use choose("car", "truck", "bus") & ".png" in your URL.

  • Use choose("car", "truck", "bus") & ".png" in your URL.

    I have hundreds of images though, and they will occassionally be changed and refreshed. Also many separate lessons, so in the big picture thousands. Much easier if it's automatic. Choose is not really a viable option in this case.

  • You can put all of them into an Array.

    Then load with Array.At(random(0,Array.width-1))&".png".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Choose and arrays are not options to achieve this.

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