Jump to content

Simple Slot game, Struggling.


Euden
 Share

Recommended Posts

I'm trying to create a simple slot game. I have several images for the game: a cherry, a bar, a 7, 2 bars, spin button and a 640x480 black image with 4 'slots' that are transparent for the slots to roll in.

 

I'm struggling to grasp the best way to do this, the basic Idea I had was to create 5 canvases. one to hold the base image and 4 others filled with several images for the slots that are behind the base image that then move.

 

Problem is. I can't find any tutorials on this nor where to begin.

Link to comment
Share on other sites

You don't want multiple canvases, that wouldn't work. You can draw it on one canvas and it'll be a lot more efficient! I've never done this with a canvas 2d context, but it's definitely possible.

 

You'll need to set up the right blend mode, then draw the objects in a logical order, ie the slot machine last. 

 

If that's too vague and you need any help/clarification just ask :)

Link to comment
Share on other sites

  • 2 weeks later...

I'm just going to throw this out there, not knowing your final plan. You could also get away with using 3 divs and a background image that is the slot strip. What would work out nicely for you here is that you can set the background to repeat-y (no need to manually loop the image), and change the backgrounds y position value. You could even use css transitions to animate the position change. Just some thoughts.

Link to comment
Share on other sites

I'm trying to create a simple slot game. I have several images for the game: a cherry, a bar, a 7, 2 bars, spin button and a 640x480 black image with 4 'slots' that are transparent for the slots to roll in.

 

I'm struggling to grasp the best way to do this, the basic Idea I had was to create 5 canvases. one to hold the base image and 4 others filled with several images for the slots that are behind the base image that then move.

 

Problem is. I can't find any tutorials on this nor where to begin.

 

 

1 canvas as that banna guy said. Your be placing images in different locations.

Link to comment
Share on other sites

I'm trying to create a simple slot game. I have several images for the game: a cherry, a bar, a 7, 2 bars, spin button and a 640x480 black image with 4 'slots' that are transparent for the slots to roll in.

 

I'm struggling to grasp the best way to do this, the basic Idea I had was to create 5 canvases. one to hold the base image and 4 others filled with several images for the slots that are behind the base image that then move.

 

Problem is. I can't find any tutorials on this nor where to begin.

Tutorial - http://bravenewmethod.com/2013/03/14/simple-slot-machine-with-html5/

Link to comment
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...
 Share

  • Recently Browsing   0 members

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