Skip to content

Commit

Permalink
new change
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchitrathore2004 committed May 22, 2024
1 parent d8b8775 commit 1cdd374
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 40 deletions.
72 changes: 72 additions & 0 deletions bullet.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { arr, posPiece } from "./scriptAll.js";
import { classTitle } from "./supportScript.js";

let bulletsred=[];
let bulletsaqua=[];
let canonClass;
let colorSplit;
let canonColor;
var IDR;
var IDA;
let identify;

export function bullet () {
for(let i=0;i<arr.length;i++)
{
if(arr[i] && arr[i].innerHTML=="CANON")
{
canonClass=arr[i].className;
colorSplit=canonClass.split(" ");
canonColor=colorSplit[2];
if(canonColor=="red")
{
IDR=i;
bulletsred=[arr[IDR+8],arr[IDR+16],arr[IDR+24],arr[IDR+32],arr[IDR+40],arr[IDR+48],arr[IDR+56]];
}
else if (canonColor=="aqua")
{
IDA=i;
bulletsaqua=[arr[IDA-8],arr[IDA-16],arr[IDA-24],arr[IDA-32],arr[IDA-40],arr[IDA-48],arr[IDA-56]];
}
}
}
console.log(bulletsaqua);
console.log(bulletsred);
console.log(classTitle);
identify=classTitle.split(" ");
if(identify[2]=="red")
{
for (let i=0;i<bulletsred.length;i++) {
setTimeout(() => {
if(i>0)
{
bulletsred[i-1].innerHTML="";
}
bulletsred[i].innerHTML=".";
bulletsred[i].style.fontSize="60px";
if(i==(bulletsred.length-1))
{
bulletsred[i].innerHTML="";
}
},i*200);
}
}
else if(identify[2]=="aqua")
{
for (let i=0;i<bulletsaqua.length;i++) {
setTimeout(() => {
if(i>0)
{
bulletsaqua[i-1].innerHTML="";
}
bulletsaqua[i].innerHTML=".";
bulletsaqua[i].style.fontSize="60px";
if(i==(bulletsaqua.length-1))
{
console.log("aarha h");
bulletsaqua[i].innerHTML="";
}
},i*200);
}
}
}
Binary file added bullet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 0 additions & 37 deletions rules.js

This file was deleted.

1 change: 0 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@
.rico{
visibility: visible;
}

@media screen and (min-width:320px) and (max-width:425px){
.playspace{
width: 59vh;
Expand Down
7 changes: 5 additions & 2 deletions supportScript.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { bullet } from "./bullet.js";
import { arr, callFunc, posPiece, rotation, rotateObjLeft, rotateObjRight } from "./scriptAll.js";
let red=[];
let aqua=[];
Expand All @@ -7,7 +8,7 @@ let j=0;
let brr=[];
let ID;
let html;
let classTitle;
export let classTitle;
let colour;
export let colarr;
let crr = [];
Expand Down Expand Up @@ -52,7 +53,6 @@ if(colarr[1]=="semirico" || colarr[1]=="rico")
CID=CID.slice(3,5);
CID = parseInt(CID);
crr[i]=CID;

}
}
console.log(crr);
Expand Down Expand Up @@ -144,6 +144,7 @@ for (let i=0;i<brr.length;i++) {
removeTankListener(this);
callFunc();
switchTurn();
bullet();

}

Expand Down Expand Up @@ -196,6 +197,8 @@ for (let i=0;i<brr.length;i++) {
}
}
arr[ID].style.backgroundColor=`${colour}`;
switchTurn();
bullet();
}


Expand Down

0 comments on commit 1cdd374

Please sign in to comment.