Adjust wait times between casts
This commit is contained in:
parent
0e4aa53353
commit
c09951dcf2
11
js/magic.js
11
js/magic.js
@ -176,15 +176,16 @@ window.onload = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if enough time has passed, cast another spell to draw
|
// if enough time has passed, cast another spell to draw
|
||||||
if (waitTime <= 500 && (timeCounter - lastCast) >= waitTime) {
|
if (timeCounter <= 15000 && (timeCounter - lastCast) >= waitTime) {
|
||||||
if (waitTime === 50) {
|
if (waitTime === 50) {
|
||||||
waitTime = 100;
|
waitTime = 200;
|
||||||
} else {
|
} else if (waitTime < 300) {
|
||||||
waitTime = waitTime * 1.1;
|
waitTime = waitTime * 1.1;
|
||||||
}
|
}
|
||||||
|
console.log(waitTime);
|
||||||
|
|
||||||
lastCast = timeCounter;
|
lastCast = timeCounter;
|
||||||
if (waitTime === 100) {
|
if (waitTime === 200) {
|
||||||
cast(5, 5, 270); // start position
|
cast(5, 5, 270); // start position
|
||||||
} else {
|
} else {
|
||||||
cast(undefined, undefined, undefined); // random spell position
|
cast(undefined, undefined, undefined); // random spell position
|
||||||
@ -256,8 +257,6 @@ window.onload = function () {
|
|||||||
|
|
||||||
// Initialize canvas
|
// Initialize canvas
|
||||||
var dimensions = getDocumentDimensions();
|
var dimensions = getDocumentDimensions();
|
||||||
console.log(dimensions.height);
|
|
||||||
console.log(dimensions.width);
|
|
||||||
canvas.height = dimensions.height;
|
canvas.height = dimensions.height;
|
||||||
canvas.width = dimensions.width;
|
canvas.width = dimensions.width;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user