I use construct 2 to create my first Html5 game.And I have a request that random to load image.For example,I have 5 images in my image folder,but every time user enter the game ,it just need to load one.
So I create a sprite object first and I want when the page loading the sprite can random to set a image by global variable.How can I do?Or any methods?Thank you.
if you have the images inside a sprite, use the following
on start of layout - sprite.setframe=round(random(self.animationframecount))
see if that helps. keep in mind, using the animation frame count and a random of that total number, might be that some times, on start of layout you might get the same frame to show, since has no actual order.