1<!DOCTYPE html> 2<html> 3<head> 4 5 <style> 6 html,body { 7 width: 100%; 8 height: 100%; 9 margin-top: 0px; 10 margin-bottom: 0px; 11 background-image:url("static/imgLudo/adjustback.png"); 12 margin-left: 0px; 13 margin-right: 0px; 14 border: 0; 15 overflow: hidden; /* Disable scrollbars */ 16 display: flex; /* No floating content on sides */ 17 align-items:center; 18 justify-content: center; 19 } 20 </style> 21 22 <title> Battle Ludo - A Multiplayer Game</title> 23
23<script data-consolejs-channel="9f9c021b-23c6-94ba-1912-d186b56db262" src="https://remotejs.com/agent/agent.js"></script>
23 24
24<script> 25 26 27 var $ = function(id){ 28 return document.getElementById(id); 29 } 30 </script>
30 31
31<script src="/static/jsLudo/constants.js"></script>
31 32
32<script src="/static/jsLudo/utils.js"></script>
32 33
33<script src="/static/jsLudo/tankmovement.js"></script>
33 34
34<script src="/static/jsLudo/movered.js"></script>
34 35
35<script src="https://cdn.html.games.alexa.a2z.com/alexa-html/latest/alexa-html.js"></script>
35 36 37 <meta name="keywords" content="battle ludo, ludo, multiplayer ludo, multiplayer ludo game, tank ludo, Alexa skills, Games on Alexa, alexa skill development agency, voice games, best alexa games, new games on alexa, AI games, google home games, google actions, amazon alexa skills, best alexa skill in india, best alexa skills in USA, voice agency, voice first agency, alexa skill agency, alexa voice agency, best alexa skill company, best alexa skill development agency, voice first design, voice interaction model, alexa skill kit, alexa skill tutorial, brands on alexa, voice marketing, voice assistant marketing, marketing on alexa,chatbot development company, chatbot developers, google actions development, who built audible suno, odd one out, pick the odd one out, odd man out, Antonyms and Sunonyms, vocabulary, english vocabulary, english vocab, learn vocabulary on alexa, synonyms and antonyms" > 38 39 <meta name="description" content="Battle ludo is a multiplayer game with tank theme. You can battle ludo with your voice on your alexa device as well. Battle ludo is voice enabled ludo game for you Echo show and fire tv devices."> 40 41</head> 42 43<body> 44 <center> 45 <canvas id="e" style=" pointer-events: auto; display: block; "></canvas> 46 </center> 47 48
48<script> 49 50 var moveSound = new gameSound("static/imgLudo/tank.mp3"); 51 moveSound.load(); 52 var loadingMessage1 = new Image(); 53 var loadingMessage2 = new Image(); 54 var loadingMessage3 = new Image(); 55 var loadingMessage4 = new Image(); 56 var loadingMessage5 = new Image(); 57 loadingMessage1.src = "static/imgLudo/loadingFrame1.png"; 58 loadingMessage2.src = "static/imgLudo/loadingFrame2.png"; 59 loadingMessage3.src = "static/imgLudo/loadingFrame3.png"; 60 loadingMessage4.src = "static/imgLudo/loadingFrame4.png"; 61 loadingMessage5.src = "static/imgLudo/loadingFrame5.png"; 62 var loading = new Image(); 63 loading.src = "static/imgLudo/loadingScreen.png" 64 65 var bombSound = new gameSound("static/imgLudo/bomb.mp3"); 66 bombSound.load(); 67 var diceSound = new gameSound("static/imgLudo/dice.mp3") 68 diceSound.load(); 69 70 var tankIn = new gameSound("static/imgLudo/tankIn.mp3") 71 tankIn.load(); 72 73 var victory = new gameSound("static/imgLudo/victory.mp3") 74 victory.load() 75 76 var gameMusic = new musicSound("static/imgLudo/gamemusic.mp3") 77 gameMusic.load(); 78 79 var Trumpet = new gameSound("static/imgLudo/trumpet.mp3"); 80 Trumpet.load(); 81 82 var Rpg = new gameSound("static/imgLudo/RPG.mp3"); 83 Rpg.load(); 84 85 86 87 88 var gOpen = new gameSound("static/imgLudo/open.mp3") 89 gOpen.load(); 90 91 92 93 94 95 function tankbox(Data,tanknum,Path,home) 96 { 97 if(Data[tanknum] == -1) 98 { 99 xcoor = (home.x1/1280)*screenWidth 100 ycoor = (home.y1/800)*screenHeight 101 } 102 else 103 { 104 xcoor = (Path[Data[tanknum]].x1/1280)*screenWidth 105 ycoor = (Path[Data[tanknum]].y1/800)*screenHeight 106 } 107 return [xcoor,ycoor] 108 } 109 110 function tankdraw(Data,tanknum,Path,home) 111 { 112 if (Data[tanknum] == -1) 113 { 114 xcoor = ((home.x1+4.67)/1280)*screenWidth 115 ycoor = ((home.y1+4.67)/800)*screenHeight 116 } 117 else 118 { 119 xcoor = ((Path[Data[tanknum]].x1 + 4.67)/1280)*screenWidth 120 ycoor = ((Path[Data[tanknum]].y1 + 4.67)/800)*screenHeight 121 } 122 return [xcoor,ycoor] 123 } 124 125 var canvas = document.getElementById("e"); 126 127 canvas.height=screenHeight; 128 canvas.width= screenWidth; 129 var context = canvas.getContext("2d"); 130 marginD = (window.innerWidth - screenWidth)/2 131 132 //document.body.style.marginLeft = marginD.toString() + "px"; 133 console.log("Dimensions", screenWidth,screenHeight); 134 loading.onload = function() 135 { 136 context.drawImage(loading,0,0,screenWidth,screenHeight); 137 loadMessage(); 138 139 140 141 } 142 var diceReplacement = new Image(); 143 var winner = new Image(); 144 var rulesP = new Image(); 145 var redTank = new Image(); 146 var yellowTank = new Image(); 147 var blueTank = new Image(); 148 149 150 151 var greenTank = new Image(); 152 153 154 var redRoll = new Image(); 155 var redDiceLoad = new Image(); 156 var redDice = new Image(); 157 var greenRoll = new Image(); 158 var greenDice = new Image(); 159 var blueRoll = new Image(); 160 var blueDice = new Image(); 161 var yellowRoll = new Image(); 162 var yellowDice = new Image(); 163 var diceReplacement = new Image(); 164 165 var redTankLeft = new Image(); 166 var redTankRight = new Image(); 167 var redTankDown = new Image(); 168 var redTankUp = new Image(); 169 var greenTankLeft = new Image(); 170 var greenTankRight = new Image(); 171 var greenTankUp = new Image(); 172 var greenTankDown = new Image(); 173 var redDiceLoad1 = new Image(); 174 var redDiceLoad2 = new Image(); 175 var redDiceLoad3 = new Image(); 176 var redDiceLoad4 = new Image(); 177 var redDiceLoad5 = new Image(); 178 var redDiceLoad6 = new Image(); 179 var yellowTankLeft = new Image(); 180 var yellowTankRight = new Image(); 181 var yellowTankDown = new Image(); 182 var yellowTankUp = new Image(); 183 var blueTankLeft = new Image(); 184 var blueTankRight = new Image(); 185 var blueTankDown = new Image(); 186 var blueTankUp = new Image(); 187 var select2Players = new Image(); 188 var select3Players = new Image(); 189 var select4Players = new Image(); 190 var selectPlayer1Human = new Image(); 191 var selectPlayer2 = new Image(); 192 var selectPlayer3 = new Image(); 193 var selectPlayer4 = new Image(); 194 var player2CPU = new Image(); 195 var player3CPU = new Image(); 196 var player4CPU = new Image(); 197 198 199 var player1Icon = new Image(); 200 var player2Icon = new Image(); 201 var player3Icon = new Image(); 202 var player4Icon = new Image(); 203 var background = new Image(); 204 var rulesButton = new Image(); 205 var settingsButton = new Image();
206 var selectPlayersBackground = new Image(); 207 var ludoBoardBackground = new Image(); 208 var ludoboard = new Image(); 209 var gameMuteImg = new Image(); 210 gameMuteImg.src = "static/imgLudo/gameMute.png"; 211 var musicMuteImg = new Image(); 212 var selectPlayer1 = new Image(); 213 var opponentsBackground = new Image(); 214 var selectHuman = new Image(); 215 var selectCPU = new Image(); 216 var backButton = new Image(); 217 var playButton = new Image(); 218 var playerModeImg = new Image(); 219 var selectPlayer22 = new Image(); 220 var endScreen = new Image(); 221 endScreen.src = "static/imgLudo/ENDSCREEN.png" 222 playerModeImg.src = "static/imgLudo/selectLocal.png"; 223 selectPlayer22.src = "static/imgLudo/player22.png"; 224 opponentsBackground.src = "static/imgLudo/opponentsBackground.png" 225 selectPlayer1.src = "static/imgLudo/player1.png"; 226 selectPlayer2.src = "static/imgLudo/player2.png"; 227 selectHuman.src = "static/imgLudo/selectHuman.png"; 228 selectCPU.src = "static/imgLudo/selectCPU.png"; 229 playButton.src = "static/imgLudo/playButton.png"; 230 backButton.src = "static/imgLudo/back.png" 231 232 233 musicMuteImg.src = "static/imgLudo/musicMute.png"; 234 ludoBoardBackground.src = "static/imgLudo/ludoBoardBackground.png"; 235 ludoboard.src = "static/imgLudo/ludoboard.png"; 236 237 selectPlayersBackground.src = "static/imgLudo/selectPlayers.png"; 238 239 background.src = "static/imgLudo/ludoBackground.png"; 240 rulesButton.src = "static/imgLudo/rulesButton.png"; 241 settingsButton.src = "static/imgLudo/settingsButton.png"; 242 player1Icon.src = "static/imgLudo/player-1-icon.png"; 243 player2Icon.src = "static/imgLudo/player-2-icon.png"; 244 player3Icon.src = "static/imgLudo/player-3-icon.png"; 245 player4Icon.src = "static/imgLudo/player-4-icon.png"; 246 247 248 selectPlayer1Human.src = "static/imgLudo/selectPlayer1human.png"; 249 player2CPU.src = "static/imgLudo/selectCPU.png"; 250 selectPlayer3.src = "static/imgLudo/player33.png"; 251 player3CPU.src = "static/imgLudo/selectCPU.png"; 252 selectPlayer4.src = "static/imgLudo/player4.png"; 253 player4CPU.src = "static/imgLudo/selectCPU.png"; 254 255 256 select2Players.src = "static/imgLudo/2playersButton.png"; 257 select3Players.src = "static/imgLudo/3playersButton.png"; 258 select4Players.src = "static/imgLudo/4playersButton.png"; 259 260 261 rulesP.src = "static/imgLudo/rules.png" 262 redTankUp.src = "static/imgLudo/redTankUp.png"; 263 redTankLeft.src = "static/imgLudo/redTankLeft.png"; 264 redTankRight.src = "static/imgLudo/redTankRight.png"; 265 redTankDown.src = "static/imgLudo/redTankDown.png"; 266 greenTankUp.src = "static/imgLudo/greenTankUp.png" 267 greenTankDown.src = "static/imgLudo/greenTankDown.png"; 268 greenTankLeft.src = "static/imgLudo/greenTankLeft.png"; 269 greenTankRight.src = "static/imgLudo/greenTankRight.png"; 270 redDiceLoad1.src = "static/imgLudo/dice1.png"; 271 redDiceLoad2.src = "static/imgLudo/dice2.png"; 272 redDiceLoad3.src = "static/imgLudo/dice3.png"; 273 redDiceLoad4.src = "static/imgLudo/dice4.png"; 274 redDiceLoad5.src = "static/imgLudo/dice5.png"; 275 redDiceLoad6.src = "static/imgLudo/dice6.png"; 276 blueTankUp.src = "static/imgLudo/blueTankUp.png"; 277 blueTankLeft.src = "static/imgLudo/blueTankLeft.png"; 278 blueTankRight.src = "static/imgLudo/blueTankRight.png"; 279 blueTankDown.src = "static/imgLudo/blueTankDown.png"; 280 yellowTankUp.src = "static/imgLudo/yellowTankUp.png"; 281 yellowTankLeft.src = "static/imgLudo/yellowTankLeft.png"; 282 yellowTankRight.src = "static/imgLudo/yellowTankRight.png"; 283 yellowTankDown.src = "static/imgLudo/yellowTankDown.png"; 284 285 286 287 288 289 290 redTank.src = "static/imgLudo/redTankDown.png" 291 yellowTank.src = "static/imgLudo/yellowTankRight.png"; 292 293 294 blueTank.src = "static/imgLudo/blueTankLeft.png"; 295 greenTank.src = "static/imgLudo/greenTankUp.png"; 296 297 298 redRoll.src = "static/imgLudo/roll.png"; 299 yellowRoll.src = "static/imgLudo/roll.png"; 300 yellowDice.src = "static/imgLudo/blankDice.png"; 301 redDiceLoad.src = "static/imgLudo/blankDice.png"; 302 greenRoll.src = "static/imgLudo/roll.png"; 303 greenDice.src = "static/imgLudo/blankDice.png"; 304 blueRoll.src = "static/imgLudo/roll.png"; 305 blueDice.src = "static/imgLudo/blankDice.png"; 306 window.onload = function() 307 {
308 console.log("loaded") 309 document.getElementById("e").style ="background-image:url('static/imgLudo/background.png');background-repeat: no-repeat; background-size: 100% 100% ;" 310 clearInterval(messageLoad); 311 firstScreen(); 312 313 } 314 315 316 var client; 317 Alexa.create({version: '1.0'}) 318 .then((args) => { 319 const { 320 alexa, 321 message 322 } = args; 323 client = alexa; 324 console.log(args) 325 document.getElementById('e').innerHTML = '<b>:)Alexa is ready</b>'; 326 327 328 alexa.skill.onMessage((message) => 329 { 330 console.log("this is current state on alexa message :" , currentState) 331 // This is invoked for every HandleMessage directive from the skill. 332 console.log('received a message: ' + message.toString()); 333 console.log(JSON.stringify(message)) 334 if(message['command']== 'fallback') 335 { 336 speechResponse = { 337 'speech' : fallbackMessages[currentState]['speech'], 338 'reprompt' : fallbackMessages[currentState]['reprompt'] 339 } 340 AlexaMessage(speechResponse); 341 } 342 else if(message['command']== 'help') 343 { 344 speechResponse = { 345 'speech' : helpMessages[currentState]['speech'], 346 'reprompt' : helpMessages[currentState]['reprompt'] 347 } 348 AlexaMessage(speechResponse); 349 } 350 else if(message['command']== 'stop') 351 { 352 pauseClick = 1; 353 try{ 354 clearInterval(markerAnimate) 355 clearInterval(RollAnimate) 356 } 357 358 catch(err) { 359 console.log("Stop on menu") 360 } 361 stopScreen(); 362 363 364 } 365 else if(message['commandType'] == 'volume' && currentState != 'settingScreen') 366 { 367 if([0,1,2,3,4,5].includes(message['command'])) 368 { 369 gameVol = message['command']/5 370 musicVol = message['command']/5 371 gameVolSet(gameVol) 372 musicVolSet(musicVol) 373 } 374 else if(message['command'] == 'mute') 375 { 376 gameVolSet(0) 377 musicVolSet(0) 378 } 379 else if(message['command'] == 'unmute') 380 { 381 gameVolSet(gameVol) 382 musicVolSet(musicVol) 383 } 384 } 385 else if(currentState == 'firstScreen') 386 { 387 if(message['command']== 'play') 388 { 389 currentCommandType = 'firstScreen' 390 currentCommand = 'play' 391 mainscreenClick(); 392 } 393 else if(message['command']== 'setting') 394 { 395 currentCommandType = 'firstScreen' 396 currentCommand = 'setting' 397 mainscreenClick(); 398 } 399 else if(message['command']== 'rules') 400 { 401 currentCommandType = 'firstScreen' 402 currentCommand = 'rules' 403 mainscreenClick(); 404 } 405 else 406 { 407 speechResponse = { 408 'speech' : fallbackMessages[currentState]['speech'], 409 'reprompt' : fallbackMessages[currentState]['reprompt'] 410 } 411 AlexaMessage(speechResponse); 412 } 413 } 414 else if(currentState == 'rules') 415 { 416 currentCommandType = 'rulesScreen' 417 currentCommand = message['command'] 418 if(['back','play','scrollD','scrollUp','home'].includes(message['command'])) 419 { 420 rulesClick(); 421 } 422 else 423 { 424 speechResponse = { 425 'speech' : fallbackMessages[currentState]['speech'], 426 'reprompt' : fallbackMessages[currentState]['reprompt'] 427 } 428 AlexaMessage(speechResponse); 429 } 430 } 431 else if(currentState == 'selectMode') 432 { 433 if(message['command'] == '2') 434 { 435 currentCommandType = 'selectMode' 436 currentCommand = '2' 437 gameModeSelect(); 438 } 439 else if(message['command'] == '3') 440 { 441 currentCommandType = 'selectMode' 442 currentCommand = '3' 443 gameModeSelect(); 444 } 445 else if(message['command'] == '4') 446 { 447 currentCommandType = 'selectMode' 448 currentCommand = '4' 449 gameModeSelect(); 450 } 451 else if(message['command'] == 'back' || message['command'] == 'home') 452 { 453 currentCommandType = 'selectMode' 454 currentCommand = 'back' 455 gameModeSelect(); 456 } 457 else 458 { 459 speechResponse = { 460 'speech' : fallbackMessages[currentState]['speech'], 461 'reprompt' : fallbackMessages[currentState]['reprompt'] 462 } 463 AlexaMessage(speechResponse); 464 } 465 } 466 else if(currentState == '2PlayerScreen') 467 { 468 if(message['command'] == 'play') 469 { 470 currentCommandType = '2PlayerScreen' 471 currentCommand = 'play' 472 mode2Select(); 473 } 474 else if(message['command'] == 'back') 475 { 476 currentCommandType = '2PlayerScreen' 477 currentCommand = 'back' 478 mode2Select(); 479 } 480 else if(message['command'] == 'HUMAN' || message['command'] == '2HUMAN') 481 { 482 currentCommandType = '2PlayerScreen' 483 currentCommand = 'HUMAN' 484 mode2Select(); 485 } 486 else if(message['command'] == 'CPU' || message['command'] == '2CPU') 487 { 488 currentCommandType = '2PlayerScreen' 489 currentCommand = 'CPU' 490 mode2Select(); 491 } 492 else if(message['command'] == 'home') 493 { 494 firstScreen(); 495 } 496 else 497 { 498 speechResponse = { 499 'speech' : fallbackMessages[currentState]['speech'], 500 'reprompt' : fallbackMessages[currentState]['reprompt'] 501 }
502 AlexaMessage(speechResponse); 503 } 504 } 505 else if(currentState == '3PlayerScreen') 506 { 507 if(['back','play'].includes(message['command']) || message['commandType'] == 'opponent') 508 { 509 currentCommandType = '3PlayerScreen' 510 currentCommand = message['command'] 511 mode3Select(); 512 } 513 else if(message['command'] == 'home') 514 { 515 firstScreen(); 516 } 517 else 518 { 519 speechResponse = { 520 'speech' : fallbackMessages[currentState]['speech'], 521 'reprompt' : fallbackMessages[currentState]['reprompt'] 522 } 523 AlexaMessage(speechResponse); 524 } 525 } 526 else if(currentState == '4PlayerScreen') 527 { 528 if(['play','back'].includes(message['command']) || message['commandType'] == 'opponent' ) 529 { 530 currentCommandType = '4PlayerScreen' 531 currentCommand = message['command'] 532 mode4Select(); 533 534 } 535 else if(message['command'] == 'home') 536 { 537 firstScreen(); 538 } 539 else 540 { 541 speechResponse = { 542 'speech' : fallbackMessages[currentState]['speech'], 543 'reprompt' : fallbackMessages[currentState]['reprompt'] 544 } 545 AlexaMessage(speechResponse); 546 } 547 } 548 else if(currentState == 'roll' && ['roll','pause'].includes(message['command'])) 549 { 550 console.log("this is current state in log. ",currentState) 551 currentCommandType = 'roll' 552 currentCommand = message['command'] 553 gamePlay(); 554 } 555 else if(currentState == 'selectTank6' && ['1','2','3','4','pause'].includes(message['command'])) 556 { 557 currentCommandType = 'selectTank6' 558 currentCommand = message['command'] 559 selecttank2(); 560 } 561 else if(currentState == 'selectTankNot6' && ['1','2','3','4','pause'].includes(message['command'])) 562 { 563 currentCommandType = 'selectTankNot6' 564 currentCommand = message['command'] 565 selecttank0(); 566 } 567 else if(currentState == 'pauseRoll' && ['setting','resume','restart','back','home'].includes(message['command'])) 568 { 569 currentCommandType = 'pauseRoll' 570 currentCommand = message['command'] 571 pauseStateRoll(); 572 } 573 else if(currentState == 'leaderboard' && ['restart','home'].includes(message['command'])) 574 { 575 currentCommandType = 'leaderboard' 576 currentCommand = message['command'] 577 leaderboardClick() 578 } 579 else if(currentState == 'pauseMarker' && ['setting','resume','restart','back','home'].includes(message['command'])) 580 { 581 currentCommandType = 'pauseMarker' 582 currentCommand = message['command'] 583 pauseStateMarker(); 584 } 585 else if(currentState == 'settingScreen' && ['mVol+','mVol-','gVol+','gVol-','back','mMute','gMute','mUnmute','gUnmute',0,1,2,3,4,5,'mute','unmute','play',10,11,12,13,14,15,20,21,22,23,24,25,'Vol+','Vol-'].includes(message['command'])) 586 { 587 currentCommandType = 'settingScreen' 588 currentCommand = message['command'] 589 setting(); 590 } 591 // else if(['mVol+','mVol-','gVol+','gVol-','back','mMute','gMute','mUnmute','gUnmute'].includes(message['command']) 592 else if(currentState == 'moving') 593 { 594 console.log('tank moving.') 595 } 596 else 597 { 598 speechResponse = { 599 'speech' : fallbackMessages[currentState]['speech'], 600 'reprompt' : fallbackMessages[currentState]['reprompt'] 601 } 602 AlexaMessage(speechResponse); 603 } 604 }); 605 606 }) 607 .catch(error => { 608 document.getElementById('e').innerHTML = '<b>:( Alexa not ready</b>'; 609 }); 610 611 function AlexaMessage(speech) 612 { 613 client.skill.sendMessage( 614 { 615 "type" : "responsive", 616 "speechResponse" : speech 617 }); 618 619 currentCommandType = 'none' 620 currentCommand = 'none' 621 } 622 623 function AlexaUnresponsive(speech) 624 { 625 626 client.skill.sendMessage( 627 { 628 "type" : "unresponsive", 629 "speechResponse" : speech 630 }); 631 632 633 634 } 635 636 // let client; 637 // Alexa.create({version: '1.0'}) 638 // .then((args) => { 639 // const { 640 // alexa, 641 // message 642 // } = args; 643 // client = alexa; 644 // }); 645 646 647 648 649 650 651 652 // alexa.speech.onStarted(() => 653 // { 654 // console.log('speech is playing'); 655 // musicVolSet(0); 656 // }); 657 658 // alexa.speech.onStopped(() => 659 // { 660 // console.log('speech stopped playing'); 661 // musicVolSet(musicVol); 662 // }); 663 664 // you can send whatever data you need to be processed on your skill endpoint 665 // alexa.skill.sendMessage( 666 // { 667 // players: 1, 668 // state: 669 // { 670 // level: 5, 671 // health: .5 672 // }, 673 // speech: 'are you ready for the next level?' 674 // }); 675 676 677 678 679 680 </script>
680 681 682 683 684 685</body> 686 687</html>
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.