how to randomize backgrounds?
famekrafts
Member, BASIC Posts: 834
I have different backgrounds and I would like to randomize them for different levels.
For example, each level starts with a random background.
currently I am using random(1,4)
if 1 change image to bg 1
if 2 change to bg 2 .... and so on
The problem is it takes some loading time when the level icon is clicked from the main menu
and when changing directly between stages, it first shows the original bg and then after a sec changes randomly to another background even though the timer is 00 secs. This change doesn't look good.
Is there a better and fast way to get this done?
For example, each level starts with a random background.
currently I am using random(1,4)
if 1 change image to bg 1
if 2 change to bg 2 .... and so on
The problem is it takes some loading time when the level icon is clicked from the main menu
and when changing directly between stages, it first shows the original bg and then after a sec changes randomly to another background even though the timer is 00 secs. This change doesn't look good.
Is there a better and fast way to get this done?
Comments
I am facing size problem as well, being HD the size of one bg is going to 3mb a jpeg files.
I am not sure whether png files are smaller in size than jpeg or not when imported inside GS?
I imported 4 jpeg images into GS, my size jumped from 27mb to 37 mb and app size is about 49 mb.
Is this size fine for a HD game?
Has the app name changed ?
yourvariable = 1,2, 3, 4... (randomise it wherever you want) then change self.image to whatever png. make sure in your expression editor you do speech marks like this ""YourImageName"..".png" or it won't find it.
http://imageoptim.com
constrain attribute
spawning of the loading image
or interpolate?
spawning is the only thing which is working right now. Not sure if it will take extra seconds.
For a smooth transition I need to spawn the loading scene on the stage scene as well, so player doesn't know any changes occurring while loading and after loading.
Aim now is to display some message on the loading screen as well, about the full game and other stuff.
How did that imageoptim work? Help you out at all? hope so!
imageoptim works, but for some reason for few images its reducing about 12 - 16% size while for some just 0.1 %, very weird, but at least few mbs will get saved. Thanks