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 / physics question

Author
Message
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 5th Feb 2006 12:15 Edited at: 5th Feb 2006 17:55
hi

how do you make an 2d object go up and then drop back down again like what would happen when yuo throw a ball up.
But then how do you make the speed of the object gets faster but the height it reaches stays the same.
I know how to do the first bit but I dont know how to do the second.

sorry about the grammar it is too early for me.

BM

Our aim is to keep the loo's clean, your aim can help.
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 5th Feb 2006 17:54
hello

Our aim is to keep the loo's clean, your aim can help.
Yskonyn
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: Netherlands
Posted: 5th Feb 2006 18:01
Maybe if you'd wait with posting on the forum until you're fully awake people would actually be able to make sense out of what you're trying to say here...

Yskonyn -
"It's better to wish down here you were up, then to wish up there you were down."
"The ONLY time you have too much fuel on board is when you are on fire."
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 5th Feb 2006 18:22
sorry

what I am trying to do is get a 2d object go up and then come back donw under teh force of gravity. (Ok i can do this bit)
but I dont know how to have the speed in which the object travels up at increase whilst keeping the height in which the ball reaches stay the same.

BM

Our aim is to keep the loo's clean, your aim can help.
Yskonyn
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: Netherlands
Posted: 5th Feb 2006 18:46
Still I don't get it, mate.
You want the object that goes up into the air accelerate while it's going up? Or do you want the object to go up quicker than it does now?

Yskonyn -
"It's better to wish down here you were up, then to wish up there you were down."
"The ONLY time you have too much fuel on board is when you are on fire."
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 5th Feb 2006 23:04
I want to have the object going up but once it has come back down I want it to go back up but at a faster speed.

Our aim is to keep the loo's clean, your aim can help.
Don Malone
21
Years of Service
User Offline
Joined: 27th Apr 2003
Location: Birmingham, Alabama
Posted: 6th Feb 2006 04:18
The bounce with each new bounce being faster than the previous, but each bounce being the same height.

That is an unusual request for a bounce.

In Memory of My Dad.
I miss you very much.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th Feb 2006 05:09
If you want the ball to bounce back up off the ground at a faster speed, then make the coefficient greater than 1. Though, with that the ball will never come to rest without some another force to stop it.




Deadly Night Assassins
Yskonyn
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: Netherlands
Posted: 6th Feb 2006 12:27
That's plain illogical, mate
How can something bounce a) off the ground and increasing speed and b) IF the first WAS possible, how can it actually keep the same height from the ground?? o_O

Yskonyn -
"It's better to wish down here you were up, then to wish up there you were down."
"The ONLY time you have too much fuel on board is when you are on fire."
Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 6th Feb 2006 17:57
its not actually a ball bouncing it is meant to be a challenging game where the object goes up and you have to click it before it goes back down again with each click you get right the rate in which the object moves gets faster and more challenging

Our aim is to keep the loo's clean, your aim can help.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 6th Feb 2006 19:28 Edited at: 6th Feb 2006 19:35
The request is really odd and confusing, but nonetheless, possible.

The problem, however, is as the speed increases eventually the ball will have to either stop at a max speed or pass the height limit, eg:

Lets say the ball starts at a speed of 1 unit per bounce, and you set the height to be a maximum of 10 units.

After 5 bounces the ball is going at 5 units per bounce. All good right, but once it reaches 11 units per bounce it will bounce, you guessed it, 11 units in the air. 1 unit higher than the max, so as I said, you'll have to either set a max bounce speed, or maybe tell the user its game over when they get to the maximum height. ANYHOO.

Onto the pseudo-ness. Im going to use a 3d object in my explanation since I absolutely am t3h suxx0rz at anything and everything 2d. So, here's a basic beginning layout;



Right so we have a ball. Now lets begin by just moving it up and down at a constant rate with a maximum height;



Ok test that, then go get a caffienated beverage, when you've returned... Now we have a ball bouncing up and down at a constant rate, its time for the hard skat; we need to figure out if the ball has bounced, how do we do that? Well we check if it hit the ground, we already did that in the previous code checking if it's y was equal to or bellow 0. That'll do. So we just need to mod it a bit. First the code, then an explanation;



Alright, so now the ball is bouncing at an increasing rate every time it hits the ground. Change the Rate# variable to be the speed it increases by, change the MaxHeight# variable to make its limits higher or lower. Basically when the ball hits the ground/bounces/is equal to or below 0, we change the Speed# variable to be Speed#+Rate#, we also use the Abs command to make the Speed# variable positive so it can move up again. When it reaches its limits/MaxHeight#/>=50, we just make Speed# negative so it moves down again.

Should work, I dont have Darkbasic right now as Im at school but Ill check back when I get home if Im not buisy to fix any errors I might've made.

Wow, just did a tutorial during period 3 class

Goodluck, RUC'

Yskonyn
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: Netherlands
Posted: 8th Feb 2006 00:46
Sounds coo, though. When you put it in the frame of a 'challenge game' it gets a bit more understandable.
Good explanation by RUCCUS I'd say.
It would be serious fun to test your game, mate. It's plain illogical so I am very curious how its going to turn out to be!

*thumbs up*

Yskonyn -
"It's better to wish down here you were up, then to wish up there you were down."
"The ONLY time you have too much fuel on board is when you are on fire."
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 8th Feb 2006 02:39 Edited at: 8th Feb 2006 02:41
I just tested out the final code I supplied and it was insanely fast so here's a modified version, looks a lot smoother as I reduced the Rate# variabel to .001, and also added a text command to display the current speed;


Goodluck,
- RUC'

Big Man
19
Years of Service
User Offline
Joined: 4th Feb 2005
Location: BEHIND YOU!!!! (but I live in England)
Posted: 9th Feb 2006 21:05
sorry ruccus I have changed it to go from side to side but I will/have used some of the principles you have shown. Thanks mate.
As far as showing it to you that might have to wait until the tytt compo is over because I will be franticly trying to get my entry in before the end of febuary. But after then yeah sure you might be able to play it.

BM

Our aim is to keep the loo's clean, your aim can help.

Login to post a reply

Server time is: 2024-09-24 15:37:24
Your offset time is: 2024-09-24 15:37:24