Jump to content

Help Planning a Phaser Slot Machine


404error
 Share

Recommended Posts

First time poser here. 
I am starting to work on a simple 3 reel slot machine.
A working jQuery version is here:http://104.236.144.16/tests/

I would like to convert this to a Phaser game to take advantage of all the features.
I am looking for any type of help or direction in planning this project. I am very new to Phaser.

What I would like to have is 3 reels, each reel will have a varying number of tiles/sprites.
To spin the reels should I be using gravity to make them fall or a tween animation? 

I would like to have a designated area where the reels spin but have the overflow hidden from the rest of the stage. When the spinning stops I would like to show 3 tiles/sprites for each reel and then I will be drawing lines connect the sprites to show the user the winning combination. 

I have attached an image to show what I am trying to describe. I am not looking for someone to do this for me, I am just looking for help, I've scanned through the API but the terminology is all new to me and cant seem to find answers there YET.

Should me reels be groups? Can I animate a group as a whole or does the animation only affect the individual sprites?

Thanks in advance to anyone who can shed some light.  

 

Capture.PNG

Link to comment
Share on other sites

I would make each reel in the slot machine a TileSprite. TileSprites have a repeating texture that can be scrolled around independently of the position of the sprite itself (paraphrasing from the docs).

In this case, you could add a TileSprite for each reel and then change each sprite's "tilePosition" property to "move" the image around, simulating the reel.

Link to comment
Share on other sites

4 hours ago, drhayes said:

I would make each reel in the slot machine a TileSprite. TileSprites have a repeating texture that can be scrolled around independently of the position of the sprite itself (paraphrasing from the docs).

In this case, you could add a TileSprite for each reel and then change each sprite's "tilePosition" property to "move" the image around, simulating the reel.

Thanks for the help. I was feeling a bit lost here. In my slot machine there will be an area that will display the slots spinning. Should I use a mask for that? I am assuming I will have to use a world wrap to simulate the reel spinning correct?

Thanks again. 

Link to comment
Share on other sites

No mask needed! TileSprites can also be sized smaller than their textures (really, anything can I guess). You could then slide the texture around with "tilePosition".

Also, if you add the reels first and then the front of the machine, the front of the machine will occlude the reels because of the painter's algorithm -- literally, the front of the machine gets "painted" on top of the reels, hiding anything you want to hide.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...