Browse Source

pixely light shafts

tags/v0.1.4^2
Shaun 7 years ago
parent
commit
9d4ae176ad
4 changed files with 90 additions and 5 deletions
  1. BIN
     
  2. +1
    -1
      src/client/index.html
  3. +29
    -1
      src/client/js/components/lightPatch.js
  4. +60
    -3
      src/server/config/maps/cave/map.json

BIN
View File


+ 1
- 1
src/client/index.html View File

@@ -1,7 +1,7 @@
<!doctype html>
<html>
<head>
<title>isleward</title>
<title>GEARED - Login</title>
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
<script src="js/system/addons.js"></script>
<script src="plugins/require.js" data-main="js/app"></script>


+ 29
- 1
src/client/js/components/lightPatch.js View File

@@ -45,7 +45,7 @@ define([
}
}

var rCount = (obj.width * obj.height) / 11;
/*var rCount = (obj.width * obj.height) / 11;
for (var i = 0; i < rCount; i++) {
var nx = x + ~~(Math.random() * obj.width) + 2;
var ny = y + ~~(Math.random() * obj.height) - (obj.height / 3);
@@ -71,6 +71,34 @@ define([
sprite.pluginName = 'picture';

this.sprites.push(ray);
}*/

var rCount = (obj.width * obj.height) / 11;
for (var i = 0; i < rCount; i++) {
var nx = x + ~~(Math.random() * obj.width);
var ny = y + ~~(Math.random() * (obj.height)) - (obj.height / 2);
var w = 1 + ~~(Math.random() * 2);
var h = (obj.height / 4) + ~~(Math.random() * obj.height * 3);
var hm = 2;

for (var j = 0; j < h; j++) {
var ray = renderer.buildObject({
x: nx,
y: ny,
cell: 0,
sheetName: 'white',
layerName: 'lightBeams'
});
ray.x = ~~((nx * scale) - (scaleMult * j));
ray.y = (ny * scale) + (scaleMult * j * hm);
ray.alpha = ((1.0 - (j / h)) * 0.45) * (0.5 + (Math.random() * 0.5));
ray.width = w * scaleMult;
ray.height = scaleMult * hm;
ray.tint = 0xffeb38;
ray.blendMode = PIXI.BLEND_MODES.ADD;

this.sprites.push(ray);
}
}
},



+ 60
- 3
src/server/config/maps/cave/map.json View File

@@ -897,7 +897,7 @@
}],
"opacity":1,
"type":"objectgroup",
"visible":false,
"visible":true,
"x":0,
"y":0
},
@@ -961,10 +961,67 @@
"width":16,
"x":560,
"y":1336
},
{
"height":56,
"id":800,
"name":"lightpatch",
"properties":
{
"cpnLightPatch":"{\"color\":\"ffff00\"}"
},
"propertytypes":
{
"cpnLightPatch":"string"
},
"rotation":0,
"type":"",
"visible":true,
"width":48,
"x":1040,
"y":496
},
{
"height":32,
"id":801,
"name":"lightpatch",
"properties":
{
"cpnLightPatch":"{\"color\":\"ffff00\"}"
},
"propertytypes":
{
"cpnLightPatch":"string"
},
"rotation":0,
"type":"",
"visible":true,
"width":32,
"x":1072,
"y":432
},
{
"height":40,
"id":802,
"name":"lightpatch",
"properties":
{
"cpnLightPatch":"{\"color\":\"ffff00\"}"
},
"propertytypes":
{
"cpnLightPatch":"string"
},
"rotation":0,
"type":"",
"visible":true,
"width":40,
"x":696,
"y":1136
}],
"opacity":1,
"type":"objectgroup",
"visible":false,
"visible":true,
"x":0,
"y":0
},
@@ -1566,7 +1623,7 @@
"x":0,
"y":0
}],
"nextobjectid":800,
"nextobjectid":803,
"orientation":"orthogonal",
"properties":
{


Loading…
Cancel
Save