Make my own particle system
Posted: Sun Jul 26, 2020 7:03 am
I am doing a weather simulator for my game and I thought the built-in particle system would be excellent for rendering snowflakes. It turns out those particles cannot have values changed after they have appeared so if the player press a button so the screen moves in a certain direction it now looks like it starts to blow in the other direction(the X position of the snowflakes remains the same).
I have an image of a snowflake I would like to render 60 or so times at once, on different positions. When a snowflake reaches the end of the screen it should spawn at the other end. That is on both axes so when Y > ScreenHeight then Y = -SnowflakeHeight and if X > ScreenWith then X = -SnowflakeWith and if X < -SnowflakeWith then X = Screenwith.
I tried to make a function that draws all snowflakes and loop that function in the draw function but I am terrible at looping and it crached upon starting the game.
I have an image of a snowflake I would like to render 60 or so times at once, on different positions. When a snowflake reaches the end of the screen it should spawn at the other end. That is on both axes so when Y > ScreenHeight then Y = -SnowflakeHeight and if X > ScreenWith then X = -SnowflakeWith and if X < -SnowflakeWith then X = Screenwith.
I tried to make a function that draws all snowflakes and loop that function in the draw function but I am terrible at looping and it crached upon starting the game.