I've got a particle system spawning snowflakes at the right edge of the game screen; they then blow across towards the left. Therefore, in the config file, the snowflake particles are given a random position, somewhere between the top and bottom of the screen:
Color = (150, 150, 150)
Alpha = 0.6 ~ 0.7
Position = (0, -300, -0.5) ~ (0, 300, 0.5)
Speed = (-400, 0, 0) ~ (-500, 0, 0)
Now, my game will be fullscreen at the player's native desktop resolution (I previously got that working with the SVN build of Orx, with some troubleshooting mentioned here
). Since different players will have different screen sizes, I'd like to ensure that the snow particles spawn in the appropriate range.
Is there any way to change the random range of an object at run-time?
This is fine with most 2D games as sprites don't like being distorted anyway (UI has even more problems, but in orx they can be placed with relative coordinates).
The positive part is that all your coordinates are in world space and don't need to be adapted.
If it's not the case, and you want to support different aspect ratios/resolutions, you can then change your object properties at runtime. So as to prevent the randomness, you can do it at loading time, when you know the screen size (orxDisplay_GetScreenSize) and replace the config value (orxConfig_Push/Set/Pop).