Преглед изворни кода

added noise factor to login bg renderer

tags/v0.8.0
Shaun пре 3 година
родитељ
комит
1eb32839fa
2 измењених фајлова са 9 додато и 9 уклоњено
  1. +7
    -8
      src/client/js/rendering/renderLoginBackground.js
  2. +2
    -1
      src/client/ui/templates/login/styles.less

+ 7
- 8
src/client/js/rendering/renderLoginBackground.js Прегледај датотеку

@@ -2,9 +2,6 @@ define([
], function (

) {
//5 3 4 53
//6 0 1 54
//5 53 brighter
let mRandom = Math.random.bind(Math);

const renderLoginBackground = renderer => {
@@ -18,13 +15,15 @@ define([
let w = Math.ceil(width / scale) + 1;
let h = Math.ceil(height / scale) + 1;

const midX = (w / 2) - 1;
const midY = (h / 2) - 2;
const midX = ~~(w / 2);
const midY = ~~(h / 2);

const rGrass = 10;
const rBeach = 2;
const rShallow = 3;

const noiseFactor = 3;

let container = layers.tileSprites;

for (let i = 0; i < w; i++) {
@@ -32,11 +31,11 @@ define([
let tile = 5;

let distance = Math.sqrt(Math.pow(i - midX, 2) + Math.pow(j - midY, 2));
if (distance < rGrass + (Math.random() * 3))
if (distance < rGrass + (Math.random() * noiseFactor))
tile = 3;
else if (distance < rGrass + rBeach + (Math.random() * 3))
else if (distance < rGrass + rBeach + (Math.random() * noiseFactor))
tile = 4;
else if (distance < rGrass + rBeach + rShallow + (Math.random() * 2))
else if (distance < rGrass + rBeach + rShallow + (Math.random() * noiseFactor))
tile = 53;

let alpha = mRandom();


+ 2
- 1
src/client/ui/templates/login/styles.less Прегледај датотеку

@@ -107,7 +107,7 @@
}

&:hover {
background-color: @blueB;
background-color: @blueD;
}

}
@@ -147,6 +147,7 @@
padding-right: 10px;
background-color: @brownC;
color: @white;
filter: drop-shadow(0 -2px 0 #312136) drop-shadow(0 2px 0 #312136) drop-shadow(2px 0 0 #312136) drop-shadow(-2px 0 0 #312136);

+ .btn {
margin-left: 20px;


Loading…
Откажи
Сачувај