- Home /
cube spawn next to another cube in the same row
how would i spawn a cube next to another cube in a row? for example i spawn a cube point my crosshair on that cube i just spawned and spawned another one and that new cube goes right beside it how would i do that?
Answer by Jesse Anders · Mar 30, 2011 at 06:35 AM
I think this might be a duplicate question (not sure), but I'll try to provide an answer that (I hope) will provide the needed info.
What you're asking about doesn't really have an easy, short answer. It's also kind of a broad question, at least for UA. As I've stated in response to other threads, open-ended 'how-to' questions often fair better in the forums (IMO), where it's easier to post follow-up questions and responses and continue the discussion until a solution is arrived at. If you find you aren't getting the answers you need here, you might try the forums instead. Also, try searching UA and the forums for 'minecraft', as this topic has been discussed extensively.
As for your question, the very first thing you'll need to do is define the desired behavior in detail. In particular, you need to decide how the interface will work. For any cell there are six neighbor cells (generally speaking - some of them may already be occupied of course), so firstly you need to decide which of these neighbor cells should become occupied when you click on an occupied cell. More generally, you might try some of the various 'block building' games and demos out there and see how the interfaces work (I think most of them incorporate some sort of 'intelligent' interface that makes a reasoned guess as to what cell the player if targeting).
Beyond that, the whole 'cube world' thing can range from very simple (a 3-d array, if the world is small enough for that to be practical) to more or less arbitrarily complex (various data structures and spatial organization techniques leveraged to facilitate large worlds, batching for efficient rendering, etc.). If you're a beginner however, I'd recommend starting with the simplest possible implementation, which would probably be a simple 3-d array, and then work from there.
That, I think, is your starting point. If that doesn't give you enough to go on, then you need to refine your questions and make them more specific. You can follow up here, or try posting to the forums as previously suggested.
Hope that helps.
yeah it's a duplicate. He has used 3 different accounts now to ask the same question and not paid attention to any answer, just keeps asking for script.