Computer Science Canada

How can you have real time?

Author:  hello [ Thu Apr 24, 2003 4:05 pm ]
Post subject:  How can you have real time?

Smile Sad Smile Sad Sad Sad
how do u have multiple procs working at the same time
we are making a space shooter
we need real time ship movement
while we are shooting and moving
we created a movement pattern and shooting
but unable to do at same time

Author:  JayLo [ Thu Apr 24, 2003 4:30 pm ]
Post subject: 

processes

Author:  Blade [ Thu Apr 24, 2003 5:39 pm ]
Post subject: 

or do it in one big loop, and use View.Update at the end

Author:  Tony [ Thu Apr 24, 2003 6:10 pm ]
Post subject: 

no processes. Thats bad... use processes only for background music.

Just put all your procedures into the same loop and use hasch to bypass getch if no key is pressed. Better yet Keybaord.KeyDown (i think) in v4.x compiler.

and just use View.Update will speed graphics up so it doesnt look like something is out of place

Author:  Blade [ Thu Apr 24, 2003 6:25 pm ]
Post subject: 

pretty much what i explained... but i assumed he was already using hasch or Input.Keydown

Author:  hello [ Sat Apr 26, 2003 2:13 pm ]
Post subject: 

yeah i'm using input.keydown for movement

the main problem is that my ship can't move when it fires
basically one has to wait until the projectile clears the screen before it can move again
i've thought and thought of how to re-arrange the structure but it's stumped me

if i can solve this then firing multiple projectiles shouldn't be a problem ....... hopefully

Author:  Tony [ Sat Apr 26, 2003 2:34 pm ]
Post subject: 

well your program's structure has to be like this:

loop
move ship

if missiles on screen

for i:1..maxmissile
move missile(i)
end for

end if

move enemies

calculate w/e else you need

%at this point everything have moved 1 step according at its individual speed

View.Update

end loop


: