slot machine

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 15434 Views - Last Post: 07 January 2014 - 05:30 PM

#16 DangerousDave  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 06-May 13

Re: slot machine

Posted 07 January 2014 - 01:21 PM

So how can I make my wild card wild and pay the whole pay structure.
here is the code for 5 of a kind but how to implement wild card?

if (
(slotR.slot1.src == slotR.slot2.src) 
&& (slotR.slot1.src == slotR.slot3.src)
&& (slotR.slot1.src == slotR.slot4.src) 
&& (slotR.slot1.src == slotR.slot5.src)
|| (slotR.slot1b.src == slotR.slot2b.src)
&& (slotR.slot1b.src == slotR.slot3b.src)
&& (slotR.slot1b.src == slotR.slot4b.src) 
&& (slotR.slot1b.src == slotR.slot5b.src) 
|| (slotR.slot1c.src == slotR.slot2c.src)
&&(slotR.slot1c.src == slotR.slot3c.src)
&&(slotR.slot1c.src == slotR.slot4c.src) 
&& (slotR.slot1c.src == slotR.slot5c.src)
) {
	slotR.banner.value
	="5 of a kind - You won "+Math.floor(document.slots.bet.value*50)+" gold pieces";
 slotR.gold.value
 =Math.floor(slotR.gold.value)+Math.floor(slotR.bet.value*50); 
 }


Was This Post Helpful? 0
  • +
  • -

#17 DangerousDave  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 06-May 13

Re: slot machine

Posted 07 January 2014 - 05:30 PM

I am looking to add a wild card to my pay outs.
I already have the image spinning on the reels.
I'm looking for a way to add the wild card.
var wild = slotitem[9]; //this is the Array with my image names. 1-10.
else if (
// here I am checking the reels for a pair.
	(slotR.slot1.src == wild) // if the first position on the first line src = 9 it is wild. and therefore a pair is true.
	|| (slotR.slot2.src == wild) // if the second  position  on the first line src = 9 it is wild. and therefore a pair is true.
	|| (slotR.slot1b.src == wild)
	|| (slotR.slot2b.src == wild)
	|| (slotR.slot1c.src == wild)
	|| (slotR.slot2c.src == wild) // the same goes for the next two lines on the reel.
	|| (slotR.slot1.src == slotR.slot2.src) //next check for a natural pair on all three lines.
	|| (slotR.slot1b.src == slotR.slot2b.src) 
	|| (slotR.slot1c.src == slotR.slot2c.src)
	) {
		slotR.banner.value
		= "A pair - You won "+Math.floor(slotR.bet.value*1.5)+" gold pieces"; // tell the user how he did on that spin.
		 slotR.gold.value 
		 = Math.floor(slotR.bet.value*1.5) + Math.floor(slotR.gold.value); // report your earnings to the bank.
		 }		 


this is only a guess It won't work, for now. but I'm close.
if you feel I need to change the structure. feel free to inspire me. as I do this as a hobby.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2