Quote: "hope this makes sense"
TBH, it doesn't. I put together something that at least will allow the creation and placement of blocks. I think what you would need would be an array that would store the contents of individual grid spaces, but then again, perhaps not.
sync on : sync rate 60
backdrop on : color backdrop 0
randomize timer()
autocam off
`array for players placed blocks
dim grid(25,40) : `arbitrary numbers for a grid
global NextObject : NextObject = 1000
`load block objects
`load object "one.x", 1 : hide object 1
`load object "two.x", 2 : hide object 2
`load object "straight.x", 3 : hide object 3
`load object "sleft.x", 4 : hide object 4
`load object "sright.x", 5 : hide object 5
`load object "lleft.x", 6 : hide object 6
`load object "lright.x", 7 : hide object 7
for i = 1 to 7 : ` use this for temporary, as I don't have Boonsy's media
make object cube i,10
r = rnd(128) + 127 : g = rnd(128) + 127 : b = rnd(128) + 127
color object i,rgb(r,g,b) : set object ambience i,rgb(r,g,b)
hide object i
next i
`camera settings
position camera 0, 0, -100
CurrentObject = 100
NextObject = GetFreeObject()
clone object CurrentObject,1
do
text 100,10,"Press 1 - 7 to select an object"
sc = scancode()
if sc >= 2 and sc <= 8
if object exist(CurrentObject) = 1
delete object CurrentObject
endif
clone object CurrentObject,sc - 1
show object CurrentObject
endif
`moving object
if rightkey() = 1
move object right CurrentObject, 1 : `0.01
endif
if leftkey() = 1
move object left CurrentObject, 1 : `0.01
endif
if upkey()=1
move object up CurrentObject, 1 : `0.01
endif
if downkey()= 1
move object down CurrentObject, 1 : `0.01
endif
`clone object to objects position
if returnkey() = 1
NextObject = GetFreeObject()
clone object NextObject, CurrentObject
endif
sync
loop
end
function GetFreeObject()
repeat
if object exist(NextObject) = 1 then inc NextObject
until object exist(NextObject) = 0
endfunction NextObject
If this is way different than what you are wanting to do, maybe you could elaborate some more. I do hope this is helpful.
LB
So many games to code.......so little time.