102 lines
2.9 KiB
JavaScript
102 lines
2.9 KiB
JavaScript
"use strict";
|
|
|
|
const Values = (function(){
|
|
|
|
const Values = function(xgravity){
|
|
|
|
const self = this;
|
|
|
|
// XGravity
|
|
this.cells = 40;
|
|
this.quality = 100;
|
|
this.position = "body";
|
|
this.class_name = "xgravity";
|
|
this.fps = 60;
|
|
|
|
// Background stars
|
|
this.bg_stars_count = 140;
|
|
this.bg_stars_size_minimum = .5;
|
|
this.bg_stars_size_maximum = 2.2;
|
|
this.bg_stars_speed_minimum = .1;
|
|
this.bg_stars_speed_maximum = .6;
|
|
this.bg_stars_direction_x = 0;
|
|
this.bg_stars_direction_y = 1;
|
|
this.bg_stars_color = "rgba(186, 230, 253, {alpha})";
|
|
|
|
// Background image
|
|
this.bg_image_url = "";
|
|
this.bg_image_pan_x = 5;
|
|
this.bg_image_pan_y = 2;
|
|
|
|
// Background procedural
|
|
this.bg_procedural_oversize = 1.5;
|
|
this.bg_procedural_far_stars = {
|
|
probablity : .96,
|
|
size : [.2, .7],
|
|
images : [
|
|
"images/game/Far-Star-1.webp",
|
|
"images/game/Far-Star-2.webp",
|
|
"images/game/Far-Star-3.webp"
|
|
]
|
|
};
|
|
this.bg_procedural_nebulas = {
|
|
probablity : .87,
|
|
size : [3, 60],
|
|
images : [
|
|
"images/game/Blue-Dust.webp",
|
|
"images/game/Cold-Nebula.webp",
|
|
"images/game/Dust.webp",
|
|
"images/game/Grey-Asteroid-Dust.webp",
|
|
"images/game/Hot-Nebula.webp",
|
|
"images/game/Violet-Dust.webp",
|
|
"images/game/Yellow-Dust.webp"
|
|
]
|
|
};
|
|
this.bg_procedural_near_stars = {
|
|
probablity : .21,
|
|
size : [.5, 1.7],
|
|
images : [
|
|
"images/game/Layer.webp",
|
|
"images/game/Layer2.webp"
|
|
],
|
|
};
|
|
this.bg_procedural_suns = {
|
|
probablity : .32,
|
|
timer : [2, 10],
|
|
size : [10, 50],
|
|
images : [
|
|
"images/game/Sun.fixed.webp",
|
|
"images/game/Red-Giant.webp"
|
|
],
|
|
}
|
|
this.bg_procedural_planets = {
|
|
probablity : .17,
|
|
size : [7, 30],
|
|
images : [
|
|
"images/game/Ice-Giant.webp",
|
|
"images/game/Gas-Giant.webp",
|
|
"images/game/Exoplanet3.webp",
|
|
"images/game/Exoplanet2.webp",
|
|
"images/game/Exoplanet.webp"
|
|
]
|
|
};
|
|
|
|
// Audio
|
|
this.audio_samples = 44100;
|
|
this.audio_default_amount = 20;
|
|
|
|
this.set = () => {
|
|
Object.keys(self).forEach(key => {
|
|
if(!["set"].includes(key))
|
|
self[key] = xgravity.settings.get(key, null, self[key]);
|
|
});
|
|
};
|
|
|
|
// Enemies
|
|
this.enemy_overflight_initial_scale = 20;
|
|
this.enemy_overflight_scale_speed = 1.8;
|
|
|
|
};
|
|
|
|
return Values;
|
|
})(); |