ソースを参照

Upgraded renderer

tags/v0.1.4^2
Big Bad Waffle 7年前
コミット
4d629e890e
11個のファイルの変更1161行の追加1209行の削除
  1. バイナリ
     
  2. バイナリ
     
  3. +4
    -0
      src/client/js/components/components.js
  4. +0
    -2
      src/client/js/components/mouseMover.js
  5. +15
    -6
      src/client/js/components/stats.js
  6. +835
    -834
      src/client/js/rendering/renderer.js
  7. +3
    -1
      src/client/js/resources.js
  8. +68
    -13
      src/server/config/maps/cave/map.json
  9. +0
    -58
      src/server/config/maps/cave/zone.js
  10. +235
    -294
      src/server/config/maps/tutorial/map.json
  11. +1
    -1
      src/server/world/map.js

バイナリ
ファイルの表示


バイナリ
ファイルの表示


+ 4
- 0
src/client/js/components/components.js ファイルの表示

@@ -8,6 +8,7 @@ var components = [
'bumpAnimation',
'animation',
'light',
'lightPatch',
'projectile',
'particles',
'explosion',
@@ -41,6 +42,9 @@ define(components, function() {

return {
getTemplate: function(type) {
if (type == 'lightpatch')
type = 'lightPatch';
return templates[type];
}
};

+ 0
- 2
src/client/js/components/mouseMover.js ファイルの表示

@@ -35,8 +35,6 @@ define([
layerName: 'effects',
x: 0,
y: 0,
w: scale,
h: scale,
sheetName: 'ui',
cell: 7
});


+ 15
- 6
src/client/js/components/stats.js ファイルの表示

@@ -12,6 +12,9 @@ define([

values: null,

hpSprite: null,
hpSpriteInner: null,

init: function(blueprint) {
if (this.obj.self)
events.emit('onGetStats', this.values);
@@ -28,19 +31,19 @@ define([

this.hpSprite = renderer.buildRectangle({
layerName: 'effects',
x: 0,
y: 0,
x: obj.x * scale,
y: obj.y * scale,
w: 1,
h: 1,
color: 0x802343
});

renderer.buildRectangle({
this.hpSpriteInner = renderer.buildRectangle({
x: 0,
y: 0,
w: 1,
h: 1,
parent: this.hpSprite,
layerName: 'effects',
color: 0xd43346
});

@@ -66,14 +69,15 @@ define([
});

renderer.moveRectangle({
sprite: this.hpSprite.children[0],
sprite: this.hpSpriteInner,
x: x + 4,
y: y,
w: (this.values.hp / this.values.hpMax) * (scale - 8),
h: 5
});

this.hpSprite.visible = true;//(this.values.hp < this.values.hpMax);
this.hpSprite.visible = (this.values.hp < this.values.hpMax);
this.hpSpriteInner.visible = this.hpSprite.visible;
},

extend: function(blueprint) {
@@ -100,6 +104,11 @@ define([
sprite: this.hpSprite,
layerName: 'effects'
});

renderer.destroyObject({
sprite: this.hpSpriteInner,
layerName: 'effects'
});
}
};
});

+ 835
- 834
src/client/js/rendering/renderer.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 3
- 1
src/client/js/resources.js ファイルの表示

@@ -24,7 +24,9 @@ define([
'sprites',
'animChar',
'animMob',
'animBoss'
'animBoss',
'white',
'ray'
],
sprites: {},
ready: false,


+ 68
- 13
src/server/config/maps/cave/map.json ファイルの表示

@@ -901,6 +901,73 @@
"x":0,
"y":0
},
{
"draworder":"topdown",
"name":"clientObjects",
"objects":[
{
"height":64,
"id":797,
"name":"lightpatch",
"properties":
{
"cpnLightPatch":"{\"color\":\"ffff00\"}"
},
"propertytypes":
{
"cpnLightPatch":"string"
},
"rotation":0,
"type":"",
"visible":true,
"width":72,
"x":568,
"y":1264
},
{
"height":24,
"id":798,
"name":"lightpatch",
"properties":
{
"cpnLightPatch":"{\"color\":\"ffff00\"}"
},
"propertytypes":
{
"cpnLightPatch":"string"
},
"rotation":0,
"type":"",
"visible":true,
"width":24,
"x":696,
"y":1272
},
{
"height":16,
"id":799,
"name":"lightpatch",
"properties":
{
"cpnLightPatch":"{\"color\":\"ffff00\"}"
},
"propertytypes":
{
"cpnLightPatch":"string"
},
"rotation":0,
"type":"",
"visible":true,
"width":16,
"x":560,
"y":1336
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
},
{
"draworder":"topdown",
"name":"objects",
@@ -1469,18 +1536,6 @@
"x":712,
"y":1176
},
{
"gid":377,
"height":8,
"id":789,
"name":"sunlight",
"rotation":0,
"type":"",
"visible":true,
"width":8,
"x":600,
"y":1296
},
{
"gid":382,
"height":8,
@@ -1511,7 +1566,7 @@
"x":0,
"y":0
}],
"nextobjectid":794,
"nextobjectid":800,
"orientation":"orthogonal",
"properties":
{


+ 0
- 58
src/server/config/maps/cave/zone.js ファイルの表示

@@ -296,64 +296,6 @@ module.exports = {
}
}
},
sunlight: {
components: {
cpnParticles: {
simplify: function() {
return {
type: 'particles',
blueprint: {
color: {
start: ['fff7b2', 'fff7b2'],
end: ['fff7b2', 'fff7b2']
},
scale: {
start: {
min: 400,
max: 400
},
end: {
min: 400,
max: 400
}
},
speed: {
start: {
min: 0,
max: 0
},
end: {
min: 0,
max: 0
}
},
lifetime: {
min: 12,
max: 40
},
alpha: {
start: 0.75,
end: 0.75
},
maxParticles: 1,
randomScale: true,
randomSpeed: true,
chance: 0.02,
randomColor: true,
spawnType: 'rect',
blendMode: 'overlay',
spawnRect: {
x: 0,
y: 0,
w: 0,
h: 0
}
}
}
}
}
}
},
bubbles: {
components: {
cpnParticles: {


+ 235
- 294
src/server/config/maps/tutorial/map.json
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 1
- 1
src/server/world/map.js ファイルの表示

@@ -319,7 +319,7 @@ define([
if ((this.zone) && (this.zone.objects) && (this.zone.objects[objZoneName.toLowerCase()]))
extend(true, blueprint, this.zone.objects[objZoneName.toLowerCase()]);

if ((blueprint.properties.cpnNotice) || (layerName == 'rooms') || (layerName == 'hiddenRooms')) {
if ((blueprint.properties.cpnNotice) || (blueprint.properties.cpnLightPatch) || (layerName == 'rooms') || (layerName == 'hiddenRooms')) {
blueprint.y++;
blueprint.width = cell.width / mapScale;
blueprint.height = cell.height / mapScale;


読み込み中…
キャンセル
保存