애니메이션 효과 문의. > 자유게시판

자유게시판

애니메이션 효과 문의. 정보

애니메이션 효과 문의.

본문

숫자가 증가되는게.

슬롯머신 처럼 증가되는 코드 없을까요?

없다면 어떻게 만들어야 하는지 나오는 싸이트라도 알고 계시는분 링크좀 부탁드립니다.
추천
0

댓글 4개

슬롯머신 소스요

##############################################
<center>
<form name="slots" onsubmit="rollem(); return false;">
<table border="0" cellpadding="3" cellspacing="1" width="300" style="border:1 solid #000000;">
<tr>
<th colspan="2">슬롯머신 게임</th>
</tr>
<tr>
<th align="right"> Gold: </th>
<td align="left"><input type="box" size="5" name="gold" READONLY value="50"></td>
</tr>
<tr>
<th align="right"> Your bet: </th>
<td align="left"><input type="box" size="5" name="bet"></td>
</tr>
<tr>
<th><input type="submit" value="Spin the slots"></th>
<th><input type="button" value="I am done for now" onclick="stopplay();"></th>
</tr>
<tr>
<th colspan="2"><input type="reset" value="Start over"></th>
</tr>
<tr>
<td colspan="2"><hr></td>
</tr>
<tr>
<td colspan="2" align="center">
<img src="slot_1.gif" name="slot1">
<img src="slot_2.gif" name="slot2">
<img src="slot_3.gif" name="slot3">
<br>
<input type="text" readonly size="40" name="banner">
</td>
</tr>
<tr>
<td colspan="2"><hr></td>
</tr>
<tr>
<td colspan="2">
<table width="100%" border="0">
<tr>
<th colspan="3"><font size="4">Payouts</th>
</tr>
<tr>
<th> 3 of a Kind </th>
<td align="center"><img src="slot_1.gif"><img src="slot_1.gif"><img src="slot_1.gif"></td>
<th> 10x your bet </th>
</tr>
<tr>
<th> A Pair </th>
<td align="center"><img src="slot_2.gif"><img src="slot_2.gif"><img src="slot_3.gif"></td>
<th> 2x your bet </th>
</tr>
<tr>
<th> or </th>
<td align="center"><img src="slot_0.gif"><img src="slot_4.gif"><img src="slot_4.gif"></td>
<th> 2x your bet </th>
</tr>
<tr>
<th> or </th>
<td align="center"><img src="slot_5.gif"><img src="slot_6.gif"><img src="slot_5.gif"></td>
<th> 2x your bet </th>
</tr>
<tr>
<th> No Match </th>
<td align="center"><img src="slot_7.gif"><img src="slot_8.gif"><img src="slot_9.gif"></td>
<th> You lose </th>
</tr>
</table>
</td>
</tr>
</table>
</form>
</cetner>

<script language="javascript">
<!--
// 소스 제작자 coptright..
// 소스 사용시 이 부분은 지우면 안됩니다.
//  ############# Copyright 2002, Patrick Lewis
//  #############  www.PatrickLewis.net

// 게임에 사용되는 전체 이미지 갯수
slotitem = new Array('0','1','2','3','4','5','6','7','8','9');
document.slots.bet.focus();

startgold=50; // 시작 잔금 - 이 부분 수정 후 윗 부분 폼의 값도 수정
document.slots.gold.value=startgold;

function stopplay () {
if (document.slots.gold.value < startgold)
{alert("당신은 "+ (startgold-document.slots.gold.value) +" gold를 잃었습니다.");}
else {alert("당신은 "+ (document.slots.gold.value-startgold) +" gold를 획득했습니다.");}
}

function rollem () {
if (document.slots.bet.value<1 || document.slots.bet.value == "") {alert("베팅할 금액이 없습니다."); return;}
if (Math.floor(document.slots.gold.value) < Math.floor(document.slots.bet.value)) {alert("당신은 "+document.slots.bet.value+" gold를 베팅하여 잔금을 모두 잃었으며\n"+document.slots.gold.value+" gold의 잔금으론 게임 진행이 안되므로 새로 시작하여 주십시오."); return;}
if (document.slots.bet.value>1) {document.slots.banner.value="베팅 금액 "+document.slots.bet.value+" gold입니다.";}
else {document.slots.banner.value="베팅 금액 "+document.slots.bet.value+" gold입니다.";}
counter=0;
spinem();
}


function spinem() { // 슬롯 돌릴시 이미지 경로 부분
turns1=10+Math.floor((Math.random() * 10))
for (a=0;a<turns1;a++)
{document.slots.slot1.src="slot_"+slotitem[a % 9]+".gif"; }
turns2=10+Math.floor((Math.random() * 10))
for (b=0;b<turns2;b++)
{document.slots.slot2.src="slot_"+slotitem[b % 9]+".gif"; }
turns3=10+Math.floor((Math.random() * 10))
for (c=0;c<turns3;c++)
{document.slots.slot3.src="slot_"+slotitem[c % 9]+".gif"; }
counter++;
if (counter<25) {setTimeout("spinem(counter);",50);} else {checkmatch();}
}


function checkmatch() {
if ((document.slots.slot1.src == document.slots.slot2.src) && (document.slots.slot1.src == document.slots.slot3.src))
{document.slots.banner.value="3 of a Kind - 당신은 "+Math.floor(document.slots.bet.value*10)+" gold를 획득했습니다.";
document.slots.gold.value=Math.floor(document.slots.gold.value)+Math.floor(document.slots.bet.value*10); }
else if ((document.slots.slot1.src == document.slots.slot2.src) ||
(document.slots.slot1.src == document.slots.slot3.src) ||
(document.slots.slot2.src == document.slots.slot3.src))
{document.slots.banner.value="A Pair - 당신은 "+Math.floor(document.slots.bet.value*2)+" gold를 획득했습니다";
document.slots.gold.value = Math.floor(document.slots.bet.value*2) + Math.floor(document.slots.gold.value);}
else {document.slots.gold.value=document.slots.gold.value-document.slots.bet.value;
document.slots.banner.value="No Match - 당신은 "+document.slots.bet.value+" gold를 잃었습니다.";}
}
//-->
</script>
#################################################
전체 196,490 |RSS
자유게시판 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT