Hello,i’m working on my space shooter game and i have a little problem with spawning enemy ships in selected area.I don’t know how to do it.This is image of my first level.s31.postimg.org/uffs441nf/Game.jpg
PS.Sorry for any grammar mistakes.English is not my native language:)
You can get the random position with the top-left rectangle vertex plus a random size:
(X; Y) = (Left + Random(Width); Top + Random(Height))
For example, in your image the rectangle is far at right (left = 1200) and has a little width (width = 50), so the random X position inside the rectangle is:
X = 1200 + Random(50)
Do the same for the Y position and you are done ![:slight_smile: :slight_smile:](https://forum.gdevelop.io/images/emoji/apple/slight_smile.png?v=12)
Now everything works perfectly!Thank You!