Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
AleziaKurdis committed Sep 8, 2024
1 parent 9d41d8c commit 088d2bd
Showing 1 changed file with 7 additions and 96 deletions.
103 changes: 7 additions & 96 deletions FACING-WORLDS/AC_ctfGameManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,104 +620,18 @@ function updatePlayersList() {
}
}

/*
function killPlayer(avatarID, ghostNo, deathPosition) {
var playerNo = getPlayerNoFromSessionID(avatarID);
var message;
if (playerNo === -1 || gameStatus === "NOT_STARTED") {
message = {
"action": "TELEPORT_USER",
"avatarID": avatarID,
"position": determineExitGameToPosition(),
"orientation": Quat.fromVec3Degrees({"x": 0, "y": (Math.random() * 360), "z": 0})
};
Messages.sendMessage(channelComm, JSON.stringify(message));
} else {
var tpPosition;
var isGameEnded = false;
if (life === 0) {
players[playerNo].state = "DEAD";
tpPosition = determineExitGameToPosition();
if (isAllPlayerDead()) {
endGame();
isGameEnded = true;
}
} else {
players[playerNo].state = "ALIVE";
tpPosition = determinePlayerInitialPosition();
}
life = life - 1;
if (life < 0) {
life = 0;
}
if (!isGameEnded) {
message = {
"action": "LIFE_COUNT_UPDATE",
"life": life
};
Messages.sendMessage(channelComm, JSON.stringify(message));
}
message = {
"action": "TELEPORT_USER",
"avatarID": avatarID,
"position": tpPosition,
"orientation": Quat.fromVec3Degrees({"x": 0, "y": (Math.random() * 360), "z": 0})
};
Messages.sendMessage(channelComm, JSON.stringify(message));
playSound(SOUND_AVATAR_KILLED, deathPosition, 1);
if (!isGameEnded) {
var properties = Entities.getEntityProperties(ghost[ghostNo].id, ["velocity", "position"]);
var ghostVelocity = properties.velocity;
var ghostPosition = properties.position;
Entities.deleteEntity(ghost[ghostNo].id);
ghost[ghostNo].id = Entities.addEntity({
"name": "VOXECUTOR-" + (ghostNo + 1),
"description": ghostNo,
"type": "Model",
"modelURL": getHunterModel(ghostNo + 1),
"useOriginalPivot": true,
"shapeType": "box",
"dimensions": {"x": GRID_POINT_SIDE_SIZE, "y": GRID_POINT_SIDE_SIZE, "z": GRID_POINT_SIDE_SIZE},
"position": ghostPosition,
"grab": {
"grabbable": false
},
"collisionless": true,
"dynamic": true,
"damping": 0,
"friction": 0,
"script": ROOT + "attackMode.js",
"velocity": ghostVelocity,
"lifetime": LIFE_TIME_ANTI_JUNK,
"billboardMode": "none",
"angularDamping": 0,
"angularVelocity": {"x": 0, "y": 10, "z": 0},
"renderWithZones": visibilityZone
}, "domain");
}
ejectBones(deathPosition);
message = {
"action": "I_DIED",
"avatarID": avatarID
};
Messages.sendMessage(channelComm, JSON.stringify(message));
}
}
function ejectBones(position){
for (var i = 0; i < 40; i++) {
var i;
playSound(SOUND_AVATAR_KILLED, position, 1);
for (i = 0; i < 40; i++) {
var ejectionBoneVelocity = {"x": (Math.random() * 10)-5, "y": (Math.random() * 10)-5, "z": (Math.random() * 10)-5};
var angularBoneVelocity = {"x": (Math.random() * 6)-3, "y": (Math.random() * 6)-3, "z": (Math.random() * 6)-3};
var boneScale = 0.9 + (Math.random() * 1.4);
if (Math.random() > 0.7) {
boneID = Entities.addEntity({
"name": "AVATAR-BONE",
"type": "Model",
"modelURL": ROOT + "AVATAR_BONE.fbx",
"modelURL": ROOT + "models/AVATAR_BONE.fbx",
"useOriginalPivot": false,
"shapeType": "box",
"dimensions": Vec3.multiply({"x": 0.035, "y": 0.2, "z": 0.035}, boneScale),
Expand All @@ -731,8 +645,7 @@ function ejectBones(position){
"friction": 0.3,
"angularVelocity": angularBoneVelocity,
"velocity": ejectionBoneVelocity,
"lifetime": 20 + (Math.floor(Math.random() * 21)),
"renderWithZones": visibilityZone
"lifetime": 20 + (Math.floor(Math.random() * 21))
}, "domain");
} else {
boneID = Entities.addEntity({
Expand All @@ -755,13 +668,11 @@ function ejectBones(position){
"friction": 0.3,
"angularVelocity": angularBoneVelocity,
"velocity": ejectionBoneVelocity,
"lifetime": 10 + (Math.floor(Math.random() * 8)),
"renderWithZones": visibilityZone
}, "domain");
"lifetime": 10 + (Math.floor(Math.random() * 8))
}, "domain");
}
}
}
*/

function clearGuns() {
var i;
Expand Down

0 comments on commit 088d2bd

Please sign in to comment.