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 / another Point Object question

Author
Message
eek
21
Years of Service
User Offline
Joined: 26th Dec 2004
Location:
Posted: 6th Jul 2006 10:27
First off, sorry, I know similar topics have been posted but I couldn't get what I needed out of the posts I found.

I am making a plain and pointing trying to point it at the camera. It has a plant image on it. I am making the classic 2d plant that rotates based on the camera. The problem is I can't get it to rotate. Sorry about the redundance of the post again, and thanks for any help.

source and media attached
source:

Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 6th Jul 2006 14:01 Edited at: 6th Jul 2006 14:01

This line has to be written IN your game loop. (between do and loop).

If you do it before the loop, the action will only be done once: when it starts.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
eek
21
Years of Service
User Offline
Joined: 26th Dec 2004
Location:
Posted: 6th Jul 2006 23:13
I think I have tried that before, here is the modified code:



The problem is once I do that it says that the object doesn't exist. I don't know why it would cause that problem, because the x object should exist. Any ideas?
Zotoaster
21
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 7th Jul 2006 01:41
You need to put it in another for/next loop. Notice that x is only between "For x=1 to 100" and "Next x", well where you have it now is not between these two lines.

eek
21
Years of Service
User Offline
Joined: 26th Dec 2004
Location:
Posted: 7th Jul 2006 03:21 Edited at: 7th Jul 2006 03:22
Well thanks - I get no error now!

BUT!

The plants still do not point at the camera...

Updated Code:



I don't know if it has something to do with the control of the camera or what. Hmmm. And if you want the media is at the top with the old source code, if you want to actually run it. Remember though, it's the old code.
Zotoaster
21
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 7th Jul 2006 12:22
Hmm, you're not using 'Point Object' in the main loop. Try that, or, Set the Y angle of the objects as Wrapvalue(CameraAngleY#+180) (within the For/Next loop), that would be best in my opinion.

Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 7th Jul 2006 14:27
Quote: "Set the Y angle of the objects as Wrapvalue(CameraAngleY#+180)"


Sorry but I doubt that'll work. If the plant is standing left from you, then that would mean the plant is pointing to the opposite way of your rotation.

I meant this:

In your game loop



It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Zotoaster
21
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 7th Jul 2006 15:52
Yeah that works too lol.

eek
21
Years of Service
User Offline
Joined: 26th Dec 2004
Location:
Posted: 10th Jul 2006 00:56
Aha it works! Thanks Sven and Zotoaster for the help very much.

Login to post a reply

Server time is: 2026-07-07 06:02:21
Your offset time is: 2026-07-07 06:02:21