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 Professional Discussion / A quick programming tip :)

Author
Message
Kangaroo2
22
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 9th Feb 2003 00:50
Ok Obvious point if you've thought of it, NOT an obvious point if you haven't, so no1 complain! lol

I was talking to a NooB (won't name names ) on Yahoo Messanger and they said they found it awkward to remember what numbers they had assigned to each object. He said it would be better if you could assign them a string. Whilst there are more complex ways to do this, a simple way round is:

load object "player1.x",1: player1=1
load object "player2.x",2: player2=2

etc. so instead of typing
"move object 1,10"

You can type
"move object player1,10"

I know it can slow things down if you have thousands of variables, but for simple programs this is a good way not to forget stuff. Failing that write it down or keep a list in Notepad lmao
Coming Soon! Kangaroo2 Studio... wait and quiver with anticipation! lol
[email protected] - http://www.kangaroo2.com - If the apocalypse comes, email me
Kangaroo2
22
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 9th Feb 2003 00:54
Obviously you could also use it for things like:

If object collision (car, tree)=1 then gosub hugemessyexplosion

lol

Coming Soon! Kangaroo2 Studio... wait and quiver with anticipation! lol
[email protected] - http://www.kangaroo2.com - If the apocalypse comes, email me
Kangaroo2
22
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 9th Feb 2003 00:57
If object collision (car, tree)=1 and carmph>150 then gosub instantdeathbutprettyfireworksandlostnoclaimsbonus

Coming Soon! Kangaroo2 Studio... wait and quiver with anticipation! lol
[email protected] - http://www.kangaroo2.com - If the apocalypse comes, email me
Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 9th Feb 2003 01:31
instantDeathButPrettyFireWorksAndLostNoClaimsBonus

Also use camel... it makes your life easier...

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 9th Feb 2003 03:02
Player(1).NUM is a typed reference to the same method with media object number control handling.

Puffy
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United States
Posted: 9th Feb 2003 03:39
^_^ right indi...

AMD Athlon XP 2100+ OC to 3Ghz/1.5gigs ram/128mb ti4200/120gigs hd/19" monitor/Sound Blaster Audigy Platinum EX/3072kbs Sat Con... I joined in!
Archon
22
Years of Service
User Offline
Joined: 4th Feb 2003
Location: Finland
Posted: 9th Feb 2003 10:15
LOL.. n00bs tshe tshe, here is good tip for you

"death is my meat; terror is my wine"
-Asdrubael vect of the Black heart

Login to post a reply

Server time is: 2025-05-20 01:57:58
Your offset time is: 2025-05-20 01:57:58