Random Between: using random with the instance_create function in GML
- by CLockeWork
Hopefully this should be a simple one; I want to restrict the points that instances enter the screen from so they don't come in at the edges.
In Game Maker I'm using the following code instance_create(random(room_width), random(-100) - 50, obj_enemy1); to create the instance off screen (create(x, y, ...))
At the moment I'm just using the room_width to define the max width for the random on x, but ideally I want to find a way of defining a max AND min width for the random. I can't figure out how to restrict the range on the x axis to between say 100 and 350.
Any help would be appreciated.
Cheers