LZ: program question
[Prev][Next][Index][Thread]
LZ: program question
I'm writing a program that has two main objects--your ship which you can
move, and enemies that are supposed to appear at certain intervals depending
on which board your on. So I set it up like this.
MainLoop:
load number that determines interval from memory into de
GetKeyLoop:
call getkey
compare it with certain keys. if it is one of those keys call the
function that
corresponds to that key (e.g. move up)
decrement de
load 0 into hl
call CP_HL_DE
jr nz,GetKeyLoop
create an enemy
jr MainLoop
Of course, this is stupid. The interval between the enemies being created
varies according to how many keys the user pushes because the functions
invoked by those keys take time. I am having a hard time seeing a solution
to this. PLEASE HELP ME!!!!
Thanx,
EJ
<oo0ej0oo@alpha2.csd.uwm.edu>