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 / Randomize copy bitmap

Author
Message
trouper
19
Years of Service
User Offline
Joined: 15th Jul 2005
Location: Texas
Posted: 2nd Jan 2006 19:06
How can i randomize these:

copy bitmap 1,0
copy bitmap 2,0
copy bitmap 3,0
copy bitmap 4,0
copy bitmap 5,0

trillianmikey
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 2nd Jan 2006 20:36



Join Our Forums and get game updates faster!
trouper
19
Years of Service
User Offline
Joined: 15th Jul 2005
Location: Texas
Posted: 2nd Jan 2006 22:16
It doesn't work for some reason. It says bitmap numbers must be different. Maybe because the way it's coded.

load bitmap "image.bmp",1
load bitmap "image2.bmp",2
load bitmap "image3.bmp",3
load bitmap "image4.bmp",4
load bitmap "image5.bmp",5
do

Randomize Timer()
x = RND(5)
copy bitmap x,0

sync
cls

loop

trillianmikey
trouper
19
Years of Service
User Offline
Joined: 15th Jul 2005
Location: Texas
Posted: 2nd Jan 2006 22:23
Nevermind i figured it out, thanks a bunch.

Randomize Timer()
x = RND(5)
load bitmap "image.bmp",1
load bitmap "image2.bmp",2
load bitmap "image3.bmp",3
load bitmap "image4.bmp",4
load bitmap "image5.bmp",5
do
copy bitmap x,0
sync
cls
loop

trillianmikey
trouper
19
Years of Service
User Offline
Joined: 15th Jul 2005
Location: Texas
Posted: 2nd Jan 2006 22:43
Actually I do have a problem now. The random thing works perfect but when i restart my game after a few times it will come up and say bitmap numbers must be different. Also it would be cool if i could keep the randomization from repeating the same image over again.

trillianmikey
crighton
19
Years of Service
User Offline
Joined: 5th Nov 2005
Location: In your soup.
Posted: 3rd Jan 2006 15:30 Edited at: 3rd Jan 2006 15:33
your using rnd(5), this is actually 6
0 to 5=6
try rnd(4)+1






****edit****
to make it really random try a random routine, something like


aye!
trouper
19
Years of Service
User Offline
Joined: 15th Jul 2005
Location: Texas
Posted: 3rd Jan 2006 16:15
Thanks works perfectly now!

trillianmikey

Login to post a reply

Server time is: 2024-11-27 07:36:22
Your offset time is: 2024-11-27 07:36:22