10 Mar 2022, 16:36

I am making a simple avoiding obstacles game. Currently, the player can be moved with the left joystick. I am now starting to add obstacles. My idea is to have an array that contains a structure for every obstacle. This structure has an X and Y comment which is responsible for holding the position of the obstacle. However, I am struggling to add these structures to the array. Is there a better way to do this? What is the best way to spawn obstacles at random positions on the screen? I am a beginner so baby talk, please.
The shared game code is TWC3MNDHX
Thank you in advance