Slot Machine emulation

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bjb007
Posts: 313
Joined: Fri Dec 28, 2007 4:56 am

Slot Machine emulation

Post by bjb007 » Thu Feb 21, 2008 8:01 am

I want to display a number in a label
and have it move up the way the cylinders
in a slot machine move.

Perhaps using a graphic of the numbers:

1
2
3
4

etc. and moving the graphic.

Any suggestions welcome.
Life is just a bowl of cherries.

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Contact:

Post by malte » Thu Feb 21, 2008 9:36 am

Draw objects, group, scroll groups.

Terms to look up:

group, vScroll, lockLoc

You can use repeat to set the scroll at first. You will gain nicer results using send.

Malte

ystan2010
Posts: 26
Joined: Tue Mar 22, 2011 4:38 am

Re: Slot Machine emulation

Post by ystan2010 » Tue Mar 22, 2011 4:43 am

Hi,

I am struggling to use RunRev to create a Slot Machine Emulation. Does anyone here have any idea how to use RunRev to create a Slot Machine Emulation? If you do, can you please teach me? Or if you have the script code, can you please share with me?

Thanks,
JYST

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Slot Machine emulation

Post by bn » Tue Mar 22, 2011 12:36 pm

Hi ystan,

have a look here
http://forums.runrev.com/phpBB2/viewtop ... ine#p27536
there is a slot machine among the links. It is not a iOS native slotmachine, has some quirks but runs.

Unfortunately I dont get the endless scrolling to work seamlessly with the iOS-native scroller.

Kind regards

Bernd

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10305
Joined: Wed May 06, 2009 2:28 pm

Re: Slot Machine emulation

Post by dunbarx » Tue Mar 22, 2011 2:45 pm

I threw a small gadget together. Try it and see if it does something like what you asked for.

Make a LOCKED field "F7" that is four lines tall. Make a button.

In the button script put:

Code: Select all

on mouseUp
   put "1" & return & "2" & return & "3" & return & "4" & return into fld "F7"
end mouseUp
In the field script put :

Code: Select all

on mouseUp
     put 20 into tScroll
    put 16 into tDelay
   repeat 10
      set the scroll of me to the scroll of me + tScroll
      wait tDelay
      subtract 2 from tScroll
      add 2 to tDelay
   end repeat
  
end mouseUp

on mouseDown
   put the last line of me into temp
   repeat with y = temp + 1 to (temp +40)
      put y mod 10 & return after accum
   end repeat
   put accum into me
end mouseDown
Click on the button, then click on the field as often as you like. You might adjust the delays and number of repeats. This will at least give you an idea how to play around a bit.

Craig Newman

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Slot Machine emulation

Post by bn » Wed Mar 23, 2011 11:06 am

Ystan,

could you give a little more info what your slot machine is supposed to do. I guess you want images for your slot machine. How do you want to operate it, by pressing a button? Is it supposed to be a game? etc.

What Craig posted is a way to do it. Remember that you can display images in a field. look up imageSource in the dictionary.

Kind regards

Bernd

ystan2010
Posts: 26
Joined: Tue Mar 22, 2011 4:38 am

Re: Slot Machine emulation

Post by ystan2010 » Wed Mar 23, 2011 3:11 pm

Hi Bernd,

Thanks a lot for the prompt reply! Appreciate it so much.

Here is what I am looking for a Slot Machine Emulator (Casino).

The Slot Machine Emulator should act like real slot machine emulator that we see in casinos. Yes, it should include different images like you've just mentioned in the last message. Also, it would be great to include effects such as sounds, visual aids, credits, money and points button. I am not sure if that make sense to you. I hope so. If not, please let me know asap.

Thanks,
JYST

ystan2010
Posts: 26
Joined: Tue Mar 22, 2011 4:38 am

Re: Slot Machine emulation

Post by ystan2010 » Thu Mar 24, 2011 3:50 am

Hi Bernd,

I am wondering if you able to find out the way of how to create the slot machine emulator (casino) yet? Appreciate it if you do.

Thanks,
JYST

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Slot Machine emulation

Post by bn » Thu Mar 24, 2011 12:14 pm

Hi Ystan,

I put together a stack with graphics in a group that you can scroll if you click on it and move the mouse up and down while the mouse is down.
I am afraid that is not what you expect.
BUT it contains most of the elements of a casino type slot machine. You would have to get acquainted with the concepts in that stack and adapt it to your needs / develop your own. I strongly recommend working through the tutorials and lessons.
Kind regards

Bernd
Attachments
scroll casino slot machine.livecode.zip
(1.95 KiB) Downloaded 579 times

bill.waldman
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8
Joined: Wed Jul 05, 2006 2:00 pm
Contact:

Re: Slot Machine emulation

Post by bill.waldman » Sun May 29, 2011 4:29 pm

If you download the example, please be aware that the graphic must have re-sized itself....you have to "shrink" its vertical length or there will be nothing to scroll. Decrease the vertical height to only 2 or 3 color squares....and there ya go.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10078
Joined: Fri Feb 19, 2010 10:17 am

Re: Slot Machine emulation

Post by richmond62 » Mon Jul 22, 2024 3:07 pm


Post Reply