How do I create a smooth slots machine reels animation

0 favourites
  • 6 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Hi there

    I'll warn you guys upfront that I'm fairly new to C2.

    I'm trying to figure out how to create a smooth reels animation of a multi-line slots machine.

    I tried the following 2 methods (CAPX attached):

    1. using a strip with all symbols on the reel in a tiled background and shifting it top to bottom using the Y position parameter.

    2. using individual sprites pinned to a container while shifting the container to to bottom using bullet speed.

    I prefer the 2nd method as I want the symbols to be animated in case of winning + I'm thinking on building the reels dynamically after getting positions from server.

    In both methods I bumped into a serious issue, when I moved the reels slow everything worked great.

    BUT when I bumped the speed up a bit the newly created "next-to-be-shown-reel" (on top of the one displayed now) was created in weird places.

    sometimes overlapping the currently displayed reel and sometimes in a wide variable offset and the reel spin is not smooth.

    so, after this long preface I have several questions

    1. how can I achieve a smooth reel spin effect?

    2. do you have a better idea on how to implement a slots machine.

    3. how can I create a short easing effect at the end of the reel spin, I want the reel to be pushed up a bit in order to get the "lock-in-place" effect.

    Thank you,

    Yaniv Golan

  • Well, I'll be honest: I didn't look at the .capx

    1 & 2: What I would do would be create the reels as sprites. Since sprites have a built-in animation, you could have the reel simply stop animating at whatever frame the button is hit. You can also change the framerate on the animation without affecting anything else.

    3: To achieve the 'easing' effect, I think you would want to split the reel's animation up. Have a seperate animation within the sprite for each possible result of the reel. The animation's frames go from the previous image off-center to the ending frame, which is a locked-in-place image.

    [attachment=0:2b7m9896][/attachment:2b7m9896] As so.

    So you have an event, where until a button is pressed, the Reel's animation A proceeds to B when A ends, when B ends go to C, etc, until you come back to A. when the button is pressed, the animation proceeds to its end, and stops.

    Make sense?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Now, realistically, you probably wouldn't need that many images for your animation. Even with animation speed set to 60, this looks smooth and a little slow. You could probably cut out 2/3s of the frame and still have it look smooth.

  • How about a combination of 1, and 2 using the pin behavior?

  • Thanks a lot Unnatural20 sounds like a great idea in terms of smoothness...

    I haven't thought about it before but I'll try it today.

    newt, I didn't really understand, how can 1 & 2 be combined together?

  • hi, to answer this question, whot i think he ment is that you make just an ampty sprite which looks like the first one without pictures and then pin the single pictures to the sprite... even if i dont rly now how thsi would help. maybe it would be easyer to see on wich it stoped... but since you generating the numbers on a server it shouldnt make any difference.

    i am working on something similar at the moment and have the same problems

    so how is your work going?


Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)