share game nông trại

8 bài đăng
10.07.2016 / 09:08
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.
HTML5
  1. <script src="/files/1043097/jquery.js"></script>
  2. <script src="/files/1091621/cookies.js"></script>
  3.  
  4. <script>
  5. $(function(){
  6. var timeStamp = Math.floor(Date.now() / 1000);
  7. function timeRun(){
  8. timeStamp=timeStamp+1;
  9. setTimeout(function(){timeRun()},1000);
  10. }
  11. timeRun();
  12. coin=1500;odat={};cjon={};ctime={};
  13. var tien=getCookie('tien')||'';
  14. if(!tien){
  15. setCookie('tien',1500,3600);
  16. }
  17. plant=['pthila','pcucai','pdualeo','pcatim','pcarot','pluami','pcachua','pbapcai','pbap'];
  18. namep=['Thì là','Củ Cải','Dưa leo','Cà tím','Cà rốt','Lúa mì','Cà chua','Bắp cải','Bắp ngô'];
  19. timep=['200','400','900','1400','2000','2500','3500','5000','10000'];
  20. tienp=['500','1100','2500','2900','3500','5000','6500','7000','8500'];
  21. tiens={'pthila':'1000','pcucai':'1800','pdualeo':'2900','pcatim':'3500','pcarot':'5000','pluami':'6700','pcachua':'8500','pbapcai':'9000','pbap':'13000'};
  22. function plantRun(){
  23. for(os=0;os<=5;os++){
  24. cjon[os]=getCookie('d'+(os+1)+'P')||'';
  25. ctime[os]=getCookie('d'+(os+1)+'T')||'';
  26. if(cjon[os]){
  27. $('#d'+(os+1)).removeClass('dattrong');
  28. $('#d'+(os+1)).addClass(cjon[os]);
  29. if(ctime[os]){
  30. $('#d'+(os+1)).attr('data-time',ctime[os]);
  31. }
  32. }
  33. }
  34. setTimeout(function(){plantRun()},1000);
  35. }
  36. plantRun();
  37. $('.odat').click(function(){
  38. id=$(this).attr('id');
  39. planted=$(this).attr('class').split(' ')[1]||'';
  40. chonP=getCookie(id+'P')||'';
  41. chonT=getCookie(id+'T')||'';
  42. if(chonP){
  43. if(chonP=='dattrong'){
  44. $('.info').html('Bạn chưa xới đất!<br><a href="#xoidat" class="xoingay" data-id="'+id+'">Xới đất</a>');
  45. }else if(chonP=='datxoi'){
  46. $('.info').html('Đất đã xới, trồng cây nào!<br><a href="#gieohat" class="gieohat" data-id="'+id+'">Gieo hạt</a>');
  47. }else{
  48. lsktime=$(this).attr('data-time')||'';
  49. if(lsktime>timeStamp){
  50. $('.info').html('Cây đang trong giay đoạn phát triển.<br>Thu hoạch: '+(lsktime-timeStamp)+'s');
  51. }else{
  52. $('.info').html('Cây đã chín!<br>Thu hoạch bội thu nào <br>[<a href="#thuhoach" class="thuhoach" id="'+id+'" data-plant="'+planted+'">Thu hoạch</a>]');
  53. }
  54. }
  55. }else{
  56. if(!odat[id]){
  57. $('.info').html('Bạn chưa xới đất!<br><a href="#xoidat" class="xoingay" data-id="'+id+'">Xới đất</a>');
  58. }else if(odat[id]=='datxoi'){
  59. $('.info').html('Đất đã xới, trồng cây nào!<br><a href="#gieohat" class="gieohat" data-id="'+id+'">Gieo hạt</a>');
  60. }
  61. }
  62. game();
  63. });
  64. function game(){
  65. $('.xoingay').click(function(){
  66. id=$(this).attr('data-id');
  67. $('#'+id).removeClass('dattrong');
  68. $('#'+id).addClass('datxoi');
  69. setCookie(id+'P','datxoi',3600);
  70. odat[id]='datxoi';
  71. $('.info').html('Xới đất thành công!');
  72. game();
  73. });
  74. $('.gieohat').click(function(){
  75. id=$(this).attr('data-id');
  76. shows='';
  77. for(i=0;i<plant.length;i++){
  78. shows+='<tr><td><img src="files/1067753/'+plant[i]+'.png"></td><td>'+namep[i]+'<br>Sinh trưởng: '+timep[i]+' s<br>Giá: '+tienp[i]+' vàng<br>Bán: '+tiens[plant[i]]+' vàng<br><a href="#gieoxong" class="gieoxong" data-id="'+id+'" data-plant="'+plant[i]+'" data-time="'+timep[i]+'" data-tien="'+tienp[i]+'">Trồng cây</a></td></tr>';
  79. };
  80. $('.info').html('<table>'+shows+'</table>')
  81. game();
  82. })
  83. $('.gieoxong').click(function(){
  84. id=$(this).attr('data-id');
  85. idp=$(this).attr('data-plant');
  86. idt=$(this).attr('data-time');
  87. idts=$(this).attr('data-tien');
  88. if(tien-idts>=0){
  89. $('#'+id).removeClass();
  90. $('#'+id).addClass('odat '+idp);
  91. $('#'+id).attr('data-time',parseInt(timeStamp)+parseInt(idt));
  92. setCookie(id+'P',idp,3600);
  93. setCookie(id+'T',parseInt(timeStamp)+parseInt(idt),3600);
  94. setCookie('tien',parseInt(getCookie('tien'))-parseInt(idts),3600);
  95. $('.info').html('Gieo hạt thành công!');
  96. }else{
  97. $('.info').html('Bạn không đủ tiền mà!');
  98. }
  99. game();
  100. })
  101.  
  102. $('.thuhoach').click(function(){
  103. idp=$(this).attr('data-plant')||'';
  104. id=$(this).attr('id')||'';
  105. setCookie('tien',parseInt(tien)+parseInt(tiens[idp]),3600);
  106. setCookie(id+'P','dattrong',3600);
  107. setCookie(id+'T','',3600);
  108. $('.info').html('Thu hoạch '+tiens[idp]+' tiền rồi bạn ơi!');
  109. tien=getCookie('tien')||'';
  110. $('#'+id).removeClass();
  111. $('#'+id).addClass('odat dattrong');
  112. $('.coin').html(tien);
  113. })
  114. tien=getCookie('tien')||'';
  115. $('.coin').html(tien);
  116. }
  117. game();
  118. })
  119. </script>
  120. <style>
  121. *{
  122. word-wrap: break-word;
  123. }
  124. body{
  125. -webkit-user-select:none;
  126. -moz-user-select:none;
  127. -o-user-select:none;
  128. user-select:none;
  129. }
  130. .nongtrai{
  131. width: 200px;
  132. margin: 0px auto;
  133. text-align: center;
  134. padding: 20px 10px;
  135. border-radius: 3px;
  136. background: #016DB6;
  137. }
  138. .bgf{
  139. background:url('/files/1067753/bgf.png');
  140. width:160px;
  141. height:61px;
  142. margin-bottom:3px;
  143. display: inline-block;
  144. }
  145. .odat{
  146. width:30px;
  147. height:30px;
  148. display:inline-block;
  149. cursor:pointer;
  150. box-shadow: 0px 0px 5px 0px #00406C, 0px 0px 2px 0px #000 inset;
  151. }
  152. .dattrong{
  153. background: url('/files/1067753/dattrong.png');
  154. }
  155. .datxoi{
  156. background: url('/files/1067753/datxoi.png');
  157. }
  158. .pthila{
  159. background: url('/files/1067753/pthila.png');
  160. }
  161. .pbap{
  162. background: url('/files/1067753/pbap.png');
  163. }
  164. .pbapcai{
  165. background: url('/files/1067753/pbapcai.png');
  166. }
  167. .pcachua{
  168. background: url('/files/1067753/pcachua.png');
  169. }
  170. .pcarot{
  171. background: url('/files/1067753/pcarot.png');
  172. }
  173. .pcatim{
  174. background: url('/files/1067753/pcatim.png');
  175. }
  176. .pcucai{
  177. background: url('/files/1067753/pcucai.png');
  178. }
  179. .pdualeo{
  180. background: url('/files/1067753/pdualeo.png');
  181. }
  182. .pluami{
  183. background: url('/files/1067753/pluami.png');
  184. }
  185. .info{
  186. background: #fff;
  187. border-radius: 3px;
  188. font-family: monospace;
  189. text-align:left;
  190. padding: 0px 5px;
  191. }
  192. .coin{
  193. background: #fff url('/files/1067753/money.png') left center no-repeat;
  194. position: absolute;
  195. font-size: 11px;
  196. font-family: monospace;
  197. padding: 1px 1px 1px 15px;
  198. border-radius: 4px;
  199. margin: -10px 0px 0px 0px;
  200. }
  201. </style></div>
  202. <div class="nongtrai">
  203. <div class="coin">1500</div>
  204. <div class="bgf"></div><br>
  205. <div class="odat dattrong" id="d1">
  206. </div>
  207. <div class="odat dattrong" id="d2">
  208. </div>
  209. <div class="odat dattrong" id="d3">
  210. </div><br>
  211. <div class="odat dattrong" id="d4">
  212. </div>
  213. <div class="odat dattrong" id="d5">
  214. </div>
  215. <div class="odat dattrong" id="d6">
  216. </div>
  217. <div class="info">
  218.  
  219. </div>
  220. </div>

Các bạn thêm 1 mã này là có thể sử dụng game cùng với game bầu cua hôm trước mình đã share(dùng chung là dùng chung tiền) URL: Share game bầu cua, chuẩn đẹp trai

10.07.2016 / 09:12
Kelry
Bài đăng: 77
Member
[ĐB] fb.com/groups/wapegovn

đb like cho nó cái cho dái nó cửng =]]

10.07.2016 / 09:17
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.

thím nói khó hiểu ra

10.07.2016 / 09:24
bink
Bài đăng: 115
Member
mad đã viết

thím nói khó hiểu ra

đb nói lên tất cả. chú ấy đặc biệt nhất cmn phonho này rồi. kf biết ra xã hội có nc kiểu ấy kg :D

10.07.2016 / 09:32
Windyluck
Bài đăng: 299
Member

:apl:

10.07.2016 / 10:54
kayer
Bài đăng: 240
Member
Đã đủ 18 dấu + làm người lớn

Code này trồng cây thì là nữa à?

01.08.2016 / 12:46
tnit2510
Bài đăng: 968
Member

Code lỗi a ơi. Vô nick nào cuzng thấy cây của bick gốc trồng. Tất cả đều là 1 data -_-

01.08.2016 / 18:36
Hungdz
Bài đăng: 324
Member
Hihi đồ ngu....

Ko có ăn chôm bạn bè