Help with scrolling

BlitzPlus Forums/BlitzPlus Programming/Help with scrolling

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

An array is a good way to emmulate the sequence of fruit on the wheels of a slot machine. In this manner, you can easily control the order of fruit as well as the number of times each fruit appears.

However, spinning the wheels is often done in other software by presenting the wheel(s) as a blur of motion. That is, each slot is actually three to five blobs of color that look like the blur of consecutive spots rotating at high speed. You just alternate between several sets of blobs to give the appearance that the wheel is rotating at a high enough speed to cause the images to blur. It can look very realistic, but actually has nothing to do with the fruit arrays. And the fruit arrays do not have to be images themselves, but possibly words, such as "Cherry", or an index into an image array to help you find the right image when you need it. Since you are presenting possibly four or five blurred images alternately, you only need to paint each to a different wheel in the background, and flip to the background at regular intervals to maintain the image. That means the flip has to be done at regular intervals, which you can control with a timer. When a wheel stops, also on fairly regular intervals, you have painted over its image with a selected sequence of fruit on the background. Thereafter you just paint the same image on the background before each flip. Each "wheel" display can be controlled with the same procedure, just a different reference to the location of the wheel being displayed on the machine. You will soon find that it takes very little effort to go from three wheels to five or more.

The fruit arrays are not identical for each wheel. Some wheels have more of one fruit than another, so that overall, some combinations occur regularly, and others only on rare occasions. This determines the odds and the payout.

Note that slot machines that have "blanks" between fruit represent only half the chance of getting a winning combination on a per-wheel basis. If there are three wheels, that would be one-half of one-half of one-half, meaning only 1/8th chance of finding a paying combination that a machine with no blanks would have. For seven wheels, it would be 1/128ths of the same chance. This is why casinos can affort to offer "progressive" pots because they can tease you with a chance at big money while almost everyone just loses their shirts.