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 / Movement function not working?

Author
Message
Indie Rock 13
20
Years of Service
User Offline
Joined: 1st Sep 2004
Location:
Posted: 2nd Nov 2004 03:43 Edited at: 2nd Nov 2004 03:47
I've been getting along fine and learning the program, but I have come across one hitch. In my source code for moving an object across the screen with inertia and colliding with another box I decided to make the different parts into functions. The sliding collision code worked fine in a function, but I can't get the movement to work unless I call it keyctrl: and use gosub to call it. While this isn't a real problem, it does kind of clutter the code and I've heard that functions were better/faster to use. So really I was just wondering why this



only continues to rotate the box, but won't move it along the X axis...

Here's all of the code



Thanks!

Neeeeeeeewom!
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 2nd Nov 2004 05:25
Your variables speedr# etc won't be recognised by your function.
Eiter make your variables global or pass their values to the function and have the function return the new values.


The word "Gullible" cannot be found in any English Dictionary.
Indie Rock 13
20
Years of Service
User Offline
Joined: 1st Sep 2004
Location:
Posted: 2nd Nov 2004 07:56 Edited at: 2nd Nov 2004 08:04
Hmm... how would I make it global? I tried putting dim speedr#(0) etc above my game loop initially but that didn't work either.

Neeeeeeeewom!
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 2nd Nov 2004 08:47 Edited at: 2nd Nov 2004 08:48
Global speedr#
Global speedl#

at start of code


The word "Gullible" cannot be found in any English Dictionary.

Login to post a reply

Server time is: 2024-09-23 04:17:13
Your offset time is: 2024-09-23 04:17:13