lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


In my star trek game, I have code that draws the photon torpedo by
placing a "o" in each cell it passes through, then on the next
location update erasing the "o" calculate the new location and
placing another "o". there is even a loop between the draw and
the erase that waits for clock() to increment (about a second).

The problem is I only see the final "o" where the klingon is
destroyed.  ????  I don't see any of the intervening "o"s

I changed the "." to "e" and saw the "e"s

I increase the wait and it seems like the whole output
waits and then all happens at once, just before I am
prompted for the next command.


Pseudocode!!!
------------------------------------------------------
torpedolocation = enterpriselocation
graphiclocation = 0
repeat
     calculate next torpedolocation

     if graphiclocation ~= 0 then
        print "." at graphiclocation
     end

     graphiclocation = calculate(torpedolocation)

     print torpedolocaton at displayarea

     print "o" at graphiclocation

     wait 1 second

     -- smack a starbase?
     -- smack a star?
     -- smack a klingon?
until somthing-is-smacked

------------------------------------------------------

Does Lua cache changes to the screen until enough happens
to require a redraw?  Is linux console not keeping up
with my program?