More Settings
This commit is contained in:
@ -92,7 +92,7 @@ function createEntity(x, y, vx, vy, ax, ay, rot, rotv, type, id=0, iframes=Math.
|
|||||||
function getRandomType(){
|
function getRandomType(){
|
||||||
let rand = Math.random();
|
let rand = Math.random();
|
||||||
if (rand > 0.955){
|
if (rand > 0.955){
|
||||||
console.log("Comet made");
|
if(Settings.devMode) console.log("Comet made");
|
||||||
return entityTypes.COMET;
|
return entityTypes.COMET;
|
||||||
}if(rand > 0.4){
|
}if(rand > 0.4){
|
||||||
return entityTypes.METERORITE_SMALL;
|
return entityTypes.METERORITE_SMALL;
|
||||||
@ -192,7 +192,7 @@ function setup(){
|
|||||||
worldScale = createSlider();
|
worldScale = createSlider();
|
||||||
//Load Entities
|
//Load Entities
|
||||||
|
|
||||||
for(var i = 0; i <= entityCount; i+=1){
|
for(var i = 0; i <= Settings.entityCount; i+=1){
|
||||||
createEntity(
|
createEntity(
|
||||||
Math.floor(Math.random() * windowWidth), //X Location
|
Math.floor(Math.random() * windowWidth), //X Location
|
||||||
Math.floor(Math.random() * windowHeight), //Y Location
|
Math.floor(Math.random() * windowHeight), //Y Location
|
||||||
@ -201,7 +201,7 @@ function setup(){
|
|||||||
0.0, //X Acceleration
|
0.0, //X Acceleration
|
||||||
0.0, //Y Acceleration
|
0.0, //Y Acceleration
|
||||||
0.0, //Current Rotation
|
0.0, //Current Rotation
|
||||||
(Math.random() * 2 *(Math.PI / rotationSpeed))-(Math.PI / rotationSpeed), //Rotation Velocity
|
(Math.random() * 2 *(Math.PI / Settings.rotationSpeed))-(Math.PI / Settings.rotationSpeed), //Rotation Velocity
|
||||||
getRandomType(),
|
getRandomType(),
|
||||||
id=i
|
id=i
|
||||||
);
|
);
|
||||||
@ -247,6 +247,23 @@ function draw(){
|
|||||||
//Draw Entity
|
//Draw Entity
|
||||||
drawEntity(entity);
|
drawEntity(entity);
|
||||||
}
|
}
|
||||||
|
if (Settings.respawn){
|
||||||
|
if(Settings.emptyEntries.length > 5){
|
||||||
|
if(frameCount % 20 == 0){
|
||||||
|
createEntity(
|
||||||
|
Math.floor(Math.random() * windowWidth)+windowHeight, //X Location
|
||||||
|
Math.floor(Math.random() * windowHeight)+windowHeight, //Y Location
|
||||||
|
(Math.random() * maxSpeed * 2)-maxSpeed, //X Velocity
|
||||||
|
(Math.random() * maxSpeed * 2)-maxSpeed, //Y Velocity
|
||||||
|
0.0, //X Acceleration
|
||||||
|
0.0, //Y Acceleration
|
||||||
|
0.0, //Current Rotation
|
||||||
|
(Math.random() * 2 *(Math.PI / rotationSpeed))-(Math.PI / rotationSpeed), //Rotation Velocity
|
||||||
|
getRandomType()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function windowResized() {
|
function windowResized() {
|
||||||
|
|||||||
Reference in New Issue
Block a user