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 / Lottery Game

Author
Message
SueMe2
18
Years of Service
User Offline
Joined: 23rd Dec 2005
Location:
Posted: 31st Dec 2005 23:42
I am writing a program to produce random lottery numbers on balls(which have been drawn with numbers 1 to 49 on each one using Paint Shop Pro and saved as Bitmap png's).I have 3 questions:-
1)I have read in a book called "Beginners Guide to Dark Basic Programming" that you can only have 32 bitmaps.Does this mean I have to use sprites to display my bitmaps?
2)How do I Load all bitmaps(or sprites)?At the moment I have written Load Bitmap(Number)49 times for each individual bitmap.Surely there is a quicker way via a For Next loop?
3)How do I truly randomize each bitmap to be drawn to the screen?
Many thanks in advance to anyone with an answer,or even part of one.
P.S I have uploaded the program,its a Work In Progress

Attachments

Login to view attachments
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 1st Jan 2006 04:40
Quote: "1)I have read in a book called "Beginners Guide to Dark Basic Programming" that you can only have 32 bitmaps.Does this mean I have to use sprites to display my bitmaps?"


Bitmaps are like different screens that we can load up to manipulate graphics. Bitmap 0 is the main screen. Bitmaps 1-32 are the others that can be used without showing anything on the main screen. This gives us the ability to load stuff on another bitmap, change the graphics, then copy the changes to the main screen (bitmap 0) without the user of the program knowing whats going on in the background.

Quote: "2)How do I Load all bitmaps(or sprites)?At the moment I have written Load Bitmap(Number)49 times for each individual bitmap.Surely there is a quicker way via a For Next loop?"


There are two ways you can do it. Put all the pictures on one graphic, load that, and use a for/next loop to grab each image. Or you can just avoid using "load bitmap" altogether and load each individual image directly with "load image".

Quote: "3)How do I truly randomize each bitmap to be drawn to the screen?"


To randomize you want to add "randomize timer()" at the top of your code. Anytime you want a random number you use the "rnd()" command.

Quote: "Many thanks in advance to anyone with an answer,or even part of one. P.S I have uploaded the program,its a Work In Progress"





Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-09-24 11:28:23
Your offset time is: 2024-09-24 11:28:23