kanomaster kanomaster loading
Alright, so let's say I have 20 different clones that are buttons. (The functionality of the buttons doesn't matter for this question). Each of the clones spawns in with it's own variable called “ID” (which is set as “for this sprite only”) Based off of this I can say:
set x to ((ID) * (50))
This will make all of the buttons spaced apart by 50, but they will eventually go off the screen. It looks like:

1 2 3 4 5 6 7 8 9 10…. (goes past edge of screen)
Whereas I want something that loops back when a certain number of buttons are in one row: like

1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
How would one go about doing this? Thanks!