rail gun balance (uses energy now)

This commit is contained in:
landgreen
2020-01-19 07:46:23 -08:00
parent 57126ab42e
commit 33e2a65eb7
4 changed files with 230 additions and 244 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -2,20 +2,6 @@
/* TODO: *******************************************
*****************************************************
show difficulty increase text in custom mode
chart showing info about each mob type
can use css-grid chart like custom mod
add setting for random drops instead of choosing
custom mode
custom mode grey out mods that are bad, like selection based mods
change nail-bot's movement
maybe have it move in a circle around player?
high friction very high acceleration towards circle location
add mouse constraint in testing mode
https://github.com/liabru/matter-js/blob/master/examples/events.js
@@ -199,7 +185,7 @@ const build = {
},
makeGrid() {
let text =
`<div style="display: flex; justify-content: space-around; align-items: center;">
`<div style="display: flex; justify-content: space-evenly; align-items: center;">
<svg class="SVG-button" onclick="build.startBuildRun()" width="105" height="55">
<g stroke='none' fill='#333' stroke-width="2" font-size="40px" font-family="Ariel, sans-serif">
<text x="13" y="40">start</text>
@@ -256,7 +242,7 @@ const build = {
calculateCustomDifficulty() {
let difficulty = build.list.length * game.difficultyMode
if (game.difficultyMode === 0) difficulty = build.list.length * 1 - 6
document.getElementById("starting-level").innerHTML = `starting level: <strong style="font-size:1.1em;">${difficulty}</strong>`
document.getElementById("starting-level").innerHTML = `starting level: <strong style="font-size:1.05em;">${difficulty}</strong>`
},
startBuildRun() {
spawn.setSpawnList();
@@ -291,6 +277,7 @@ document.getElementById("build-button").addEventListener("click", () => {
document.getElementById("info").style.display = 'inline'
} else {
build.list = []
build.reset()
// let text = '<p>The difficulty increases by one level for each power up you choose.<br> <button type="button" id="build-begin-button" onclick="build.startBuildRun()">Begin Run</button></p>'
build.isShowingBuilds = true
el.style.display = "grid"

View File

@@ -14,12 +14,9 @@ const level = {
start() {
if (level.levelsCleared === 0) {
// game.difficulty = 6; //for testing to simulate possible mobs spawns
// b.giveGuns(10)
// b.giveGuns(13)
// mech.setField(3)
// b.giveMod(11);
// b.giveMod(11);
// b.giveMod(10);
// b.giveMod(11);
// b.giveMod(6);
level.intro(); //starting level
// level.testingMap();

View File

@@ -1013,7 +1013,8 @@ const mobs = {
},
//replace dead mob with a regular body
replace(i) {
if (this.leaveBody) {
//large mobs or too many bodies go intangible and fall until removed from game to help performance
if (this.leaveBody && this.mass < 10 && body.length < 50) {
const len = body.length;
body[len] = Matter.Bodies.fromVertices(this.position.x, this.position.y, this.vertices);
Matter.Body.setVelocity(body[len], this.velocity);
@@ -1021,10 +1022,9 @@ const mobs = {
body[len].collisionFilter.category = cat.body;
body[len].collisionFilter.mask = cat.player | cat.map | cat.body | cat.bullet | cat.mob | cat.mobBullet;
//large mobs or too many bodies go intangible and fall until removed from game to help performance
if (body[len].mass > 10 || 45 + 10 * Math.random() < body.length) {
body[len].collisionFilter.mask = cat.player | cat.bullet | cat.mob | cat.mobBullet;
}
// if (body[len].mass > 10 || 45 + 10 * Math.random() < body.length) {
// body[len].collisionFilter.mask = cat.player | cat.bullet | cat.mob | cat.mobBullet;
// }
body[len].classType = "body";
World.add(engine.world, body[len]); //add to world
}