title: addObject() in blender with python
body: <p>I ran into a little wall here:
  my point is, for a empty, to move, then add a plane on the spot, then move, then add a plane etc, and then will end up with a 100X100 plain, so i scripted:</p>
  
  <pre><code>import bge
  
  dunWidth = 100 #meters/tiles
  dunHeight = 100 #meters/tiles
  b = 0
  a = 0
  add= bge.logic.getCurrentScene().addObject
  
  def main():
      global b, a
      cont = bge.logic.getCurrentController()
      dunMarker = cont.owner
      #Movement Calculation: (X, Y, Z)
      while b &lt; dunWidth:
          b += 1
          add("FloorTile", "DunMarker",0)
          dunMarker.applyMovement((1,0,0), False)
          while a &lt; dunHeight:
              add("FloorTile", "DunMarker",0)
              a += 1
              dunMarker.applyMovement((0,1,0), False)
          #dunMarker.applyMovement((0,-dunHeight,0), False)
  main()
  </code></pre>
  
  <p>but instead, to my surprise, it First add the tile, then goes through the loop ignoring the add(), so the result is a 1x1 tile at 0x0y and the empty ends at 100x100y... how many things Im doing wrong here?Aaaand, since we are here, how would you improve the coding?(trying to learn here ;) )</p>
  
  <p>pd, yeah, Roguelike 3D project</p>