VB Dot NET Forum: Slot Machine - VB Dot NET Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Slot Machine Slot Machine Game with 5 Reels

#1 User is offline   DJ Mike Icon

  • Member
  • PipPip
Group:
Members
Posts:
16
Joined:
25-May 10
Gender:
Male
Location:
Croatia,Osijek
Interests:
Programming,Hacking,Multimedia
Graphic and Design

VB Knowledge: Decent
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 25 May 2010 - 10:56 AM

Hello everybody,I'm making A Slot Machine with 5 Reels and 9 lines,but i don't know how to create spinning,how to get picture is spinning,not with blur effect,a real spinning,and how to know what combination is spinning,Here is a sample on picture,i'm using Vb.net 2008!Do i have use DirectX in VB.Net or what!Thank you very much for all,who give me a help!


I'need a help!!,o(
Posted Image
0

#2 User is offline   DeathKindler Icon

  • Moderator
  • PipPipPip
Group:
Mods
Posts:
452
Joined:
09-January 07
Gender:
Male
Location:
PA, USA
Interests:
Music, Web Programming and Design, Desktop Programming, Hacking, Reading, Modding, Basic Electrical Engineering

VB Knowledge: Experienced
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows 7 x64

Posted 25 May 2010 - 11:35 AM

I might have an idea on how to do this. I will get back to you later after I try it out. In involves a .BMP of your reel, a Panel, and inside of said panel the 5 rows. The only issue as to my idea would be seeing what combinations came up.

Game Tag: DeathKindler
Hit me up on Leaf Networks, Xlink Kai, or Xbox Connect.
0

#3 User is offline   DJ Mike Icon

  • Member
  • PipPip
Group:
Members
Posts:
16
Joined:
25-May 10
Gender:
Male
Location:
Croatia,Osijek
Interests:
Programming,Hacking,Multimedia
Graphic and Design

VB Knowledge: Decent
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 25 May 2010 - 11:50 AM

Thanks a lot man i have make a slot with 5 reels and also there are panels, but i use blur effect to simulate spinning,which i edit in photoshop,this is an eye effect!but i want a real spinnning!Also i have a simple sample in vb6 but when i upgrade to vb.net 2008 there are errors,and don't know how to correct the warnings and errors!

This is a sample in VB6

Posted Image



In this project he uses a three bmp images,and each image has a 23 symbols!


Link fot the sample image:

Wheel1
Wheel2
Wheel3
0

#4 User is offline   DJ Mike Icon

  • Member
  • PipPip
Group:
Members
Posts:
16
Joined:
25-May 10
Gender:
Male
Location:
Croatia,Osijek
Interests:
Programming,Hacking,Multimedia
Graphic and Design

VB Knowledge: Decent
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 25 May 2010 - 03:56 PM

I See that most of slot programs uses dxdraw.dll or d3drm.dll - Direct3D Retained Mode dll,and also bass.dll for playing sound.


Hmmm...
0

#5 User is offline   DeathKindler Icon

  • Moderator
  • PipPipPip
Group:
Mods
Posts:
452
Joined:
09-January 07
Gender:
Male
Location:
PA, USA
Interests:
Music, Web Programming and Design, Desktop Programming, Hacking, Reading, Modding, Basic Electrical Engineering

VB Knowledge: Experienced
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows 7 x64

Posted 26 May 2010 - 09:38 PM

Well I did some searching after my idea failed and found this.
Attached is the fixed version if you'd like to use it as an example.
[EDIT]
Turns out attachments are broken.
Download from here.

Game Tag: DeathKindler
Hit me up on Leaf Networks, Xlink Kai, or Xbox Connect.
0

#6 User is offline   DJ Mike Icon

  • Member
  • PipPip
Group:
Members
Posts:
16
Joined:
25-May 10
Gender:
Male
Location:
Croatia,Osijek
Interests:
Programming,Hacking,Multimedia
Graphic and Design

VB Knowledge: Decent
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 27 May 2010 - 02:56 AM

View PostDeathKindler, on 26 May 2010 - 10:38 PM, said:

Well I did some searching after my idea failed and found this.
Attached is the fixed version if you'd like to use it as an example.
[EDIT]
Turns out attachments are broken.
Download from here.



Yes this is simple but not helping me too much,because when he spin the pictures,he has the same two symbols in one roll,but they can be ther!because slot machine must have only a one ymbol of all symbols all ymbols must be differrent in all 5 reels in this case three!Thanks for help
0

#7 User is offline   DJ Mike Icon

  • Member
  • PipPip
Group:
Members
Posts:
16
Joined:
25-May 10
Gender:
Male
Location:
Croatia,Osijek
Interests:
Programming,Hacking,Multimedia
Graphic and Design

VB Knowledge: Decent
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 27 May 2010 - 03:00 AM

How to create random images,the images are 10 and 5 rolls,one roll has 3 picture boxes on panel?!I have done the spinning,but can't done the random iamge and combinations and showing lines coming!
0

#8 User is offline   DeathKindler Icon

  • Moderator
  • PipPipPip
Group:
Mods
Posts:
452
Joined:
09-January 07
Gender:
Male
Location:
PA, USA
Interests:
Music, Web Programming and Design, Desktop Programming, Hacking, Reading, Modding, Basic Electrical Engineering

VB Knowledge: Experienced
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows 7 x64

Posted 27 May 2010 - 11:40 AM

You could modify the spin code very easily to do just what you want, also it wouldn't be too hard to make 5 reels either. I can't help much more on the DirectX side of things as I'm just a basic desktop application and web programmer, sorry.

Game Tag: DeathKindler
Hit me up on Leaf Networks, Xlink Kai, or Xbox Connect.
0

#9 User is offline   DJ Mike Icon

  • Member
  • PipPip
Group:
Members
Posts:
16
Joined:
25-May 10
Gender:
Male
Location:
Croatia,Osijek
Interests:
Programming,Hacking,Multimedia
Graphic and Design

VB Knowledge: Decent
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 27 May 2010 - 01:18 PM

Thanks,can you tell me how to draw line on run-time and create custom shape like rectangle,in gradient color,i must link line,and also i finsihed spinning,and it's good but i need somehow to optimize buffer but don't know how,no flickering stuff,and fine smooth scrooling,in visual basic 6 there are Autoredraw option but vb.net doesn't have that!Thanks for help Man!
0

#10 User is offline   VisualMelon Icon

  • Advanced Member
  • PipPipPip
Group:
Mods
Posts:
269
Joined:
14-April 09
Gender:
Male
Location:
Europe
Interests:
Win32, Web & Linux development, Trains, Language, Cake, Physics and Chemistry

VB Knowledge: Experienced
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 27 May 2010 - 03:32 PM

Hi,

With DirectX, you are following a fairly LONG path to acheive something .NET graphics will handel fine, so I recommend using that.

There are plenty of tutorials out there for basic .NET GDI graphics if you search.

Basiclly, you need the System.Drawing.Graphics object to do this. It is full of methods for rendering geometric objects (lines, ellipses, pies etc.) and images.

The graphics object lets you work outside the bounds of the image, so it should be easy enough to make the program change the Y position of each roll in turn, with a simple if to restart the loop when it ends. Drawing the image twice end to end and starting from the center will ensure that there is never any moment where the background shows through.

Here is a quick example of a simplistic drawing with a couple fo the features mentioned.

Sub drawRoll1()

Dim img As Bitmap = New Bitmap(width, height) ' Initialize Bitmap to draw to '
Dim g As Graphics = Graphics.FromImage(img) ' Initialize graphics object '

spin1 += 1 ' increment spin for Roll 1 '

If (spin > rollEnd) ' if at end of roll, restart!'
spin = 0
End If

g.DrawImage(Image.FromFile("Roll.png"), 0, spin1) ' Draw Image "Roll.png" at point (0, spin1) '
g.DrawImage(Image.FromFile("Roll.png"), 0, spin1 - rollEnd) ' Draw Image "Roll.png" at point (0, spin1 - rollEnd) - this prevents the BG showing, can be optimised '

PictureBox1.Image = img ' set PictureBox1 image as img '

g.Dispose ' destroy g '
img.Dispose ' destroy img '

End Sub


It is usually a good idea to pre-load any images, something not accounted for above.

Again, this isn't a working example, so ensuring that the rolls finish in line and calculating the order they are in isn't handeled, but if you can get a limmit version of this working, I'm happy to help with that when some code has been commited.
0

#11 User is offline   DJ Mike Icon

  • Member
  • PipPip
Group:
Members
Posts:
16
Joined:
25-May 10
Gender:
Male
Location:
Croatia,Osijek
Interests:
Programming,Hacking,Multimedia
Graphic and Design

VB Knowledge: Decent
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 28 May 2010 - 07:21 PM

View PostVisualMelon, on 27 May 2010 - 04:32 PM, said:

Hi,

With DirectX, you are following a fairly LONG path to acheive something .NET graphics will handel fine, so I recommend using that.

There are plenty of tutorials out there for basic .NET GDI graphics if you search.

Basiclly, you need the System.Drawing.Graphics object to do this. It is full of methods for rendering geometric objects (lines, ellipses, pies etc.) and images.

The graphics object lets you work outside the bounds of the image, so it should be easy enough to make the program change the Y position of each roll in turn, with a simple if to restart the loop when it ends. Drawing the image twice end to end and starting from the center will ensure that there is never any moment where the background shows through.

Here is a quick example of a simplistic drawing with a couple fo the features mentioned.

Sub drawRoll1()

Dim img As Bitmap = New Bitmap(width, height) ' Initialize Bitmap to draw to '
Dim g As Graphics = Graphics.FromImage(img) ' Initialize graphics object '

spin1 += 1 ' increment spin for Roll 1 '

If (spin > rollEnd) ' if at end of roll, restart!'
spin = 0
End If

g.DrawImage(Image.FromFile("Roll.png"), 0, spin1) ' Draw Image "Roll.png" at point (0, spin1) '
g.DrawImage(Image.FromFile("Roll.png"), 0, spin1 - rollEnd) ' Draw Image "Roll.png" at point (0, spin1 - rollEnd) - this prevents the BG showing, can be optimised '

PictureBox1.Image = img ' set PictureBox1 image as img '

g.Dispose ' destroy g '
img.Dispose ' destroy img '

End Sub


It is usually a good idea to pre-load any images, something not accounted for above.

Again, this isn't a working example, so ensuring that the rolls finish in line and calculating the order they are in isn't handeled, but if you can get a limmit version of this working, I'm happy to help with that when some code has been commited.






Hey thanks man,i was complete spinning like this i have 5 panels on each panel are 4 pictureboxes,pic1,pic2,pic3,pic4 on first panel,pic1 location are x=0 and y = -110
pic2 is direction down after pic1 and then pic3 after pic2 and pic4 after pic3,and i add timer and change location if eaach of picture location is down to panel wich is not visibleon panel by human eye then it automaticly change location to top x=0 and y = -110 and etc pic2 pic3 pic4!!


Example:

Pic1.Location = New Point(0, -110)

this is what i done the spining,i change location,but on slower computer machine the spinning is slow,because moving controls on panel!!
0

#12 User is offline   DJ Mike Icon

  • Member
  • PipPip
Group:
Members
Posts:
16
Joined:
25-May 10
Gender:
Male
Location:
Croatia,Osijek
Interests:
Programming,Hacking,Multimedia
Graphic and Design

VB Knowledge: Decent
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 28 May 2010 - 08:30 PM

How to draw image using directx ?
0

#13 User is offline   VisualMelon Icon

  • Advanced Member
  • PipPipPip
Group:
Mods
Posts:
269
Joined:
14-April 09
Gender:
Male
Location:
Europe
Interests:
Win32, Web & Linux development, Trains, Language, Cake, Physics and Chemistry

VB Knowledge: Experienced
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 30 May 2010 - 04:35 AM

Hi,

Personlly, I don't know much DirectX, I've made little programs of no use in it, and all the info came from this site: http://www.riemers.net/

The VB.NET section is far from complete, but there is a section about 2D DirectX for C# which I beleive has been ported to VB.
0

#14 User is offline   DJ Mike Icon

  • Member
  • PipPip
Group:
Members
Posts:
16
Joined:
25-May 10
Gender:
Male
Location:
Croatia,Osijek
Interests:
Programming,Hacking,Multimedia
Graphic and Design

VB Knowledge: Decent
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 31 May 2010 - 12:55 PM

View PostVisualMelon, on 30 May 2010 - 05:35 AM, said:

Hi,

Personlly, I don't know much DirectX, I've made little programs of no use in it, and all the info came from this site: http://www.riemers.net/

The VB.NET section is far from complete, but there is a section about 2D DirectX for C# which I beleive has been ported to VB.



Thanks man,i want to use a simple directx image draw to a form!
0

#15 User is offline   DJ Mike Icon

  • Member
  • PipPip
Group:
Members
Posts:
16
Joined:
25-May 10
Gender:
Male
Location:
Croatia,Osijek
Interests:
Programming,Hacking,Multimedia
Graphic and Design

VB Knowledge: Decent
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 04 June 2010 - 07:18 PM

How to draw image DirectX and VB.NET?!!!!!!!!!!!!!
0

#16 User is offline   DJ Mike Icon

  • Member
  • PipPip
Group:
Members
Posts:
16
Joined:
25-May 10
Gender:
Male
Location:
Croatia,Osijek
Interests:
Programming,Hacking,Multimedia
Graphic and Design

VB Knowledge: Decent
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 01 July 2010 - 05:38 PM

View PostVisualMelon, on 27 May 2010 - 04:32 PM, said:

Hi,

With DirectX, you are following a fairly LONG path to acheive something .NET graphics will handel fine, so I recommend using that.

There are plenty of tutorials out there for basic .NET GDI graphics if you search.

Basiclly, you need the System.Drawing.Graphics object to do this. It is full of methods for rendering geometric objects (lines, ellipses, pies etc.) and images.

The graphics object lets you work outside the bounds of the image, so it should be easy enough to make the program change the Y position of each roll in turn, with a simple if to restart the loop when it ends. Drawing the image twice end to end and starting from the center will ensure that there is never any moment where the background shows through.

Here is a quick example of a simplistic drawing with a couple fo the features mentioned.

Sub drawRoll1()

Dim img As Bitmap = New Bitmap(width, height) ' Initialize Bitmap to draw to '
Dim g As Graphics = Graphics.FromImage(img) ' Initialize graphics object '

spin1 += 1 ' increment spin for Roll 1 '

If (spin > rollEnd) Then ' if at end of roll, restart!'
spin = 0
End If

g.DrawImage(Image.FromFile("Roll.png"), 0, spin1) ' Draw Image "Roll.png" at point (0, spin1) '
g.DrawImage(Image.FromFile("Roll.png"), 0, spin1 - rollEnd) ' Draw Image "Roll.png" at point (0, spin1 - rollEnd) - this prevents the BG showing, can be optimised '

PictureBox1.Image = img.Clone() ' set PictureBox1 image as img '

g.Dispose ' destroy g '
img.Dispose ' destroy img '

End Sub


It is usually a good idea to pre-load any images, something not accounted for above.

Again, this isn't a working example, so ensuring that the rolls finish in line and calculating the order they are in isn't handeled, but if you can get a limmit version of this working, I'm happy to help with that when some code has been commited.



What is the spin timer or what and rollend?!Please help
0

#17 User is offline   VisualMelon Icon

  • Advanced Member
  • PipPipPip
Group:
Mods
Posts:
269
Joined:
14-April 09
Gender:
Male
Location:
Europe
Interests:
Win32, Web & Linux development, Trains, Language, Cake, Physics and Chemistry

VB Knowledge: Experienced
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 16 July 2010 - 12:13 PM

Hi,

Rollend is basiclly the hieght of the image, not sure how I forgot to add that into the original code...

spin1 is bascilly how much the image has been shifted down.

If (spin > rollEnd) ' if at end of roll, restart!' 
     spin = 0 
End If 


This snippet checks whether it is the end of the roll (image), and resets the roller location (As such)
0

#18 User is offline   DJ Mike Icon

  • Member
  • PipPip
Group:
Members
Posts:
16
Joined:
25-May 10
Gender:
Male
Location:
Croatia,Osijek
Interests:
Programming,Hacking,Multimedia
Graphic and Design

VB Knowledge: Decent
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 06 August 2010 - 09:52 AM

View PostVisualMelon, on 16 July 2010 - 01:13 PM, said:

Hi,

Rollend is basiclly the hieght of the image, nots ure how I forgot to add that into the original code...

spin1 is bascilly how much the image has been shifted down.

If (spin > rollEnd) ' if at end of roll, restart!' 
     spin = 0 
End If 


This snippet checks whether it is the end of the roll (image), and resets the roller location (As such)



Can you give me some example with 3 reels!I'm trying to do this 5monts,and can do anything,but i need that!thanks!!!
0

#19 User is offline   VisualMelon Icon

  • Advanced Member
  • PipPipPip
Group:
Mods
Posts:
269
Joined:
14-April 09
Gender:
Male
Location:
Europe
Interests:
Win32, Web & Linux development, Trains, Language, Cake, Physics and Chemistry

VB Knowledge: Experienced
VB Version:
VB 2008 (.NET 3.0/3.5)
OS: Windows XP

Posted 07 August 2010 - 07:36 AM

Hi,

Threw this together quickly: Rollers

This isn't a program like what you want, but it has the roller code (and result detection (horrible and hard coded)), and I can help you adapt it if you want.

Also if there is anything you don't understand, post and I'll endever to reply promptly.

Note: press space to start the rollers spinning when it is running

Another Note: My VB.NET is rusty - but I've tested this and it works
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users