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 / Small problem with my code

Author
Message
Soroki
19
Years of Service
User Offline
Joined: 26th Jan 2006
Location: United States
Posted: 10th Dec 2007 19:09
I've been away from coding in DBC for A LONG TIME. I am a senior in high school this year so I havn't had much time. I've decided to try and balance my life out and return to coding. I got a code a while back from Sixty Squares to help me understand camera coding and controlling small ball. My game is based around such a thing. I completely understand the code. Now I need the ball to look as though it is rolling when there is a texture applied to (scrolling the texture) I have coded that in. The texture successfully scrolls when the ball is moving, but when I let go of the key, it immediatly stops rolling, rather than coming to a gradual halt as I want it to.

Maybe I'm just stupid, or I've forgotten A LOT of things, but I have tried many solutions and cant' fix it. I want the texture to stop scrolling gradually, not all at once. I'll attach the code to this post, I'm at school so I can't open it and just put it in the code snippet box. Textures are there too.
My problem is better explained in the code(comments!)


Thanks


Soroki

If you whine about graphics, you are not a true gamer, you are just an imposter to a title you can't understand.

Attachments

Login to view attachments
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Dec 2007 19:35
I can't check your code at the moment, but I'd be surprised if it used texture scrolling.

I did the same thing for someone a while back and just the ball object rolled - the texture just 'went with it'.

I'll see if I can find it for you.

So, it should just be a case of making the ball roll gradually to a halt and nothing to do with the texture itself.

TDK_Man

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Dec 2007 20:14 Edited at: 10th Dec 2007 20:15
OK, found it!

I've just modified it to accellerate and decellerate so it slowly rolls to a halt. Files attached (7K).

Use the cursor up, left and right keys.

TDK_Man

Attachments

Login to view attachments
Soroki
19
Years of Service
User Offline
Joined: 26th Jan 2006
Location: United States
Posted: 10th Dec 2007 20:43
Thanks TDK. For some reason the texture on mine doesn't go with it. I will have to try your code later today. Thanks, you're a big help with coding!

If you whine about graphics, you are not a true gamer, you are just an imposter to a title you can't understand.

Login to post a reply

Server time is: 2025-06-02 10:00:57
Your offset time is: 2025-06-02 10:00:57