How to animate a slot machine reel?

I have originally tried animating a slot machine reel by moving it's Y coordinates but have recently thought of animating it instead by keeping the actor in the same position and somehow shifting the contents of the image and using the wrap Y if it is possible.

What I have is an image that is a vertical strip of images say 75 pixels x 750 pixels. Would I be able to take this strip and repeatedly shift the image vertically at high speeds and have the image loop so that when a symbol reaches the bottom of the strip, it'll appear at the top again?

Best Answers

  • SocksSocks London, UK.Posts: 12,822
    Accepted Answer

    @CometPlus said:
    . . . I'm hoping there is a method to keep the image locked in place while being able to shift the tiles with wrapping within the confines of the image border.

    Can't be done unfortunately.

  • SocksSocks London, UK.Posts: 12,822
    edited October 2014 Accepted Answer

    @CometPlus said:
    I'm more interested in creating a true reel spin.

    You can create a true spin by controlling the actors Y position and height (and width if you want a little perspective), by constraining them to a sine wave (the Y position offset from the height by 90°), if you then clip the lower half of the sine wave controlling the height the individual reel positions will disappear as they rotates away from you (as they should), and as you are controlling the movement by a sine wave you can control the angle the sine wave is operating on and therefore control the speed to allow the reels to ramp up to speed and slow down.

    Hope than makes sense, not sure I've explained it very well, basically you can rotate an actor in a plane perpendicular to the screen at a controllable speed.

  • SocksSocks London, UK.Posts: 12,822
    edited October 2014 Accepted Answer

    @CometPlus said:
    I'm more interested in creating a true reel spin.

    Here's a movie of the basic idea for the sine wave driven 'true' spin . . . (I hope @Armelline doesn't mind that I stole his Fruit Machine images for the demo !!)

    Link: https://www.mediafire.com/?hyqif6m4pt8hizd

Answers

  • mc99093mc99093 Member, PRO Posts: 133

    Here is a template for a slot machine. Maybe you can use this to solve your problem.

    http://marketplace.gamesalad.com/#query=EatingMyHat&product=2479

  • Thunder_ChildThunder_Child Member Posts: 2,343
    edited October 2014

    @CometPlus‌



    Blur you images and animate them...for say 3-4 seconds and then choose which symbol lands. It gives a good illusion of spinning reels.

  • ArmellineArmelline Member, PRO Posts: 5,332

    Attached is a free slot machine template I made that I never quite got around to removing a bug from, so never released (at least I don't think I did). But it'll give you an idea of how to solve your particular problem. Just don't try it completely as the button can bug out :D

  • CometPlusCometPlus Member Posts: 3

    While I like the suggestions as I may default to using the blurring method as indicated by @Thunder_Child‌ and @Armelline‌ if I cannot find the exact preferred method of doing this. I wasn't able to fully review the suggestion from @mc99093‌ regarding @EatingMyHat‌ template as I was not able to find a video sample of how the the spins look like in the template.

    I'm more interested in creating a true reel spin. What I'm planning is building a 3X5 slot with a professional spinning look to it where the player can see the reels speed up at the start of the spin and slow down and lock in near the end of the spin so being able to see the actual symbols during the spin is necessary unless this is not possible. (I'd like to get it to look as much as a real casino slot machine as possible if it can be done.)

    Also, in my original method of programming this where I actually just transpose the vertical strip by shifting the entire image along it's Y coordinate, the image started flying all over the place and off the screen when it spun enough times even though there should have been no movement programmed in the X axis. This is why I'm hoping there is a method to keep the image locked in place while being able to shift the tiles with wrapping within the confines of the image border.

    I do appreciate the suggestions so far however. Thanks folks!

  • ArmellineArmelline Member, PRO Posts: 5,332
    edited October 2014

    You can achieve that effect by using three actors and having an order they cycle through the possibilities in - i.e. predefined positions on the wheel. It would be a lot easier than trying to actually have a strip and move it.

  • CometPlusCometPlus Member Posts: 3

    @Socks Would you mind letting me know which version of GameSalad you are using? I'm on 0.10.5 for Windows and I think there are some feature you have that I don't.

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2014

    @CometPlus said:
    Socks Would you mind letting me know which version of GameSalad you are using? I'm on 0.10.5 for Windows and I think there are some feature you have that I don't.

    I'm using the current Release Candidate, but there's nothing I'm using that you couldn't do in any version of GameSalad from the last few years.

    To make the reels 'spin' I am simply moving the fruit images up and down in the Y axis (although on the way up they are invisible, so you don't see them going up) and changing their height, and that is basically it, everything else like the fact that their alpha channel also fades in and out (to give you the illusion that they are coming in and out of shadow) or the reel image that sits in the background, or the specular highlight towards the top of the reel, or the little 'settle' when the reels stop spinning . . and so on . . . all that is all just aesthetic stuff, it's still work just fine without all that, the basic 'spin' is just moving objects up and down and squashing them, something you can very easily do in any version of GameSalad.

  • KC_GamesKC_Games Member, PRO Posts: 86

    @Socks Is it possible to see the code for the slot machine video that you posted?

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited June 2015

    Here's a free one we made a while back http://www.deepblueapps.com/gs-fruit-machine/

  • ArmellineArmelline Member, PRO Posts: 5,332
    edited June 2015

    @Socks said:
    Here's a movie of the basic idea for the sine wave driven 'true' spin . . . (I hope @Armelline doesn't mind that I stole his Fruit Machine images for the demo !!)

    Damn @Socks that's impressive! Every time I think I've done something clever I see something you've done like that...

    How I missed this before I don't know!

  • Thunder_ChildThunder_Child Member Posts: 2,343

    @DeepBlueApps said:
    Here's a free one we made a while back http://www.deepblueapps.com/gs-fruit-machine/

    This is such a simple but very powerful project to start with when making slots.

    I really appreciate @DeepBlueApps for making this available...which has actually been around for some time.

    I have spent over a year building upon this basic template.

  • KC_GamesKC_Games Member, PRO Posts: 86

    thanks @DeepBlueApps !

Sign In or Register to comment.