E
Edeyz
Guest
I am making a game set in space and don't wont to have to place every star manually.
So I have created a "Star density map" to show where the [object] obj_star 's need to go (darker parts more stars).
Here is an example of what I mean (Not my actual one, but that's hardly better as i'm not yet finished it.):
I know how to create instances at coordinates and assign all the variables of them and the size, colour ect. but I don't know how to get them to spawn in accordance with the map.
I was hoping I could do something like this:
>game start
>Load room "rm_map"
>create instance of "obj_starSpawn"
>create instance of "obj_map"
>in obj_starSpawn"
>>numberOfStarsToSpawn = 100
>>for numberOfStarsToSpawn
>>>choose random position on map giving higher priority to darker areas
>>>create instance obj_star
>>>with obj_star
>>>>assign variables
>Save Game
>Load room "rm_mainMenu"
I would also if possible like to ensure that GameMaker spawns this the exact same way (stars in same spots) every time the game is run. (even when not running through GameMaker itself)
Thank you for your help
-Edeyz
Also, I didn't quite know what to call this thread and what tags to add, so If there is a proper name for this or more tags I should add can you please tell me?, thanks.
So I have created a "Star density map" to show where the [object] obj_star 's need to go (darker parts more stars).
Here is an example of what I mean (Not my actual one, but that's hardly better as i'm not yet finished it.):
I know how to create instances at coordinates and assign all the variables of them and the size, colour ect. but I don't know how to get them to spawn in accordance with the map.
I was hoping I could do something like this:
>game start
>Load room "rm_map"
>create instance of "obj_starSpawn"
>create instance of "obj_map"
>in obj_starSpawn"
>>numberOfStarsToSpawn = 100
>>for numberOfStarsToSpawn
>>>choose random position on map giving higher priority to darker areas
>>>create instance obj_star
>>>with obj_star
>>>>assign variables
>Save Game
>Load room "rm_mainMenu"
I would also if possible like to ensure that GameMaker spawns this the exact same way (stars in same spots) every time the game is run. (even when not running through GameMaker itself)
Thank you for your help
-Edeyz
Also, I didn't quite know what to call this thread and what tags to add, so If there is a proper name for this or more tags I should add can you please tell me?, thanks.
Last edited by a moderator: