hi, i just found a bingo card maker script but have no idea to use this script in unity.
i will use it android and web base
i start using unity just a few days.
i don’t have any experience game creating.
i did create bingo balls fooling down but i want each of them randomly numbered different all the time the game started. and when they felt to the ground, i want the bingo card automatically marked. (i want the mark as, the background colour of the number will change in for example : red)
i will be greatfull if somebody have any idea to do this.
here is the script that i have found
29 script.css
@@ -0,0 +1,29 @@
+body {
- background-color: white;
- color: black;
- font-size: 20px;
- font-family: “Lucida Grande”, Verdana, Arial, Helvetica, sans-serif;
+}
+h1, th {
- font-family: Georgia, “Times New Roman”, Times, serif;
+}
+h1 {
- font-size: 28px;
+}
+table {
- border-collapse: collapse;
+}
+th, td {
- padding: 10px;
- border: 2px #666 solid;
- text-align: center;
- font-size: 24px;
+}
+#free {
- background-color: #F66;
+}
56 script.html
@@ -0,0 +1,56 @@
+
+
- Make Your Own Bingo Card
+
+
+
Create A Bingo Card
+
+
B | I | N | G | O |
---|---|---|---|---|
Free | ||||
+
Click here to create a new card
+
+
45 script.js
@@ -0,0 +1,45 @@
+window.onload = initAll;
+var usedNums = new Array(76);
+
+function initAll() {
- if (document.getElementById) {
- document.getElementById(“reload”).onclick = anotherCard;
- newCard();
- }
- else{
- alert(“Your browser does not support this script.”);
- }
+}
+function newCard() {
- for(var i=0 ; i<24 ; i++){
- setSquare(i);
- }
+}
+function setSquare(thisSquare){
- var currentSquare = “square” + thisSquare;
- var colPlace = new Array(0,1,2,3,4,0,1,2,3,4,0,1,3,4,0,1,2,3,4,0,1,2,3,4);
- var colBasis = colPlace[thisSquare] * 15;
- var newNum = colBasis + getNewNum() + 1;
- do{
- newNum = colBasis + getNewNum() + 1;
- }while(usedNums[newNum]);
- usedNums[newNum] = true;
- document.getElementById(currentSquare).innerHTML = newNum;
+}
+function getNewNum() {
- return Math.floor(Math.random() * 15);
+}
+function anotherCard() {
- for (var i = 1; i < usedNums.length; i++) {
- usedNums = false;
+ };
+
+ newCard();
+ return false;
+}