How do I create a smooth slots machine reels animation

Get help using Construct 2

Post » Thu Jan 15, 2015 11:44 am

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
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 2
Reputation: 179

Post » Thu Jan 15, 2015 1:29 pm

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.
bellAnim.png
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?
You do not have the required permissions to view the files attached to this post.
B
11
S
4
Posts: 152
Reputation: 1,236

Post » Thu Jan 15, 2015 1:55 pm

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.
B
11
S
4
Posts: 152
Reputation: 1,236

Post » Thu Jan 15, 2015 2:03 pm

How about a combination of 1, and 2 using the pin behavior?
Image ImageImage
B
168
S
50
G
169
Posts: 8,281
Reputation: 108,191

Post » Sun Jan 18, 2015 10:36 am

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?
B
3
Posts: 2
Reputation: 179

Post » Sun Feb 08, 2015 12:19 am

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 :D
so how is your work going?

regards
B
19
S
7
G
1
Posts: 222
Reputation: 2,546


Return to How do I....?

Who is online

Users browsing this forum: guannstar, odiusfly, tankhedgehog and 22 guests