Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Problem! ...again...

Author
Message
Squall alias Leon
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: United Kingdom
Posted: 24th Aug 2003 13:38
Ok I'm usless you dont have to tell me

I need help with a problem that keeps cropping up and Its puzzled me like hell, I can't sort it

at the start of a boss fight I have I have 2 people (main characters), then I have 3 enemies. The problem is the start of the fight. After the camera has done its little boogie kinda thing were it looks everywhere in the scene and the positioned itself at the end I've noticed these problems:

1. WHILST the camera is moving the sky doesn't move, characters don't animate, one of the enemies is a robot surrounded by electricity and the electricity doesn't move.

2. AFTER the camera has finished moving around all the above start running as normal

How can I set it up so the what happens in point number 2. happens when the camera is moving?

The cameras movements are made by the 'For' and 'next' commands. All the movements I've put in a GOSUB command. If I run the Gosub before the camera moves, the camera doen't move until the Gosub stuff has finished. little help?
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 24th Aug 2003 13:52 Edited at: 24th Aug 2003 17:05
you need to reorganise your code a bit, run the details and stuff frame by frame instead of one huge lump all at once, kill the for/next loop and keep track with a variable that you increment every time the gosub is called, then call the gosub once per frame during the camera dance, and then call it repeatedly when you go into the game loop, if you have it so the for/next variable controls everything in the animation and its called i for example and you looped up to 20 then do this at the point where the for/to used to be

inc i
if i>20 then i=0

and delete the "next i", then each time you call the loop then i will increase as it used to and control the code, and when it reaches 20 it will loop round and start again, this isn`t guaranteed to work since I havent seen your code, but it should work (theoreticaly), just call your modified subroutine at every sync during the camera sequence and the animations and whatever will step through the loop, when you reach the end of the camera swoop and the game starts then just keep calling the gosub to run the animations/other, hope thats some help, cheers.

Mentor.
Squall alias Leon
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: United Kingdom
Posted: 25th Aug 2003 13:07
Thanks alot. worked a treat Many thanks

Login to post a reply

Server time is: 2025-05-20 07:46:00
Your offset time is: 2025-05-20 07:46:00