Zufallstextur

Previous topic - Next topic

WPShadow

Hi!

Noch eine Zufallsfrage:

Code (glbasic) Select
textur1 = 1
textur2 = 2
textur3 = 3

LOADSPRITE "bla.bla", textur1

...

SETTEXTURE textur+RND(2)+1, -1
Ich stelle es gleich ins Forum um zu fragen, ob das hier so funktionieren kann bzw. um zu fragen, was ich verbessern könnte...

GLG

W.
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 10.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://lostrevenant.blogspot.com
alea iacta est

Kitty Hello

Code (glbasic) Select
num = RND(textur3 - textur1) + textur1
X_SETTEXTURE num, -1
jetzt kannst Du einen von - bis Bereich angeben z.B:
Code (glbasic) Select
FUNCTION GetRndTexture: from, upto
   RETURN RND(upto-from)+from
ENDFUNCTION

WPShadow

Hat super funktioniert!!! Danke!!!!!
AMD X2 4600, 2 GB Ram, ATI X1950 XTX, XP PRO SP2: GLB Premium 10.beta_dingsi, <(´.´<) Kirby Dance (>`.`)>
http://lostrevenant.blogspot.com
alea iacta est