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 / randomizing textures

Author
Message
New Creature Feature
21
Years of Service
User Offline
Joined: 27th May 2004
Location: Tennessee- USA
Posted: 20th Jun 2004 05:20
If I have 30 objects I wish to randomly texture with 6 different textures how would I do that?

I started out simple, with 2 textures, just to see if I could do it. I created the objects and loaded the textures but I could only get the second texture to show and the other objects had no texture at all.

On top of that I want to put the randomize texture commands in the main loop cuz the objects dissapear and reappear in a different place (I have the disappearing/reappearing part worked out). This will be so every time the objects reappear they will have a different texture than the previous time you saw it (barring a random repeat).

Thanks

Alan

Therefore if any man be in Christ, he is a new creature: old things are passed away; behold, all things are become new. II Corinthians 5:17
FROGGIE!
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location: in front of my computer
Posted: 20th Jun 2004 13:39
Try this

FOR a = 1 TO 30
TEXTURE OBJECT a,1+RND(5)
NEXT a

providing that the textures are numbered 1 to 6
if they are 3,4,5,6,7,8

then you want

FOR a = 1 TO 30
TEXTURE OBJECT a,3+RND(5)
NEXT a

just change as needed.

I should have changed my signature when asked
New Creature Feature
21
Years of Service
User Offline
Joined: 27th May 2004
Location: Tennessee- USA
Posted: 20th Jun 2004 22:00
Thanks Froggie
that did the job!

Alan

Therefore if any man be in Christ, he is a new creature: old things are passed away; behold, all things are become new. II Corinthians 5:17

Login to post a reply

Server time is: 2025-05-28 20:59:53
Your offset time is: 2025-05-28 20:59:53