mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 21:57:00 +02:00
change Agent to Script
This commit is contained in:
parent
8b2f185937
commit
f41d2a3c02
1 changed files with 5 additions and 4 deletions
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
var iteration = 0;
|
var iteration = 0;
|
||||||
|
|
||||||
|
var itemLifetimes = 60;
|
||||||
var gameAt = { x: 10, y: 0, z: 10 };
|
var gameAt = { x: 10, y: 0, z: 10 };
|
||||||
var gameSize = { x: 10, y: 20, z: 1 };
|
var gameSize = { x: 10, y: 20, z: 1 };
|
||||||
var middleX = gameAt.x + (gameSize.x/2);
|
var middleX = gameAt.x + (gameSize.x/2);
|
||||||
|
@ -40,7 +41,7 @@ function initializeMyShip() {
|
||||||
damping: 0,
|
damping: 0,
|
||||||
radius: shipSize,
|
radius: shipSize,
|
||||||
color: { red: 0, green: 255, blue: 0 },
|
color: { red: 0, green: 255, blue: 0 },
|
||||||
lifetime: 60 * 5 // 5 minutes
|
lifetime: itemLifetimes
|
||||||
};
|
};
|
||||||
myShip = Particles.addParticle(myShipProperties);
|
myShip = Particles.addParticle(myShipProperties);
|
||||||
}
|
}
|
||||||
|
@ -62,7 +63,7 @@ function initializeInvaders() {
|
||||||
damping: 0,
|
damping: 0,
|
||||||
radius: shipSize,
|
radius: shipSize,
|
||||||
color: { red: 255, green: 0, blue: 0 },
|
color: { red: 255, green: 0, blue: 0 },
|
||||||
lifetime: 60 * 5 // 5 minutes
|
lifetime: itemLifetimes
|
||||||
});
|
});
|
||||||
|
|
||||||
print("invaders[row][column].creatorTokenID=" + invaders[row][column].creatorTokenID);
|
print("invaders[row][column].creatorTokenID=" + invaders[row][column].creatorTokenID);
|
||||||
|
@ -101,7 +102,7 @@ function update() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// register the call back so it fires before each data send
|
// register the call back so it fires before each data send
|
||||||
Agent.willSendVisualDataCallback.connect(update);
|
Script.willSendVisualDataCallback.connect(update);
|
||||||
|
|
||||||
function endGame() {
|
function endGame() {
|
||||||
print("ending game...");
|
print("ending game...");
|
||||||
|
@ -118,7 +119,7 @@ function endGame() {
|
||||||
if (missileFired) {
|
if (missileFired) {
|
||||||
Particles.deleteParticle(myMissile);
|
Particles.deleteParticle(myMissile);
|
||||||
}
|
}
|
||||||
Agent.stop();
|
Script.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
function moveShipTo(position) {
|
function moveShipTo(position) {
|
||||||
|
|
Loading…
Reference in a new issue