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.

Author
Message
Mickyfyn
20
Years of Service
User Offline
Joined: 27th Nov 2003
Location: UK
Posted: 13th Feb 2004 13:23
Hi

Using DB Pro

I am trying to write an opening sequence for my game of breakout.

The title page consists of the background (a texture box that covers the screen) and 8 cubes (make object box) each with a separate letter of the word BREAKOUT.

The idea was to spin the cubes slowly on the screen so that the word breakout breaks up and is then reformed as the letter finish thier cycle. After a short time the letters would dissapear and the game proper would start.

To do this I used the following code after setting up all the variables and boxes etc in a previous function.

waittime = timer()
do
for a = 1 to 8
xrotate object a,object angle x(1)=0.75
if timer() = waittime+ 4000
rem move the cubes off the screen
position object a,0,0,-40
exit
endif
sync
loop

rest of code

The cubes and the background all apppear on the screen and the cubes appear to have rotated just the 0.75. After the four seconds the letters dissapear and the game starts.

I tried the code on its own and the cubes rotate in space as I imagined they would do. Can anyone see what I am doing wrong.

Any help would be appreciated.

Many thanks

Mickyfn
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Feb 2004 14:36
Change this line:

xrotate object a,object angle x(1)=0.75

To this:

xrotate object a,object angle x(1) + 0.75

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
Mickyfyn
20
Years of Service
User Offline
Joined: 27th Nov 2003
Location: UK
Posted: 13th Feb 2004 15:36
Thanks IanM

I made an error on the post, and what you suggested is actually how I have it.

I can't understand why it works in isolation and not when I put it in with rest of the code, is it anything to do with where I place the sync command?

Mickyfyn
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 13th Feb 2004 16:55
Shouldn't that be:

xrotate object a,object angle x(a) + 0.75

you are also missing:

next a

Boo!
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 13th Feb 2004 17:03
if timer() = waittime+ 4000

should be

if timer() > waittime+ 4000

You can easily over shoot waittime + 4000 and be stuck.
--
TAZ

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Feb 2004 19:16
Maybe you should post your current code again

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
Mickyfyn
20
Years of Service
User Offline
Joined: 27th Nov 2003
Location: UK
Posted: 13th Feb 2004 22:14
Thanks to everyone who posted to help me especially Spooky who has cured the problem.

Many thanks again to all.

Mickyfyn

Login to post a reply

Server time is: 2024-09-21 21:14:48
Your offset time is: 2024-09-21 21:14:48