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 / Enemy Acceleration (DBP)

Author
Message
Xender
18
Years of Service
User Offline
Joined: 28th Apr 2006
Location:
Posted: 6th Jun 2006 18:46
Hey, I just put enemies in my game, using the curved basic AI tutorial: http://www.curvedbasic.com/Forum2/viewtopic.php?t=103
which is very good and helps explain a lot about many aspects of dark basic, but i just was wondering if it is possible to do a certain thing. the code i put in my game is
before the do loop, and in the do loop a function called gosub Enemies is called which is :

i was wondering if, like i have with the guy the user controls, if it is possible to have acceleration, i tried it but it would be very buggy and you would have to keep him chasing u int he same direction, because if you turned it would just go back to 0 then back up again, so i was wondering if using that code or just an example, of being able to have the enemy slowly get faster and faster until a certian speed, and then go back down, thanks so much.
Xender
18
Years of Service
User Offline
Joined: 28th Apr 2006
Location:
Posted: 8th Jun 2006 03:52
so this would make it so instead of the enemy chasing you immideatly at the speed of 3, it would slowly move up to that speed.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 8th Jun 2006 18:53
take a look at the curvevalue command. pretty simple way to achieve the acceleration (and braking) effect you're looking for. try using a "speed value" of around 100; tweak as desired.

Virtual Nomad
Athlon XP1800+, Windows XP+SP2, Soyo K7V Dragon+ MB, 1.5Gb 333 RAM, ATI Radeon 8700LT (128Mb)

Login to post a reply

Server time is: 2024-11-26 18:50:16
Your offset time is: 2024-11-26 18:50:16