Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How can you have real time?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
hello




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
JayLo




PostPosted: Thu Apr 24, 2003 4:30 pm   Post subject: (No subject)

processes
Blade




PostPosted: Thu Apr 24, 2003 5:39 pm   Post subject: (No subject)

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




PostPosted: Thu Apr 24, 2003 6:10 pm   Post subject: (No 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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Blade




PostPosted: Thu Apr 24, 2003 6:25 pm   Post subject: (No subject)

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




PostPosted: Sat Apr 26, 2003 2:13 pm   Post subject: (No 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
Tony




PostPosted: Sat Apr 26, 2003 2:34 pm   Post subject: (No 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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: