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.

Newcomers DBPro Corner / I'm Lost....

Author
Message
Asternus
20
Years of Service
User Offline
Joined: 11th Aug 2004
Location: N.C. U.S.A
Posted: 1st Sep 2004 00:23
Last Week I got mad,This Week I'm Going Crazy.
OK, here's what's goin on.
I made some nice little cubes and made the option at load to have them bounce around all happy and stuff, or just sit there.
..With me so far?
After you choose,then they do their thing(Just like I planed).
Now My Problems. I made 2 pseudo buttons."Exit" and "Move & Stop".
1st
Move/Stop don't work in the same "button".
I can get them to work in seperate buttons though.
2nd
Exit works fine alone,but not when I put in the move/stop code.

I've almost figured it out...almost.
Can someone help me? ?
I've outlined the parts that SUCK.
empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 1st Sep 2004 01:51 Edited at: 1st Sep 2004 01:52
You need to find out if the mouse button has been released between two loops. Else it'll run through the Button-If-Sequence every loop the button is pressed.


Play Nice! Play Basic! Out now.

nFinity Emulator. Coming soon.
Dodo
20
Years of Service
User Offline
Joined: 8th Aug 2004
Location: eating lunch
Posted: 1st Sep 2004 04:10
Heh If you press the stop and move button enough time thyen this code really srews up. heh heh
Asternus
20
Years of Service
User Offline
Joined: 11th Aug 2004
Location: N.C. U.S.A
Posted: 1st Sep 2004 12:13
Thanks for the help Empty.
So "MouseDown" is only declared to check the Click&Move.I put in a lot of unnecessary code


Dodo...after I set a fixed position it'll be straight.lol
Asternus
20
Years of Service
User Offline
Joined: 11th Aug 2004
Location: N.C. U.S.A
Posted: 3rd Sep 2004 16:40
Got it all workin.Now, is there any way to shorten up this code?
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 3rd Sep 2004 22:24
Look at all of your if then statements in the hit sub. They all change their variable to 2 different numbers when true. Example

is the same as

or am I missing something?

Asternus
20
Years of Service
User Offline
Joined: 11th Aug 2004
Location: N.C. U.S.A
Posted: 4th Sep 2004 18:28
Na,ReverseY=1 moves the objects in one direction and ReverseY=0 moves them in another direction.When the objects hit they're sent in the other direction.
If I did
One cube don't really "bounce" off the other.

Login to post a reply

Server time is: 2024-11-27 08:43:11
Your offset time is: 2024-11-27 08:43:11