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 / Some graph code in DBC. Looks o.k.?

Author
Message
Los
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Location:
Posted: 9th Jan 2005 00:16
ok, I cooked this up in about half an hour. I was hoping that some amatuer to experienced coders could take a gander over it and see if I'm going in the right driection.



Some things I'm asking are,

My naming conventions

Code structure? (place of dim functions and gosub routines
My KEYS or MOUSE repeat checker and any ways an 'abnormal event' could ever happen
How I could get the s$="." to move slower (I tried the for loop, but the exit command caused some trouble).

I suppose that is all I can throw at you for the time being. I can understand if anyone mentions some bad things about the goto start label, or "remove the waits, you don't need them".. but I'm getting alittle interested in older machines which need to take time to calculate stuff.

Good practice or is it not BIG ENOUGH YET?! as it is!! I know I can get confused with only 100 lines of code.

Thank you. Danke. Merci.
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 9th Jan 2005 06:45
Naming variables and arrays with just one or two letters isn't generally considered very good. It may be easier to type but try going back to a project after 6months of not working on it and remembering what the arrays, with single letters to identify them, hold would be a nightmare.

The gosubs can probably be made into function, which personally, i think look nicer.

The waits aren't really necessary.

Try not to put stuff all on the : same : line : like : this
Especially for-next loops, that helps readability alot.

Also, its personal preference, but i like to use capital letters throughout my code:
Make Object Cube 1,50
ThisIsAVariable = 54

Also for things like global variables, some people like to identify them:
Global G_Variable = 50
Local L_Variable = 1
Global G_EnemyLife_F as Float

Stuff like that. It only really depends on what you like, its only when you start working on team projects where everyone needs to be able to understand any code that is written that it gets hard.


http://www.dbspot.com/NYC
New years competition... Fo Shizzle.
Major Payn
20
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 9th Jan 2005 13:34
Yeah lol, I remember doing that to, naming variables stupid simply stuff like t, or a, I never even knew you could give variables any name you could untill my recent project, once I learned that, I named objects after what they really are, like my earth model is named earth, and my spaceship model is actually named spacefighter, so it is so much easier to code when you have stuff like this...

If object collision (spaceship,planet)>0

Guns arn't the problem, people are the problem, shoot all the people and guns arn't a problem anymore.
Los
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Location:
Posted: 10th Jan 2005 00:28
ok that sounds fair. You need to ignore the pointf() function stuff becuase those comments don't make sence.
Los
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Location:
Posted: 10th Jan 2005 23:56
My next creation.. the railgun!



I'm pretty happy with this code as I've strengthend it.. and also figured out the SIN and COS commands! Nicely done. Cheers.

Login to post a reply

Server time is: 2024-09-23 08:34:18
Your offset time is: 2024-09-23 08:34:18