404error

Help Planning a Phaser Slot Machine

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

Share this post


Link to post
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.

Share this post


Link to post
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. 

Share this post


Link to post
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.

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...

  • Recently Browsing   0 members

    No registered users viewing this page.