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 / accelerate

Author
Message
castek
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location: Right behind you!
Posted: 18th Jun 2008 20:02 Edited at: 18th Jun 2008 20:03
Hey, i just got DBPRO yesterday and have been playing around with it alot. so i decided that i wanted to make a racing game. i started making the script and reading lots of tutorials this is what i got,



now the basic idea is the car can be driven with the arrow keys and the camera will follow, i got that working but then i wanted to add acceleration so i added that but now it doesn't work, when ever i try to go any where it go really fast straight ahead. please help!

"The Beginning is the end."
Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 19th Jun 2008 05:20
@castek

Try doing a forum search for "car movement", you may find some ideas.


Whatever...
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 19th Jun 2008 05:33
Try my tutorial: http://forum.thegamecreators.com/?m=forum_view&t=68873&b=7

Don't you just hate that Zotoaster guy?
castek
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location: Right behind you!
Posted: 19th Jun 2008 06:48 Edited at: 19th Jun 2008 07:00
Quote: "Try doing a forum search for "car movement""


yes, i have many times thats how i found out how to use acceleration. but when i try to add any car script it bugs out.

@Zotoaster Your tutorial was cool, but is there a way to make the camera more responsive when you turn?

"The Beginning is the end."
Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 20th Jun 2008 04:31 Edited at: 20th Jun 2008 04:52
Another thought castek, on my computer this thing runs way to fast. Slow it down.

Maybe, it's just a thought.

I touched up your code just a bit to see what was going on:



I hope this helps.


Whatever...
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 20th Jun 2008 05:14
Quote: "is there a way to make the camera more responsive when you turn?"


Sure. On line 140 change the last parameter to something smaller than 20. Start with 10 and see how that goes.

Don't you just hate that Zotoaster guy?
castek
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location: Right behind you!
Posted: 20th Jun 2008 17:47 Edited at: 20th Jun 2008 17:48
@Zotoaster Thanks! also though your car doesn't have acceleration could you show me how to add acceleration if it's not to hard?

@Dabbler Hi Dabbler, your edited code makes it really really really slow, not it would be fine if acceleration worked but it's not, could you please help me? also the camera didn't really follow it too well

"The Beginning is the end."
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 20th Jun 2008 19:42
castek,

Try actually reading the tutorial More mass = slower acceleration = more noticable.

I put it to 1000, and it's pretty noticable.

Line 45 btw.

Don't you just hate that Zotoaster guy?
castek
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location: Right behind you!
Posted: 20th Jun 2008 21:30 Edited at: 20th Jun 2008 21:34
i did read the tutorial and i did change it but all i noticed was a change in turning. I'll try again. thanks.


EDIT:
OK i just tested it and it works but it also makes turning really slow do i need to change another variable to fix that?

"The Beginning is the end."
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 20th Jun 2008 23:19
Castek, here's an extract from the tutorial:






"<irrelevant text>...
Also, notice that when you press the left or right keys, the angular force is the speed devided 5. As you may know, if you are in your car and you're not moving, then you cannot turn, so if your speed (which we will calculate later) is 0, then you will not have any angular force. If 0 is devided by anything, then it will end up as 0, which means you will not turn. Also, the more you devide it by, the less you will turn."

Don't you just hate that Zotoaster guy?
castek
17
Years of Service
User Offline
Joined: 15th Aug 2007
Location: Right behind you!
Posted: 21st Jun 2008 02:56
OK thanks, when i read your tutorial i mainly just skipped over it because i was in a rush but now i have read it fully! it helped alot in understanding basic physics

"The Beginning is the end."

Login to post a reply

Server time is: 2024-11-25 02:09:21
Your offset time is: 2024-11-25 02:09:21