scheme
This commit is contained in:
parent
d4c28ee1d6
commit
1d8f52dcfe
|
@ -10,6 +10,7 @@ class Levels
|
|||
@dict = {}
|
||||
@list = [
|
||||
# "test",
|
||||
"electro",
|
||||
# --- introduction
|
||||
"steps",
|
||||
"start",
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
|
||||
# 0000000 000 0000000 0000000 000 000 0000000
|
||||
# 000 000 000 000 000 000 000 000 000
|
||||
# 0000000 000 000 000 000 0000000 0000000
|
||||
# 000 000 000 000 000 000 000 000 000
|
||||
# 0000000 0000000 0000000 0000000 000 000 0000000
|
||||
|
||||
module.exports =
|
||||
name: "blocks"
|
||||
design: 'Michael Abel'
|
||||
|
@ -17,18 +23,18 @@ module.exports =
|
|||
player:
|
||||
coordinates: [1,6,2]
|
||||
exits: [
|
||||
name: "exit"
|
||||
active: 1
|
||||
coordinates: [7,9,2]
|
||||
]
|
||||
name: "exit"
|
||||
active: 1
|
||||
coordinates: [7,9,2]
|
||||
]
|
||||
create: ->
|
||||
{Stone} = require '../items'
|
||||
world.addObjectAtPos 'Wall', 1,1,2
|
||||
world.addObjectAtPos 'Wall', 4,2,2
|
||||
world.addObjectAtPos 'Wall', 7,2,2
|
||||
world.addObjectAtPos 'Stone', 10,2,2
|
||||
world.addObjectAtPos new Stone(slippery:true), 13,2,2
|
||||
world.addObjectAtPos new Stone(slippery:true), 15,4,2
|
||||
world.addObjectAtPos new Stone(slippery: true), 13,2,2
|
||||
world.addObjectAtPos new Stone(slippery: true), 15,4,2
|
||||
|
||||
world.addObjectAtPos new Stone(color: [0,1,0], opacity: 0.8, slippery: true), 13,7,2
|
||||
world.addObjectAtPos new Stone(color: [1,0,0], opacity: 0.8, slippery: true), 10,7,2
|
||||
|
|
|
@ -13,26 +13,23 @@ class Light extends Item
|
|||
@radius = opt?.radius ? 4
|
||||
@shadow = opt?.shadow ? false
|
||||
@intensity = opt?.intensity ? 0.5
|
||||
# @ambient_color = colors[KikiLight_base_color]
|
||||
# @diffuse_color = colors[KikiLight_diffuse_color]
|
||||
# @specular_color = colors[KikiLight_specular_color]
|
||||
world.addLight @
|
||||
super
|
||||
@setPosition opt.pos if opt?.pos?
|
||||
|
||||
createMesh: ->
|
||||
@point = new THREE.PointLight 0xffffff, @intensity, @radius, 2
|
||||
@point.castShadow = @shadow
|
||||
@point.shadow.darkness = 0.5
|
||||
@point.shadow.mapSize = new THREE.Vector2 2048, 2048
|
||||
@point.shadow.bias = 0.01
|
||||
geom = new THREE.SphereGeometry 0.3, 16, 16
|
||||
|
||||
# world.scene.add new THREE.CameraHelper @point.shadow.camera if @shadow
|
||||
|
||||
@point.shadow.camera.near = 0.1
|
||||
@point.shadow.camera.far = @radius*2
|
||||
|
||||
@mesh = new THREE.Mesh geom, Material.bulb
|
||||
world.scene.add @point
|
||||
world.addLight @
|
||||
@setPosition opt.pos if opt?.pos?
|
||||
super
|
||||
|
||||
del: ->
|
||||
world.removeLight @
|
||||
|
|
|
@ -12,8 +12,14 @@ module.exports =
|
|||
color: 0xffff00
|
||||
id: 999
|
||||
|
||||
bulb: new THREE.MeshLambertMaterial
|
||||
side: THREE.FrontSide
|
||||
shading: THREE.SmoothShading
|
||||
transparent: true
|
||||
opacity: 0.7
|
||||
emissiveIntensity: 0.9
|
||||
|
||||
player: new THREE.MeshPhongMaterial
|
||||
color: 0x2222ff
|
||||
side: THREE.FrontSide
|
||||
shading: THREE.SmoothShading
|
||||
transparent: true
|
||||
|
@ -21,8 +27,6 @@ module.exports =
|
|||
shininess: 5
|
||||
|
||||
tire: new THREE.MeshPhongMaterial
|
||||
color: 0x000066
|
||||
# specular: 0x222255
|
||||
side: THREE.FrontSide
|
||||
shading: THREE.FlatShading
|
||||
transparent: true
|
||||
|
@ -72,15 +76,6 @@ module.exports =
|
|||
shading: THREE.SmoothShading
|
||||
shininess: 10
|
||||
|
||||
bulb: new THREE.MeshLambertMaterial
|
||||
color: 0xffffff
|
||||
side: THREE.FrontSide
|
||||
shading: THREE.SmoothShading
|
||||
transparent: true
|
||||
opacity: 0.7
|
||||
emissive: 0xffff00
|
||||
emissiveIntensity: 0.9
|
||||
|
||||
bomb: new THREE.MeshPhongMaterial
|
||||
color: 0xff0000
|
||||
side: THREE.FrontSide
|
||||
|
@ -102,24 +97,21 @@ module.exports =
|
|||
shininess: 5
|
||||
|
||||
raster: new THREE.MeshPhongMaterial
|
||||
color: 0x880000
|
||||
side: THREE.FrontSide
|
||||
shading: THREE.SmoothShading
|
||||
shininess: 20
|
||||
|
||||
wall: new THREE.MeshPhongMaterial
|
||||
color: 0x770000
|
||||
# color: 0x770000
|
||||
side: THREE.FrontSide
|
||||
shading: THREE.SmoothShading
|
||||
shininess: 10
|
||||
shininess: 20
|
||||
|
||||
plate: new THREE.MeshPhongMaterial
|
||||
color: 0x880000
|
||||
side: THREE.FrontSide
|
||||
shading: THREE.SmoothShading
|
||||
shininess: 10
|
||||
emissive: 0x880000
|
||||
emissiveIntensity: 0.02
|
||||
emissiveIntensity: 0.05
|
||||
|
||||
stone: new THREE.MeshPhongMaterial
|
||||
side: THREE.DoubleSide
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
# 000 000 000 000 000 000 0 000 000
|
||||
# 0000000 0000000 000 000 00000000 000 000 00000000
|
||||
|
||||
rgb = (r,g,b) -> new THREE.Color r,g,b
|
||||
|
||||
module.exports =
|
||||
|
||||
# 0000000 00000000 00000000 0000000 000 000 000 000000000
|
||||
|
@ -14,42 +16,39 @@ module.exports =
|
|||
# 0000000 00000000 000 000 000 0000000 0000000 000
|
||||
|
||||
default:
|
||||
raster:
|
||||
color: [0.5, 0, 0]
|
||||
plate:
|
||||
color: [0.5, 0, 0]
|
||||
color: rgb 0.5, 0, 0
|
||||
wall:
|
||||
color: [0.4, 0, 0]
|
||||
bulb:
|
||||
color: [1, 1, 0]
|
||||
bomb:
|
||||
color: [0.5, 0, 0]
|
||||
specular: rgb 0.16, 0, 0
|
||||
stone:
|
||||
color: [0.5, 0.5, 0.5]
|
||||
switch:
|
||||
color: [0, 0, 0.5]
|
||||
gate:
|
||||
color: [1, 0.5, 0]
|
||||
color: rgb 0.8, 0.5, 0
|
||||
bomb:
|
||||
color: rgb 0.5, 0, 0
|
||||
bulb:
|
||||
color: rgb 1, 0.6, 0
|
||||
player:
|
||||
color: [0.8, 0.4, 0]
|
||||
color: rgb 0x2222ff
|
||||
tire:
|
||||
color: [0.4, 0, 0]
|
||||
color: rgb 0x000066
|
||||
specular: rgb 0x222255
|
||||
switch:
|
||||
color: rgb 0, 0, 0.5
|
||||
gate:
|
||||
color: rgb 1, 0.5, 0
|
||||
mutant:
|
||||
color: [0.5, 0, 0]
|
||||
color: rgb 0.5, 0, 0
|
||||
mutantTire:
|
||||
color: [0, 0, 0.2]
|
||||
color: rgb 0, 0, 0.2
|
||||
text:
|
||||
color: [0.8, 0.8, 0]
|
||||
bright: [1, 1, 0]
|
||||
dark: [0.6, 0.4, 0]
|
||||
color: rgb 0.8, 0.8, 0
|
||||
bright: rgb 1, 1, 0
|
||||
dark: rgb 0.6, 0.4, 0
|
||||
gear:
|
||||
color: [0.1, 0.1, 0.9]
|
||||
valve:
|
||||
color: [0, 0, 0.5]
|
||||
color: rgb 0.1, 0.1, 0.9
|
||||
wire:
|
||||
color: [0.1, 0.1, 0.9]
|
||||
color: rgb 0.1, 0.1, 0.9
|
||||
glow:
|
||||
color: [1, 1, 0]
|
||||
color: rgb 1, 1, 0
|
||||
|
||||
# 000000000 00000000 0000000 000 000
|
||||
# 000 000 000 000 000 0000 000
|
||||
|
@ -58,41 +57,38 @@ module.exports =
|
|||
# 000 000 000 0000000 000 000
|
||||
|
||||
tron:
|
||||
raster:
|
||||
color: [0, 0, 0.3]
|
||||
plate:
|
||||
color: [0.05, 0.05]
|
||||
opacity: 0.2
|
||||
color: rgb 0.05, 0.05, 0.2
|
||||
# raster:
|
||||
# color: rgb 0, 0, 0.3
|
||||
bulb:
|
||||
color: [0, 0, 1]
|
||||
color: rgb 0, 0, 1
|
||||
bomb:
|
||||
color: [0.5, 0, 0]
|
||||
color: rgb 0.5, 0, 0
|
||||
stone:
|
||||
color: [0, 0, 1]
|
||||
color: rgb 0, 0, 1
|
||||
switch:
|
||||
color: [0, 0, 0.5]
|
||||
color: rgb 0, 0, 0.5
|
||||
gate:
|
||||
color: [1, 1, 0]
|
||||
color: rgb 1, 1, 0
|
||||
player:
|
||||
color: [0.5, 0.5, 0.5]
|
||||
color: rgb 0.5, 0.5, 0.5
|
||||
tire:
|
||||
color: [0, 0, 0.5]
|
||||
color: rgb 0, 0, 0.5
|
||||
mutant:
|
||||
color: [0.5, 0, 0]
|
||||
color: rgb 0.5, 0, 0
|
||||
mutantTire:
|
||||
color: [0, 0, 0.2]
|
||||
color: rgb 0, 0, 0.2
|
||||
text:
|
||||
color: [0.8, 0.8, 0]
|
||||
bright: [1, 1, 0]
|
||||
dark: [0.6, 0.4, 0]
|
||||
color: rgb 0.8, 0.8, 0
|
||||
bright: rgb 1, 1, 0
|
||||
dark: rgb 0.6, 0.4, 0
|
||||
gear:
|
||||
color: [0.1, 0.1, 0.9]
|
||||
valve:
|
||||
color: [0, 0, 0.5]
|
||||
color: rgb 0.1, 0.1, 0.9
|
||||
wire:
|
||||
color: [0.1, 0.1, 0.9]
|
||||
color: rgb 0.1, 0.1, 0.9
|
||||
glow:
|
||||
color: [1, 1, 0]
|
||||
color: rgb 1, 1, 0
|
||||
|
||||
# 000 000 00000000 000 000 000000000 00000000 0000000 000 000
|
||||
# 0000 000 000 000 000 000 000 000 000 000 0000 000
|
||||
|
@ -101,41 +97,39 @@ module.exports =
|
|||
# 000 000 00000000 0000000 000 000 000 0000000 000 000
|
||||
|
||||
neutron:
|
||||
raster:
|
||||
color: [0.13, 0.13, 0.13]
|
||||
plate:
|
||||
color: [0.5, 0.5, 0.5]
|
||||
color: rgb 0.5, 0.5, 0.5
|
||||
# raster:
|
||||
# color: rgb 0.13, 0.13, 0.13
|
||||
bulb:
|
||||
color: [0, 0, 0]
|
||||
color: rgb 0, 0, 0
|
||||
bomb:
|
||||
color: [0.5, 0, 0]
|
||||
color: rgb 0.5, 0, 0
|
||||
stone:
|
||||
color: [0.5, 0.5, 0.5]
|
||||
color: rgb 0.5, 0.5, 0.5
|
||||
opacity: 0.5
|
||||
switch:
|
||||
color: [0, 0, 0.5]
|
||||
color: rgb 0, 0, 0.5
|
||||
gate:
|
||||
color: [1, 1, 0]
|
||||
color: rgb 1, 1, 0
|
||||
player:
|
||||
color: [1, 0.5, 0]
|
||||
color: rgb 1, 0.5, 0
|
||||
tire:
|
||||
color: [0.5, 0, 0]
|
||||
color: rgb 0.5, 0, 0
|
||||
mutant:
|
||||
color: [0.5, 0, 0]
|
||||
color: rgb 0.5, 0, 0
|
||||
mutantTire:
|
||||
color: [0, 0, 0.2]
|
||||
color: rgb 0, 0, 0.2
|
||||
text:
|
||||
color: [0.8, 0.8, 0]
|
||||
bright: [1, 1, 0]
|
||||
dark: [0.6, 0.4, 0]
|
||||
color: rgb 0.8, 0.8, 0
|
||||
bright: rgb 1, 1, 0
|
||||
dark: rgb 0.6, 0.4, 0
|
||||
gear:
|
||||
color: [1, 0, 0]
|
||||
valve:
|
||||
color: [0.7, 0, 0]
|
||||
color: rgb 1, 0, 0
|
||||
wire:
|
||||
color: [0.1, 0.1, 0.9]
|
||||
color: rgb 0.1, 0.1, 0.9
|
||||
glow:
|
||||
color: [1, 1, 0]
|
||||
color: rgb 1, 1, 0
|
||||
|
||||
# 000000000 00000000 0000000 000000000
|
||||
# 000 000 000 000
|
||||
|
@ -144,41 +138,39 @@ module.exports =
|
|||
# 000 00000000 0000000 000
|
||||
|
||||
test:
|
||||
raster:
|
||||
color: [1, 1, 1]
|
||||
plate:
|
||||
color: [0.08, 0.08, 0.08]
|
||||
color: rgb 0.08, 0.08, 0.08
|
||||
# raster:
|
||||
# color: rgb 1, 1, 1
|
||||
bulb:
|
||||
color: [0, 0, 0]
|
||||
color: rgb 0, 0, 0
|
||||
bomb:
|
||||
color: [0.5, 0, 0]
|
||||
color: rgb 0.5, 0, 0
|
||||
stone:
|
||||
color: [0.5, 0.5, 0.5]
|
||||
color: rgb 0.5, 0.5, 0.5
|
||||
opacity: 0.5
|
||||
switch:
|
||||
color: [0, 0, 0.5, 0.8]
|
||||
color: rgb 0, 0, 0.5, 0.8
|
||||
gate:
|
||||
color: [1, 1, 0, 0.8]
|
||||
color: rgb 1, 1, 0, 0.8
|
||||
player:
|
||||
color: [1, 0.5, 0]
|
||||
color: rgb 1, 0.5, 0
|
||||
tire:
|
||||
color: [0.5, 0, 0]
|
||||
color: rgb 0.5, 0, 0
|
||||
mutant:
|
||||
color: [1, 0.5, 0]
|
||||
color: rgb 1, 0.5, 0
|
||||
mutantTire:
|
||||
color: [0.5, 0, 0]
|
||||
color: rgb 0.5, 0, 0
|
||||
text:
|
||||
color: [0.8, 0.8, 0]
|
||||
bright: [1, 1, 0]
|
||||
dark: [0.6, 0.4, 0]
|
||||
color: rgb 0.8, 0.8, 0
|
||||
bright: rgb 1, 1, 0
|
||||
dark: rgb 0.6, 0.4, 0
|
||||
gear:
|
||||
color: [0.1, 0.1, 0.9]
|
||||
valve:
|
||||
color: [0, 0, 0.5]
|
||||
color: rgb 0.1, 0.1, 0.9
|
||||
wire:
|
||||
color: [0.1, 0.1, 0.9]
|
||||
color: rgb 0.1, 0.1, 0.9
|
||||
glow:
|
||||
color: [1, 1, 0]
|
||||
color: rgb 1, 1, 0
|
||||
|
||||
# 0000000 0000000 000 000 0000000 000 000
|
||||
# 000 000 000 0000 000 000 000 000 000
|
||||
|
@ -187,41 +179,39 @@ module.exports =
|
|||
# 0000000 000 000 000 000 0000000 000
|
||||
|
||||
candy:
|
||||
raster:
|
||||
color: [0.35, 0, 0.35]
|
||||
plate:
|
||||
color: [0.8, 0, 0.9]
|
||||
color: rgb 0.8, 0, 0.9
|
||||
# raster:
|
||||
# color: rgb 0.35, 0, 0.35
|
||||
bulb:
|
||||
color: [0, 0, 0]
|
||||
color: rgb 0, 0, 0
|
||||
text:
|
||||
color: [0.7, 0, 0.7]
|
||||
bright: [1, 0, 1]
|
||||
dark: [0.4, 0, 0.4]
|
||||
color: rgb 0.7, 0, 0.7
|
||||
bright: rgb 1, 0, 1
|
||||
dark: rgb 0.4, 0, 0.4
|
||||
bomb:
|
||||
color: [0.73, 0, 0.75]
|
||||
color: rgb 0.73, 0, 0.75
|
||||
stone:
|
||||
color: [0.85, 0, 0.95]
|
||||
color: rgb 0.85, 0, 0.95
|
||||
opacity: 0.6
|
||||
switch:
|
||||
color: [0.3, 0, 0.3]
|
||||
color: rgb 0.3, 0, 0.3
|
||||
gate:
|
||||
color: [1, 0, 1, 0.8]
|
||||
color: rgb 1, 0, 1, 0.8
|
||||
player:
|
||||
color: [0.7, 0, 0.7]
|
||||
color: rgb 0.7, 0, 0.7
|
||||
tire:
|
||||
color: [0.3, 0, 0.3]
|
||||
color: rgb 0.3, 0, 0.3
|
||||
mutant:
|
||||
color: [0.3, 0, 0.3]
|
||||
color: rgb 0.3, 0, 0.3
|
||||
mutantTire:
|
||||
color: [0.7, 0, 0.7]
|
||||
valve:
|
||||
color: [0.5, 0, 0.5]
|
||||
color: rgb 0.7, 0, 0.7
|
||||
gear:
|
||||
color: [0.7, 0, 0.7]
|
||||
color: rgb 0.7, 0, 0.7
|
||||
wire:
|
||||
color: [1, 0, 1]
|
||||
color: rgb 1, 0, 1
|
||||
glow:
|
||||
color: [1, 1, 0]
|
||||
color: rgb 1, 1, 0
|
||||
|
||||
# 0000000 00000000 0000000 000 000 0000000 00000000
|
||||
# 000 000 000 000 000 000 0000 000 000 000
|
||||
|
@ -230,41 +220,38 @@ module.exports =
|
|||
# 0000000 000 000 0000000 000 000 0000000 00000000
|
||||
|
||||
bronze:
|
||||
raster:
|
||||
color: [0.25, 0.15, 0.05]
|
||||
plate:
|
||||
color: [0.8, 0.6, 0.2]
|
||||
color: rgb 0.8, 0.6, 0.2
|
||||
bulb:
|
||||
color: [0.1, 0.1, 0]
|
||||
color: rgb 1,1,1
|
||||
emissive: rgb 1,1,0
|
||||
stone:
|
||||
color: [1, 0.8, 0.4]
|
||||
color: rgb 1, 0.8, 0.4
|
||||
opacity: 0.8
|
||||
switch:
|
||||
color: [0.9, 0.7, 0.1]
|
||||
color: rgb 0.9, 0.7, 0.1
|
||||
gate:
|
||||
color: [0.9, 0.7, 0.1]
|
||||
color: rgb 0.9, 0.7, 0.1
|
||||
player:
|
||||
color: [0.8, 0.6, 0.3]
|
||||
color: rgb 0.8, 0.6, 0.3
|
||||
tire:
|
||||
color: [0.5, 0.2, 0.1]
|
||||
color: rgb 0.5, 0.2, 0.1
|
||||
mutant:
|
||||
color: [0.5, 0.2, 0.1]
|
||||
color: rgb 0.5, 0.2, 0.1
|
||||
mutantTire:
|
||||
color: [0.3, 0.1, 0]
|
||||
color: rgb 0.3, 0.1, 0
|
||||
gear:
|
||||
color: [0.7, 0.4, 0.1]
|
||||
valve:
|
||||
color: [0.5, 0.2, 0.1]
|
||||
color: rgb 0.7, 0.4, 0.1
|
||||
wire:
|
||||
color: [0.7, 0.5, 0.3]
|
||||
color: rgb 0.6, 0, 0
|
||||
glow:
|
||||
color: [1, 1, 0]
|
||||
color: rgb 1, 1, 0
|
||||
bomb:
|
||||
color: [0.9, 0.7, 0.1]
|
||||
color: rgb 0.9, 0.7, 0.1
|
||||
text:
|
||||
color: [0.7, 0.5, 0.1]
|
||||
bright: [0.9, 0.7, 0.15]
|
||||
dark: [0.6, 0.4, 0]
|
||||
color: rgb 0.7, 0.5, 0.1
|
||||
bright: rgb 0.9, 0.7, 0.15
|
||||
dark: rgb 0.6, 0.4, 0
|
||||
|
||||
# 00000000 00000000 0000000
|
||||
# 000 000 000 000 000
|
||||
|
@ -273,39 +260,37 @@ module.exports =
|
|||
# 000 000 00000000 0000000
|
||||
|
||||
red:
|
||||
raster:
|
||||
color: [0.2, 0, 0]
|
||||
plate:
|
||||
color: [0.3, 0, 0]
|
||||
color: rgb 0.3, 0, 0
|
||||
wall:
|
||||
color: rgb 0.2, 0, 0
|
||||
bulb:
|
||||
color: [0.1, 0.1, 0.1]
|
||||
color: rgb 0.8, 0, 0
|
||||
bomb:
|
||||
color: [0.5, 0, 0]
|
||||
color: rgb 0.5, 0, 0
|
||||
stone:
|
||||
color: [0.5, 0, 0]
|
||||
opacity: 0.6
|
||||
color: rgb 0.5, 0, 0
|
||||
opacity: 0.6
|
||||
switch:
|
||||
color: [0.8, 0, 0]
|
||||
color: rgb 0.6, 0, 0
|
||||
gate:
|
||||
color: [1, 0.2, 0]
|
||||
color: rgb 1, 0.2, 0
|
||||
player:
|
||||
color: [0.7, 0, 0]
|
||||
color: rgb 0.7, 0, 0
|
||||
tire:
|
||||
color: [0.3, 0, 0]
|
||||
color: rgb 0.3, 0, 0
|
||||
mutant:
|
||||
color: [0.3, 0, 0]
|
||||
color: rgb 0.3, 0, 0
|
||||
mutantTire:
|
||||
color: [0.7, 0, 0]
|
||||
valve:
|
||||
color: [0.5, 0.2, 0]
|
||||
color: rgb 0.7, 0, 0
|
||||
gear:
|
||||
color: [1, 0.5, 0]
|
||||
color: rgb 1, 0.5, 0
|
||||
wire:
|
||||
color: [0.5, 0, 0]
|
||||
color: rgb 0.5, 0, 0
|
||||
text:
|
||||
color: [1, 0.5, 0]
|
||||
bright: [1, 0.8, 0]
|
||||
dark: [0.4, 0.2, 0]
|
||||
color: rgb 1, 0.5, 0
|
||||
bright: rgb 1, 0.8, 0
|
||||
dark: rgb 0.4, 0.2, 0
|
||||
|
||||
# 0000000 000 000 000 00000000
|
||||
# 000 000 000 000 000 000
|
||||
|
@ -314,42 +299,40 @@ module.exports =
|
|||
# 0000000 0000000 0000000 00000000
|
||||
|
||||
blue:
|
||||
raster:
|
||||
color: [0, 0, 0.2]
|
||||
plate:
|
||||
color: [0.1, 0.1, 0.6]
|
||||
color: rgb 0.1, 0.1, 0.6
|
||||
# raster:
|
||||
# color: rgb 0, 0, 0.2
|
||||
bulb:
|
||||
color: [0.1, 0.1, 0.1]
|
||||
color: rgb 0.1, 0.1, 0.1
|
||||
stone:
|
||||
color: [0, 0, 0.5]
|
||||
color: rgb 0, 0, 0.5
|
||||
opacity: 0.6
|
||||
switch:
|
||||
color: [0, 0, 0.6, 0.8]
|
||||
color: rgb 0, 0, 0.6, 0.8
|
||||
bomb:
|
||||
color: [0.2, 0.2, 0.9]
|
||||
color: rgb 0.2, 0.2, 0.9
|
||||
opacity: 0.8
|
||||
gate:
|
||||
color: [0, 0.2, 1]
|
||||
color: rgb 0, 0.2, 1
|
||||
player:
|
||||
color: [0, 0, 0.7]
|
||||
color: rgb 0, 0, 0.7
|
||||
tire:
|
||||
color: [0, 0, 0.3]
|
||||
color: rgb 0, 0, 0.3
|
||||
mutant:
|
||||
color: [0, 0, 0.3]
|
||||
color: rgb 0, 0, 0.3
|
||||
mutantTire:
|
||||
color: [0, 0, 0.7]
|
||||
color: rgb 0, 0, 0.7
|
||||
text:
|
||||
color: [0.2, 0.4, 0.8]
|
||||
bright: [0.7, 0.8, 1]
|
||||
dark: [0, 0, 0.6]
|
||||
color: rgb 0.2, 0.4, 0.8
|
||||
bright: rgb 0.7, 0.8, 1
|
||||
dark: rgb 0, 0, 0.6
|
||||
gear:
|
||||
color: [0.1, 0.1, 0.9]
|
||||
valve:
|
||||
color: [0, 0, 0.5]
|
||||
color: rgb 0.1, 0.1, 0.9
|
||||
wire:
|
||||
color: [0.1, 0.1, 0.9]
|
||||
color: rgb 0.1, 0.1, 0.9
|
||||
glow:
|
||||
color: [1, 0.5, 0]
|
||||
color: rgb 1, 0.5, 0
|
||||
|
||||
# 000 000 00000000 000 000 0000000 000 000
|
||||
# 000 000 000 000 000 000 000 000 0 000
|
||||
|
@ -358,41 +341,39 @@ module.exports =
|
|||
# 000 00000000 0000000 0000000 0000000 00 00
|
||||
|
||||
yellow:
|
||||
raster:
|
||||
color: [0.34, 0.34, 0]
|
||||
plate:
|
||||
color: [0.9, 0.9, 0]
|
||||
color: rgb 0.9, 0.9, 0
|
||||
# raster:
|
||||
# color: rgb 0.34, 0.34, 0
|
||||
bulb:
|
||||
color: [0, 0, 0]
|
||||
color: rgb 0, 0, 0
|
||||
bomb:
|
||||
color: [0.75, 0.75, 0]
|
||||
color: rgb 0.75, 0.75, 0
|
||||
stone:
|
||||
color: [0.8, 0.85, 0]
|
||||
color: rgb 0.8, 0.85, 0
|
||||
opacity: 0.6
|
||||
switch:
|
||||
color: [0.8, 0.8, 0]
|
||||
color: rgb 0.8, 0.8, 0
|
||||
gate:
|
||||
color: [1, 1, 0, 0.8]
|
||||
color: rgb 1, 1, 0, 0.8
|
||||
player:
|
||||
color: [0.7, 0.7, 0]
|
||||
color: rgb 0.7, 0.7, 0
|
||||
tire:
|
||||
color: [0.3, 0.3, 0]
|
||||
color: rgb 0.3, 0.3, 0
|
||||
mutant:
|
||||
color: [0.3, 0.3, 0]
|
||||
color: rgb 0.3, 0.3, 0
|
||||
mutantTire:
|
||||
color: [0.7, 0.7, 0]
|
||||
valve:
|
||||
color: [0.5, 0.5, 0]
|
||||
color: rgb 0.7, 0.7, 0
|
||||
gear:
|
||||
color: [0.7, 0.5, 0]
|
||||
color: rgb 0.7, 0.5, 0
|
||||
wire:
|
||||
color: [1, 1, 0]
|
||||
color: rgb 1, 1, 0
|
||||
glow:
|
||||
color: [0, 0, 1]
|
||||
color: rgb 0, 0, 1
|
||||
text:
|
||||
color: [0.7, 0.7, 0]
|
||||
bright: [1, 1, 0]
|
||||
dark: [0.4, 0.4, 0]
|
||||
color: rgb 0.7, 0.7, 0
|
||||
bright: rgb 1, 1, 0
|
||||
dark: rgb 0.4, 0.4, 0
|
||||
|
||||
# 0000000 00000000 00000000 00000000 000 000
|
||||
# 000 000 000 000 000 0000 000
|
||||
|
@ -401,40 +382,38 @@ module.exports =
|
|||
# 0000000 000 000 00000000 00000000 000 000
|
||||
|
||||
green:
|
||||
raster:
|
||||
color: [0, 0.2, 0]
|
||||
plate:
|
||||
color: [0.1, 0.6, 0.1]
|
||||
color: rgb 0.1, 0.6, 0.1
|
||||
# raster:
|
||||
# color: rgb 0, 0.2, 0
|
||||
bulb:
|
||||
color: [0, 0, 0]
|
||||
color: rgb 0, 0, 0
|
||||
stone:
|
||||
color: [0, 0.5, 0]
|
||||
color: rgb 0, 0.5, 0
|
||||
switch:
|
||||
color: [0, 0.6, 0]
|
||||
color: rgb 0, 0.6, 0
|
||||
bomb:
|
||||
color: [0, 0.2, 0]
|
||||
color: rgb 0, 0.2, 0
|
||||
gate:
|
||||
color: [0, 0.5, 0]
|
||||
color: rgb 0, 0.5, 0
|
||||
player:
|
||||
color: [0, 0.7, 0]
|
||||
color: rgb 0, 0.7, 0
|
||||
tire:
|
||||
color: [0, 0.3, 0]
|
||||
color: rgb 0, 0.3, 0
|
||||
mutant:
|
||||
color: [0, 0.3, 0]
|
||||
color: rgb 0, 0.3, 0
|
||||
mutantTire:
|
||||
color: [0, 0.7, 0]
|
||||
color: rgb 0, 0.7, 0
|
||||
text:
|
||||
color: [0, 0.4, 0]
|
||||
bright: [0, 0.6, 0]
|
||||
dark: [0, 0.2, 0]
|
||||
color: rgb 0, 0.4, 0
|
||||
bright: rgb 0, 0.6, 0
|
||||
dark: rgb 0, 0.2, 0
|
||||
gear:
|
||||
color: [0, 0.2, 0]
|
||||
valve:
|
||||
color: [0, 0.5, 0]
|
||||
color: rgb 0, 0.2, 0
|
||||
wire:
|
||||
color: [0.1, 0.9, 0]
|
||||
color: rgb 0.1, 0.9, 0
|
||||
glow:
|
||||
color: [1, 1, 1]
|
||||
color: rgb 1, 1, 1
|
||||
|
||||
# 00 00 00000000 000000000 0000000 000
|
||||
# 000 000 000 000 000 000 000
|
||||
|
@ -443,41 +422,39 @@ module.exports =
|
|||
# 000 000 00000000 000 000 000 0000000
|
||||
|
||||
metal:
|
||||
raster:
|
||||
color: [0.2, 0.2, 0.2]
|
||||
plate:
|
||||
color: [1, 1, 1]
|
||||
color: rgb 0.7,0.7,0.7
|
||||
# raster:
|
||||
# color: rgb 0.2, 0.2, 0.2
|
||||
bulb:
|
||||
color: [0, 0, 0]
|
||||
color: rgb 1, 1, 1
|
||||
stone:
|
||||
color: [1, 1, 1, 0.6]
|
||||
color: rgb 1, 1, 1
|
||||
opacity: 0.6
|
||||
switch:
|
||||
color: [0.9, 1, 0.9]
|
||||
color: rgb 0.9, 1, 0.9
|
||||
gate:
|
||||
color: [1, 1, 1, 0.8]
|
||||
color: rgb 1, 1, 1, 0.8
|
||||
player:
|
||||
color: [0.6, 0.6, 0.6]
|
||||
color: rgb 0.6, 0.6, 0.6
|
||||
tire:
|
||||
color: [0.3, 0.3, 0.3]
|
||||
color: rgb 0.3, 0.3, 0.3
|
||||
mutant:
|
||||
color: [0.8, 0.8, 0.8]
|
||||
color: rgb 0.8, 0.8, 0.8
|
||||
mutantTire:
|
||||
color: [0.7, 0.7, 0.7]
|
||||
color: rgb 0.7, 0.7, 0.7
|
||||
bomb:
|
||||
color: [0.4, 0.4, 0.5]
|
||||
opacity: 0.9
|
||||
color: rgb 0.4, 0.4, 0.5
|
||||
gear:
|
||||
color: [0.2, 0.4, 0.5]
|
||||
valve:
|
||||
color: [0.4, 0.4, 0.5]
|
||||
color: rgb 0.2, 0.4, 0.5
|
||||
wire:
|
||||
color: [1, 1, 1, 0.9]
|
||||
color: rgb 1, 1, 1
|
||||
glow:
|
||||
color: [0, 0, 1]
|
||||
color: rgb 1, 1, 1
|
||||
text:
|
||||
color: [0.2, 0.4, 0.5]
|
||||
bright: [0.3, 0.9, 1]
|
||||
dark: [0.1, 0.3, 0.4]
|
||||
color: rgb 0.2, 0.4, 0.5
|
||||
bright: rgb 0.3, 0.9, 1
|
||||
dark: rgb 0.1, 0.3, 0.4
|
||||
|
||||
# 0000000 00000000 0000000 0000000 000 000
|
||||
# 000 000 000 000 000 000 000 000
|
||||
|
@ -486,42 +463,40 @@ module.exports =
|
|||
# 0000000 000 000 000 000 0000000 000
|
||||
|
||||
crazy:
|
||||
# plate:
|
||||
# color: rgb 0, 0.51, 0.82
|
||||
raster:
|
||||
color: [0.84, 0.22, 0.20]
|
||||
plate:
|
||||
color: [0, 0.51, 0.82]
|
||||
color: rgb 0.84, 0.22, 0.20
|
||||
bulb:
|
||||
color: [0, 0, 0]
|
||||
color: rgb 0, 0, 0
|
||||
stone:
|
||||
color: [1, 1, 1]
|
||||
color: rgb 1, 1, 1
|
||||
stone: 0.2
|
||||
switch:
|
||||
color: [0.9, 1, 0.9]
|
||||
color: rgb 0.9, 1, 0.9
|
||||
gate:
|
||||
color: [1, 1, 1, 0.8]
|
||||
color: rgb 1, 1, 1, 0.8
|
||||
player:
|
||||
color: [0.6, 0.6, 0.6]
|
||||
color: rgb 0.6, 0.6, 0.6
|
||||
tire:
|
||||
color: [0.3, 0.3, 0.3]
|
||||
color: rgb 0.3, 0.3, 0.3
|
||||
mutant:
|
||||
color: [0.8, 0.8, 0.8]
|
||||
color: rgb 0.8, 0.8, 0.8
|
||||
mutantTire:
|
||||
color: [0.7, 0.7, 0.7]
|
||||
color: rgb 0.7, 0.7, 0.7
|
||||
bomb:
|
||||
color: [0.4, 0.4, 0.5]
|
||||
color: rgb 0.4, 0.4, 0.5
|
||||
opacity: 0.2
|
||||
gear:
|
||||
color: [0.2, 0.4, 0.5]
|
||||
valve:
|
||||
color: [0.4, 0.4, 0.5]
|
||||
color: rgb 0.2, 0.4, 0.5
|
||||
wire:
|
||||
color: [1, 1, 1]
|
||||
color: rgb 1, 1, 1
|
||||
glow:
|
||||
color: [0, 0, 1]
|
||||
color: rgb 0, 0, 1
|
||||
text:
|
||||
color: [0.2, 0.4, 0.5]
|
||||
bright: [0.3, 0.9, 1]
|
||||
dark: [0.1, 0.3, 0.4]
|
||||
color: rgb 0.2, 0.4, 0.5
|
||||
bright: rgb 0.3, 0.9, 1
|
||||
dark: rgb 0.1, 0.3, 0.4
|
||||
|
||||
# 0000000 00000000 000 000
|
||||
# 000 000 0000 000
|
||||
|
@ -530,41 +505,39 @@ module.exports =
|
|||
# 0000000 00000000 000 000
|
||||
|
||||
zen:
|
||||
raster:
|
||||
color: [0.75, 0.95, 0.64]
|
||||
plate:
|
||||
color: [0.36, 0.45, 0.30]
|
||||
color: rgb 0.36, 0.45, 0.30
|
||||
# raster:
|
||||
# color: rgb 0.75, 0.95, 0.64
|
||||
bulb:
|
||||
color: [0, 0, 0]
|
||||
color: rgb 0, 0, 0
|
||||
stone:
|
||||
color: [0.36, 0.45, 0.30]
|
||||
color: rgb 0.36, 0.45, 0.30
|
||||
opacity: 0.7
|
||||
switch:
|
||||
color: [0.9, 1, 0.9, 0.8]
|
||||
color: rgb 0.9, 1, 0.9, 0.8
|
||||
gate:
|
||||
color: [1, 1, 1, 0.8]
|
||||
color: rgb 1, 1, 1, 0.8
|
||||
player:
|
||||
color: [0.6, 0.6, 0.6]
|
||||
color: rgb 0.6, 0.6, 0.6
|
||||
tire:
|
||||
color: [0.3, 0.3, 0.3]
|
||||
color: rgb 0.3, 0.3, 0.3
|
||||
mutant:
|
||||
color: [0.8, 0.8, 0.8]
|
||||
color: rgb 0.8, 0.8, 0.8
|
||||
mutantTire:
|
||||
color: [0.7, 0.7, 0.7]
|
||||
color: rgb 0.7, 0.7, 0.7
|
||||
bomb:
|
||||
color: [0.4, 0.4, 0.5]
|
||||
color: rgb 0.4, 0.4, 0.5
|
||||
opacity: 0.9
|
||||
gear:
|
||||
color: [0.2, 0.4, 0.5]
|
||||
valve:
|
||||
color: [0.4, 0.4, 0.5]
|
||||
color: rgb 0.2, 0.4, 0.5
|
||||
wire:
|
||||
color: [1, 1, 1, 0.9]
|
||||
color: rgb 1, 1, 1, 0.9
|
||||
glow:
|
||||
color: [0, 0, 1]
|
||||
color: rgb 0, 0, 1
|
||||
text:
|
||||
color: [0.2, 0.4, 0.5]
|
||||
bright: [0.3, 0.9, 1]
|
||||
dark: [0.1, 0.3, 0.4]
|
||||
color: rgb 0.2, 0.4, 0.5
|
||||
bright: rgb 0.3, 0.9, 1
|
||||
dark: rgb 0.1, 0.3, 0.4
|
||||
|
||||
|
|
@ -11,14 +11,12 @@ class Stone extends Pushable
|
|||
|
||||
constructor: (opt) ->
|
||||
@slippery = opt?.slippery or false
|
||||
@opacity = opt?.opacity ? 0.7
|
||||
@color = 0xff8800
|
||||
@opacity = opt?.opacity
|
||||
if opt?.color
|
||||
if Array.isArray opt.color
|
||||
@color = new THREE.Color opt.color[0], opt.color[1], opt.color[2]
|
||||
else
|
||||
@color = opt.color
|
||||
log 'color: ', @color
|
||||
super
|
||||
|
||||
isSlippery: -> return @slippery
|
||||
|
@ -37,8 +35,8 @@ class Stone extends Pushable
|
|||
else
|
||||
@geom = new THREE.BoxBufferGeometry 0.98,0.98,0.98
|
||||
@mat = Material.stone.clone()
|
||||
@mat.opacity = @opacity
|
||||
@mat.color.set @color
|
||||
@mat.opacity = @opacity if @opacity?
|
||||
@mat.color.set @color if @color?
|
||||
@mesh = new THREE.Mesh @geom, @mat
|
||||
@mesh.receiveShadow = true
|
||||
@mesh.castShadow = true
|
||||
|
|
|
@ -47,10 +47,7 @@ class Switch extends Item
|
|||
@mesh.receiveShadow = true
|
||||
|
||||
t2 = new THREE.TorusBufferGeometry 0.5-torusRadius, torusRadius, 16, 32
|
||||
# t3 = new THREE.TorusGeometry 0.5-torusRadius, torusRadius, 16, 32
|
||||
t2.rotateY Vector.DEG2RAD 90
|
||||
# t3.rotateX Vector.DEG2RAD 90
|
||||
# t2.merge t3
|
||||
@tors = new THREE.Mesh t2, Material.switch
|
||||
@tors.castShadow = true
|
||||
@tors.receiveShadow = true
|
||||
|
|
|
@ -33,7 +33,12 @@ Vector = require './lib/vector'
|
|||
Pos = require './lib/pos'
|
||||
_ = require 'lodash'
|
||||
now = require 'performance-now'
|
||||
{Wire,Gear,MotorGear,MotorCylinder,Face} = require './items'
|
||||
{
|
||||
Wire,
|
||||
Gear,
|
||||
MotorGear,
|
||||
MotorCylinder,
|
||||
Face} = require './items'
|
||||
|
||||
world = null
|
||||
|
||||
|
@ -182,8 +187,6 @@ class World extends Actor
|
|||
|
||||
@setSize @dict["size"] # this removes all objects
|
||||
|
||||
# log "world size set", @size
|
||||
|
||||
@applyScheme @dict.scheme ? 'default'
|
||||
|
||||
# ............................................................ intro text
|
||||
|
@ -266,12 +269,31 @@ class World extends Actor
|
|||
|
||||
applyScheme: (scheme) ->
|
||||
return if not Scheme[scheme]
|
||||
log "Scheme[#{scheme}]", Scheme[scheme]
|
||||
for k,v of Scheme[scheme]
|
||||
if Material[k]?
|
||||
if v.color
|
||||
c = v.color
|
||||
Material[k].color = new THREE.Color c[0], c[1], c[2]
|
||||
|
||||
log "world.applyScheme #{scheme}"
|
||||
|
||||
colors = _.clone Scheme[scheme]
|
||||
|
||||
opacity =
|
||||
stone: 0.7
|
||||
bomb: 0.9
|
||||
|
||||
colors.plate.emissive ?= colors.plate.color
|
||||
colors.bulb.emissive ?= colors.bulb.color
|
||||
colors.raster ?= {}
|
||||
colors.raster.color ?= colors.plate.color
|
||||
colors.wall ?= {}
|
||||
colors.wall.color ?= new THREE.Color(colors.plate.color).multiplyScalar 0.6
|
||||
colors.wirePlate ?= {}
|
||||
colors.wirePlate.color ?= colors.wire.color
|
||||
for k,v of colors
|
||||
# log "#{k} #{v.color?.r} #{v.color?.g} #{v.color?.b}", v
|
||||
continue if k == 'text'
|
||||
mat = Material[k]
|
||||
mat.color = v.color
|
||||
mat.opacity = v.opacity ? opacity[k] ? 1
|
||||
mat.specular = v.specular ? new THREE.Color(v.color).multiplyScalar 0.2
|
||||
mat.emissive = v.emissive ? new THREE.Color 0,0,0
|
||||
|
||||
# 000 000 0000000 000 000 000000000
|
||||
# 000 000 000 000 000 000
|
||||
|
@ -909,3 +931,4 @@ class World extends Actor
|
|||
return if @player?.modKeyComboEventUp mod, key, combo, event
|
||||
|
||||
module.exports = World
|
||||
|
||||
|
|
BIN
img/shot05.png
Normal file
BIN
img/shot05.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 1.1 MiB |
BIN
img/shot06.png
Normal file
BIN
img/shot06.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 1018 KiB |
BIN
screenShot.png
Normal file
BIN
screenShot.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 1.1 MiB |
Loading…
Reference in New Issue
Block a user