As if the problem is … let’s say if an object overcomes a certain distance, a new cube was added to the new position, but only once. Probably what you wrote does not quite fit.
Probably I need to rephrase the question - can I check the given coordinates for the presence of a cube (object) there, and if there is not, create it?
Thank you for your reply.
This will be hard, because in normal conditions you do not know if there is a cube.
What you can do is add a cube, store it location in a list, then loop trough the list and check the position with the new cube’s position, then if that position is in the list skip adding cube and go to next position.
Ah ok, not gonna write that for you, but here is an example.
position_list = 
own = cont.owner
spawner = own.scene.objects['spawner']
if not position_list:
if not spawner.worldPosition in position_list:
own = cont.owner
last_added = own.scene.addObject('Cube',spawner,0)
spawner.worldPosition.y += 1.0
in this case, the list only stores location of the cubes you have spawned, so you can use it later.
but this is basically the basics to add cubes in a straight line.
You can add an in range() check to add squares, but to keep it around the player is a completely other story.
best is to look into resources, should be some scripts there ready to go. for example: dig world problem
you wrote - “is an example” - I can use it as a tutorial to create my own example with the license CC0? For example, for me the concept of “return” is new …
you wrote - “best is to look into resources” - if someone has laid out the code in response to a question (part), it will still work, and then you can catch on. But basically on the forum ready-made solutions (files) - there is completely copyright of the owner. Search for everyone and ask … I can, but it’s very difficult.
In general, in some forums clearly spelled out - the answers of users under the license - such and such.
Thank you for attention.
People and their license issues lol, yes of course use it anyway you see fit,
The return breaks up/stops a function for a frame, if i would not have added the return, then in the first frame it would execute all the code, now with the return it will execute the first part on the first frame, then on frame 2 it will execute the rest of the code and skipping the first code block, because at frame 2 the position_list got an entry.
Yes and no, if someone shares a solution to the public then everyone may use it, the code/blends/etc are automatically licensed as a public one. and you can simply add credits to the one who made it. Just don’t brag about it that you are the maker of the code, because if you do then you are breaking the public rules.
If i am right the link i posted has what you want/need, so you can PM @VegetableJuiceF and ask if you may use it, if you aren’t sure about it.
Thank you for permission to access, and an explanation.
yes, because the Law says differently, and for this there is a CC0 license. If you do not specify a license, then all the work of the copyright to owner - it’s not I came up with, it’s an international Law.
A little bit probably not so - BGE is GPL, blend file - structure and format of GPL, work is mine. As in any editor, even that Word is all under MSoft, but the text of the user is not. The same as GIMP files, Audaсity …
And probably a very urgent issue - a compiled binary with a scene and BGE:
if I create an executable ZIP file, this does not mean that everything is under the archiver’s (module) license. Similarly, the binary is an archived archive with BGE and the scene, and everything is under its own license.
Just there were such cases (not me) that opened the binaries, and there BGE + scene. The compiled file, it’s not BGE, but some executable archive with the sources and the executable file BGE. It seems I was not mistaken anywhere.
if the binary file inside is divided into two components - the blend file, and the BGE binary, then this statement is not even legal. I do not think that there is a recompilation and some kind of crazy mix of the code of the main BGE. How can an executable archive (attachment) become an archiver license? No way! Forgive me for this reasoning.