L
ladlon
Guest
Hello. I wanted to see what methods might be available for this...
I want to place object tiles at a random horizontal position on a ledge/floor in my platformer... but I would like their position to be only EVEN numbers, so that they are never adjacent to each other (...always at least one tile space between them).
I'm not too well-versed in all the GMS Pro commands, but also proper methods... but one way I figured would be with:
ItemX = TileSize * Floor(NumberOfTilesAcross / 2) * 2;
Where ItemX is the horizontal position of the instance, and NumberOfTilesAcross is the intended number of tiles across the playfield.
Is this an acceptable method, or is there some better way?
I want to place object tiles at a random horizontal position on a ledge/floor in my platformer... but I would like their position to be only EVEN numbers, so that they are never adjacent to each other (...always at least one tile space between them).
I'm not too well-versed in all the GMS Pro commands, but also proper methods... but one way I figured would be with:
ItemX = TileSize * Floor(NumberOfTilesAcross / 2) * 2;
Where ItemX is the horizontal position of the instance, and NumberOfTilesAcross is the intended number of tiles across the playfield.
Is this an acceptable method, or is there some better way?