Sign in to follow this  
luffyyyyy

Understanding the infinite slot reel in the slots example

Recommended Posts

Hi!

I'm looking to start with Pixi, and i thought it would be fun to look if i can play around with the Slots from the Examples . Now when i look at the code provided i think i understand de part where the 5 reels are build and filled with 4 random symbols each. The part i don't understand is how it works when spinning the slots it looks like the reels are filled with infinite random symbols.

Can someone explain to me in wat part of the code this effect is happening?

Code can be found here: https://pixijs.io/examples/#/demos-advanced/slots.js

Luffy :)

Share this post


Link to post
Share on other sites

Hi,

I'm the one who made that example. Here's a short description on how it works. The text uses only one reel as an example as all the others function in the same way:

Let's say we have a position where the reel is (reel.position). This position is increased on each frame. Then each sprite is positioned based on that position. When the symbol is detected to be back to start, a new symboltexture is randomized to it.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.