push
This commit is contained in:
parent
4f82dec18e
commit
21f13ccf6d
|
@ -479,6 +479,7 @@ class Bot extends Pushable
|
|||
@move_action = @getActionWithId Action.JUMP
|
||||
else if @move
|
||||
if world.isUnoccupiedPos forwardPos # forward is empty
|
||||
log 'forwardEmpty:', forwardPos
|
||||
if world.isUnoccupiedPos forwardPos.plus @getDown()
|
||||
# below forward also empty
|
||||
@move_action = @getActionWithId Action.CLIMB_DOWN
|
||||
|
|
|
@ -23,11 +23,13 @@ class Levels
|
|||
# "cube",
|
||||
# "switch",
|
||||
# "borg",
|
||||
"mini",
|
||||
# "mini",
|
||||
# "blocks",
|
||||
# "bombs",
|
||||
"sandbox",
|
||||
"energy", "maze", "love",
|
||||
# "sandbox",
|
||||
# "energy",
|
||||
"maze",
|
||||
"love",
|
||||
# medium
|
||||
"towers", "edge", "random", "plate", "nice", "entropy",
|
||||
# owen hay's levels (TODO: sort in)
|
||||
|
|
|
@ -35,10 +35,10 @@ module.exports =
|
|||
world.addObjectAtPos KikiMotorGear(KikiFace.NY), KikiPos s.x/2-1, s.y-1, s.z/2
|
||||
world.addObjectAtPos KikiMotorCylinder(KikiFace.NY), KikiPos s.x/2-1, s.y-2, s.z/2
|
||||
world.addObjectAtPos KikiGenerator(KikiFace.NY), KikiPos s.x/2+1, s.y-1, s.z/2
|
||||
world.addObjectLine "KikiWire (KikiFace.NY, KikiWire.VERTICAL)", KikiPos(s.x/2, s.y-1, 0), KikiPos s.x/2, s.y-1, s.z
|
||||
world.addObjectLine "KikiWire (KikiFace.PY, KikiWire.VERTICAL)", KikiPos(s.x/2, 0, 0), KikiPos s.x/2, 0, s.z
|
||||
world.addObjectLine "KikiWire (KikiFace.PZ, KikiWire.VERTICAL)", KikiPos(s.x/2, 0, 0), KikiPos s.x/2, s.y, 0
|
||||
world.addObjectLine "KikiWire (KikiFace.NZ, KikiWire.VERTICAL)", KikiPos(s.x/2, 0, s.z-1), KikiPos s.x/2, s.y, s.z-1
|
||||
world.addObjectLine "KikiWire (KikiFace.NY, KikiWire.VERTICAL)", s.x/2, s.y-1, 0, s.x/2, s.y-1, s.z
|
||||
world.addObjectLine "KikiWire (KikiFace.PY, KikiWire.VERTICAL)", s.x/2, 0, 0, s.x/2, 0, s.z
|
||||
world.addObjectLine "KikiWire (KikiFace.PZ, KikiWire.VERTICAL)", s.x/2, 0, 0, s.x/2, s.y, 0
|
||||
world.addObjectLine "KikiWire (KikiFace.NZ, KikiWire.VERTICAL)", s.x/2, 0, s.z-1, s.x/2, s.y, s.z-1
|
||||
|
||||
world.addObjectAtPos 'KikiWireStone', KikiPos s.x/2+3, 0, s.z/2
|
||||
world.addObjectAtPos 'KikiWireStone', KikiPos s.x/2-3, 0, s.z/2
|
||||
|
|
|
@ -27,61 +27,61 @@ module.exports =
|
|||
s = world.size
|
||||
d = 2
|
||||
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.PY), KikiPos(s.x/2, 1, s.z/2))
|
||||
world.addObjectAtPos(KikiMotorGear(KikiFace.PY), KikiPos(s.x/2, 0, s.z/2))
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.PY), s.x/2, 1, s.z/2)
|
||||
world.addObjectAtPos(KikiMotorGear(KikiFace.PY), s.x/2, 0, s.z/2)
|
||||
|
||||
world.addObjectAtPos(KikiGear(KikiFace.PY), KikiPos(s.x/2-1, s.y-1, s.z/2-1))
|
||||
world.addObjectAtPos(KikiGenerator(KikiFace.PY), KikiPos(s.x/2+1, s.y-1, s.z/2-1))
|
||||
world.addObjectAtPos(KikiGear(KikiFace.PY), s.x/2-1, s.y-1, s.z/2-1)
|
||||
world.addObjectAtPos(KikiGenerator(KikiFace.PY), s.x/2+1, s.y-1, s.z/2-1)
|
||||
|
||||
world.addObjectAtPos('KikiBomb', KikiPos(s.x/2-1, s.y-1, s.z/2+1))
|
||||
world.addObjectAtPos('KikiBomb', s.x/2-1, s.y-1, s.z/2+1)
|
||||
|
||||
world.addObjectAtPos('KikiWireStone', KikiPos(s.x/2, s.y-1, s.z/2))
|
||||
world.addObjectAtPos('KikiWireStone', KikiPos(s.x/2+1, s.y-2, s.z/2))
|
||||
world.addObjectAtPos('KikiWireStone', KikiPos(s.x/2-1, s.y-2, s.z/2))
|
||||
world.addObjectAtPos('KikiWireStone', s.x/2, s.y-1, s.z/2)
|
||||
world.addObjectAtPos('KikiWireStone', s.x/2+1, s.y-2, s.z/2)
|
||||
world.addObjectAtPos('KikiWireStone', s.x/2-1, s.y-2, s.z/2)
|
||||
|
||||
# floor wire square
|
||||
world.addObjectLine("KikiWire(KikiFace.PY, 10)", KikiPos(s.x/2-d+1, 0, s.z/2-d), KikiPos(s.x/2+d, 0, s.z/2-d))
|
||||
world.addObjectLine("KikiWire(KikiFace.PY, 10)", KikiPos(s.x/2-d+1, 0, s.z/2+d), KikiPos(s.x/2+d, 0, s.z/2+d))
|
||||
world.addObjectLine "KikiWire(KikiFace.PY, 10)", s.x/2-d+1, 0, s.z/2-d, s.x/2+d, 0, s.z/2-d
|
||||
world.addObjectLine "KikiWire(KikiFace.PY, 10)", s.x/2-d+1, 0, s.z/2+d, s.x/2+d, 0, s.z/2+d
|
||||
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 5), KikiPos(s.x/2-d, 0, s.z/2+1))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 5), KikiPos(s.x/2-d, 0, s.z/2-1))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 13), KikiPos(s.x/2-d, 0, s.z/2))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 5), s.x/2-d, 0, s.z/2+1)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 5), s.x/2-d, 0, s.z/2-1)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 13), s.x/2-d, 0, s.z/2)
|
||||
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 5), KikiPos(s.x/2+d, 0, s.z/2+1))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 5), KikiPos(s.x/2+d, 0, s.z/2-1))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 7), KikiPos(s.x/2+d, 0, s.z/2))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 5), s.x/2+d, 0, s.z/2+1)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 5), s.x/2+d, 0, s.z/2-1)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 7), s.x/2+d, 0, s.z/2)
|
||||
|
||||
# corners of wire square
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 6), KikiPos(s.x/2-d, 0, s.z/2-d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 3), KikiPos(s.x/2-d, 0, s.z/2+d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 9), KikiPos(s.x/2+d, 0, s.z/2+d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 12), KikiPos(s.x/2+d, 0, s.z/2-d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 6), s.x/2-d, 0, s.z/2-d)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 3), s.x/2-d, 0, s.z/2+d)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 9), s.x/2+d, 0, s.z/2+d)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 12), s.x/2+d, 0, s.z/2-d)
|
||||
|
||||
world.addObjectLine("KikiWire(KikiFace.PY, 10)", KikiPos(0, 0, s.z/2), KikiPos(s.x/2-d, 0, s.z/2))
|
||||
world.addObjectLine("KikiWire(KikiFace.PY, 10)", KikiPos(s.x/2+d+1, 0, s.z/2), KikiPos(s.x, 0, s.z/2))
|
||||
world.addObjectLine "KikiWire(KikiFace.PY, 10)", 0, 0, s.z/2, s.x/2-d, 0, s.z/2
|
||||
world.addObjectLine "KikiWire(KikiFace.PY, 10)", s.x/2+d+1, 0, s.z/2, s.x, 0, s.z/2
|
||||
|
||||
# ceiling wire square
|
||||
world.addObjectLine("KikiWire(KikiFace.NY, 10)", KikiPos(s.x/2-d+1, s.y-1, s.z/2-d), KikiPos(s.x/2+d, s.y-1, s.z/2-d))
|
||||
world.addObjectLine("KikiWire(KikiFace.NY, 10)", KikiPos(s.x/2-d+1, s.y-1, s.z/2+d), KikiPos(s.x/2+d, s.y-1, s.z/2+d))
|
||||
world.addObjectLine "KikiWire(KikiFace.NY, 10)", s.x/2-d+1, s.y-1, s.z/2-d, s.x/2+d, s.y-1, s.z/2-d
|
||||
world.addObjectLine "KikiWire(KikiFace.NY, 10)", s.x/2-d+1, s.y-1, s.z/2+d, s.x/2+d, s.y-1, s.z/2+d
|
||||
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 5), KikiPos(s.x/2-d, s.y-1, s.z/2+1))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 5), KikiPos(s.x/2-d, s.y-1, s.z/2-1))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 13), KikiPos(s.x/2-d, s.y-1, s.z/2))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 5), s.x/2-d, s.y-1, s.z/2+1)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 5), s.x/2-d, s.y-1, s.z/2-1)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 13), s.x/2-d, s.y-1, s.z/2)
|
||||
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 5), KikiPos(s.x/2+d, s.y-1, s.z/2+1))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 5), KikiPos(s.x/2+d, s.y-1, s.z/2-1))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 7), KikiPos(s.x/2+d, s.y-1, s.z/2))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 5), s.x/2+d, s.y-1, s.z/2+1)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 5), s.x/2+d, s.y-1, s.z/2-1)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 7), s.x/2+d, s.y-1, s.z/2)
|
||||
|
||||
# corners of wire square
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 3), KikiPos(s.x/2-d, s.y-1, s.z/2-d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 6), KikiPos(s.x/2-d, s.y-1, s.z/2+d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 12), KikiPos(s.x/2+d, s.y-1, s.z/2+d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 9), KikiPos(s.x/2+d, s.y-1, s.z/2-d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 3), s.x/2-d, s.y-1, s.z/2-d)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 6), s.x/2-d, s.y-1, s.z/2+d)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 12), s.x/2+d, s.y-1, s.z/2+d)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, 9), s.x/2+d, s.y-1, s.z/2-d)
|
||||
|
||||
world.addObjectLine("KikiWire(KikiFace.NY, 10)", KikiPos(0, s.y-1, s.z/2), KikiPos(s.x/2-d, s.y-1, s.z/2))
|
||||
world.addObjectLine("KikiWire(KikiFace.NY, 10)", KikiPos(s.x/2+d+1, s.y-1, s.z/2), KikiPos(s.x, s.y-1, s.z/2))
|
||||
world.addObjectLine "KikiWire(KikiFace.NY, 10)", 0, s.y-1, s.z/2, s.x/2-d, s.y-1, s.z/2
|
||||
world.addObjectLine "KikiWire(KikiFace.NY, 10)", s.x/2+d+1, s.y-1, s.z/2, s.x, s.y-1, s.z/2
|
||||
|
||||
# wall wire lines
|
||||
world.addObjectLine("KikiWire(KikiFace.PX, 5)", KikiPos( 0, 0, s.z/2), KikiPos( 0, s.y, s.z/2))
|
||||
world.addObjectLine("KikiWire(KikiFace.NX, 5)", KikiPos(s.x-1, 0, s.z/2), KikiPos(s.x-1, s.y, s.z/2))
|
||||
world.addObjectLine "KikiWire(KikiFace.PX, 5)", 0, 0, s.z/2, 0, s.y, s.z/2
|
||||
world.addObjectLine "KikiWire(KikiFace.NX, 5)", s.x-1, 0, s.z/2, s.x-1, s.y, s.z/2
|
||||
|
|
@ -25,19 +25,19 @@ module.exports =
|
|||
create: ->
|
||||
s = world.size
|
||||
|
||||
world.addObjectLine('KikiWireStone', KikiPos(0, 0, 0), KikiPos(0, s.y-2, 0))
|
||||
world.addObjectLine('KikiWireStone', KikiPos(s.x-1, 0, 0), KikiPos(s.x-1, s.y-2, 0))
|
||||
world.addObjectLine('KikiWireStone', KikiPos(s.x-1, 0, s.z-1), KikiPos(s.x-1, s.y-2, s.z-1))
|
||||
world.addObjectLine('KikiWireStone', KikiPos(0, 0, s.z-1), KikiPos(0, s.y-2, s.z-1))
|
||||
world.addObjectLine 'KikiWireStone', 0, 0, 0, 0, s.y-2, 0
|
||||
world.addObjectLine 'KikiWireStone', s.x-1, 0, 0, s.x-1, s.y-2, 0
|
||||
world.addObjectLine 'KikiWireStone', s.x-1, 0, s.z-1, s.x-1, s.y-2, s.z-1
|
||||
world.addObjectLine 'KikiWireStone', 0, 0, s.z-1, 0, s.y-2, s.z-1
|
||||
|
||||
world.addObjectAtPos('KikiBomb', KikiPos(s.x/2, s.y-2, s.z/2))
|
||||
world.addObjectAtPos(KikiGenerator(KikiFace.PY), KikiPos(s.x/2, s.y/2, s.z/2))
|
||||
world.addObjectAtPos 'KikiBomb', s.x/2, s.y-2, s.z/2
|
||||
world.addObjectAtPos 'KikiGenerator(KikiFace.PY)', s.x/2, s.y/2, s.z/2
|
||||
|
||||
world.addObjectAtPos('KikiWireStone', KikiPos(1, s.y-2, 1))
|
||||
world.addObjectAtPos('KikiWireStone', KikiPos(s.x-2, s.y-2, 1))
|
||||
world.addObjectAtPos('KikiWireStone', KikiPos(1, s.y-2, s.z-2))
|
||||
world.addObjectAtPos('KikiWireStone', KikiPos(s.x-2, s.y-2, s.z-2))
|
||||
world.addObjectAtPos('KikiWireStone', KikiPos(s.x/2, s.y-1, s.z/2))
|
||||
world.addObjectAtPos 'KikiWireStone', 1, s.y-2, 1
|
||||
world.addObjectAtPos 'KikiWireStone', s.x-2, s.y-2, 1
|
||||
world.addObjectAtPos 'KikiWireStone', 1, s.y-2, s.z-2
|
||||
world.addObjectAtPos 'KikiWireStone', s.x-2, s.y-2, s.z-2
|
||||
world.addObjectAtPos 'KikiWireStone', s.x/2, s.y-1, s.z/2
|
||||
|
||||
world.addObjectAtPos(KikiMotorGear(KikiFace.PY), KikiPos(s.x/2, 0, 0))
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.PY), KikiPos(s.x/2, 1, 0))
|
||||
world.addObjectAtPos 'KikiMotorGear(KikiFace.PY)', s.x/2, 0, 0
|
||||
world.addObjectAtPos 'KikiMotorCylinder(KikiFace.PY)', s.x/2, 1, 0
|
||||
|
|
|
@ -31,13 +31,13 @@ module.exports =
|
|||
sy=s.y-1
|
||||
sz=s.z-1
|
||||
|
||||
p=[ [KikiPos( 0, 0, 0+1),KikiPos( 0, 0,mz),KikiPos( 0,my,mz), KikiFace.X, KikiFace.X],
|
||||
[KikiPos( 0,my,mz+1),KikiPos( 0,my,sz),KikiPos(mx,my,sz), KikiFace.X, KikiFace.NZ],
|
||||
[KikiPos(mx,my-1,sz),KikiPos(mx, 0,sz),KikiPos(my, 0,mz), KikiFace.NZ, KikiFace.Y],
|
||||
[KikiPos(mx+1, 0,mz),KikiPos(sx, 0,mz),KikiPos(sx,my,mz), KikiFace.Y, KikiFace.NX],
|
||||
[KikiPos(sx,my,mz-1),KikiPos(sx,my, 0),KikiPos(mx,my, 0), KikiFace.NX, KikiFace.Z],
|
||||
[KikiPos(mx,my+1, 0),KikiPos(mx,sy, 0),KikiPos(mx,sy,my), KikiFace.Z, KikiFace.NY],
|
||||
[KikiPos(mx+1,sy,my),KikiPos(sx,sy,mz),KikiPos(sx,sy,sz), KikiFace.NY, KikiFace.NY],
|
||||
p=[ [ 0, 0, 0+1, 0, 0,mz, 0,my,mz, KikiFace.X, KikiFace.X],
|
||||
[ 0,my,mz+1, 0,my,sz, mx,my,sz, KikiFace.X, KikiFace.NZ],
|
||||
[mx,my-1,sz, mx, 0,sz, my, 0,mz, KikiFace.NZ, KikiFace.Y],
|
||||
[mx+1, 0,mz, sx, 0,mz, sx,my,mz, KikiFace.Y, KikiFace.NX],
|
||||
[sx,my,mz-1, sx,my, 0, mx,my, 0, KikiFace.NX, KikiFace.Z],
|
||||
[mx,my+1, 0, mx,sy, 0, mx,sy,my, KikiFace.Z, KikiFace.NY],
|
||||
[mx+1,sy,my, sx,sy,mz, sx,sy,sz, KikiFace.NY, KikiFace.NY],
|
||||
]
|
||||
for k in p
|
||||
stone= () -> KikiWire(k[3], 15)
|
||||
|
@ -56,14 +56,14 @@ module.exports =
|
|||
world.addObjectAtPos 'KikiWireStone', world.decenter(0,0,2)
|
||||
world.addObjectAtPos 'KikiWireStone', world.decenter(0,0,-2)
|
||||
|
||||
world.addObjectAtPos(KikiWire(KikiFace.X), KikiPos(0,0,0))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.Z), KikiPos(0,0,0))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.Z), KikiPos(1,0,0))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.X), 0,0,0)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.Z), 0,0,0)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.Z), 1,0,0)
|
||||
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY), KikiPos(sx,sy,sz))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY), sx,sy,sz)
|
||||
|
||||
world.addObjectAtPos(KikiMotorGear(KikiFace.Z), KikiPos(2,0,0))
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.Z), KikiPos(2,0,1))
|
||||
world.addObjectAtPos(KikiMotorGear(KikiFace.Z), 2,0,0)
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.Z), 2,0,1)
|
||||
g=KikiGenerator(KikiFace.Z)
|
||||
world.addObjectAtPos(g, KikiPos(mx,my,mz))
|
||||
world.addObjectAtPos(g, mx,my,mz)
|
||||
|
|
@ -29,50 +29,50 @@ module.exports =
|
|||
create: ->
|
||||
|
||||
KikiWireWall = (c , p) ->
|
||||
if world.isUnoccupiedPos(KikiPos(p.x,p.y,p.z))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(p.x,p.y,p.z))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.X, c), KikiPos(p.x+1,p.y ,p.z ))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NX, c), KikiPos(p.x-1,p.y ,p.z ))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.Y, c), KikiPos(p.x ,p.y+1,p.z ))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, c), KikiPos(p.x ,p.y-1,p.z ))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.Z, c), KikiPos(p.x ,p.y ,p.z+1))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NZ, c), KikiPos(p.x ,p.y ,p.z-1))
|
||||
if world.isUnoccupiedPos(p.x,p.y,p.z)
|
||||
world.addObjectAtPos('KikiWall', p.x,p.y,p.z)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.X, c), p.x+1,p.y ,p.z )
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NX, c), p.x-1,p.y ,p.z )
|
||||
world.addObjectAtPos(KikiWire(KikiFace.Y, c), p.x ,p.y+1,p.z )
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NY, c), p.x ,p.y-1,p.z )
|
||||
world.addObjectAtPos(KikiWire(KikiFace.Z, c), p.x ,p.y ,p.z+1)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NZ, c), p.x ,p.y ,p.z-1)
|
||||
|
||||
for h in [2,4,6]
|
||||
world.addObjectLine(KikiWall, KikiPos(5,2,h), KikiPos(5,6,h) )
|
||||
world.addObjectAtPos('KikiWireStone', KikiPos(5,1,h))
|
||||
world.addObjectAtPos('KikiWireStone', KikiPos(5,6,h))
|
||||
world.addObjectLine(KikiWall, 5,2,h, 5,6,h)
|
||||
world.addObjectAtPos('KikiWireStone', 5,1,h)
|
||||
world.addObjectAtPos('KikiWireStone', 5,6,h)
|
||||
|
||||
wire_u= -> KikiWire(KikiFace.Z, 4+1 )
|
||||
wire_d= -> KikiWire(KikiFace.NZ, 4+1 )
|
||||
|
||||
world.addObjectLine(wire_d, KikiPos(5,2,1),KikiPos(5,6,1))
|
||||
world.addObjectLine(wire_u, KikiPos(5,2,3),KikiPos(5,6,3))
|
||||
world.addObjectAtPos( KikiWire(KikiFace.NY, 5), KikiPos(5,1,2))
|
||||
world.addObjectAtPos( KikiWire(KikiFace.Y, 5), KikiPos(5,6,2))
|
||||
world.addObjectLine(wire_d, 5,2,1, 5,6,1)
|
||||
world.addObjectLine(wire_u, 5,2,3, 5,6,3)
|
||||
world.addObjectAtPos( KikiWire(KikiFace.NY, 5), 5,1,2)
|
||||
world.addObjectAtPos( KikiWire(KikiFace.Y, 5), 5,6,2)
|
||||
|
||||
|
||||
world.addObjectAtPos(KikiMotorGear(KikiFace.Z), KikiPos(5,0,0))
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.Z), KikiPos(5,0,1))
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.NX), KikiPos(4,0,0))
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.X), KikiPos(6,0,0))
|
||||
world.addObjectAtPos(KikiMotorGear(KikiFace.Z), 5,0,0)
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.Z), 5,0,1)
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.NX), 4,0,0)
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.X), 6,0,0)
|
||||
|
||||
|
||||
g = KikiGenerator(KikiFace.Z) #set to Active as last command in LevelS
|
||||
world.addObjectAtPos(g, KikiPos(5,1,0))
|
||||
world.addObjectAtPos(g, 5,1,0)
|
||||
|
||||
world.addObjectAtPos('KikiWireStone', KikiPos(5,2,0))
|
||||
world.addObjectAtPos('KikiWireStone', KikiPos(5,2,1))
|
||||
world.addObjectAtPos('KikiWireStone', 5,2,0)
|
||||
world.addObjectAtPos('KikiWireStone', 5,2,1)
|
||||
|
||||
world.addObjectAtPos('KikiWireStone', KikiPos(5,5,3))
|
||||
world.addObjectAtPos('KikiWireStone', KikiPos(5,5,5))
|
||||
world.addObjectAtPos('KikiWireStone', 5,5,3)
|
||||
world.addObjectAtPos('KikiWireStone', 5,5,5)
|
||||
|
||||
KikiWireWall(15, KikiPos(5,4,8))
|
||||
KikiWireWall(15, 5,4,8)
|
||||
|
||||
world.addObjectAtPos('KikiWall', KikiPos(0,0,0))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(10,0,0))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(10,8,0))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(0,8,0))
|
||||
world.addObjectAtPos('KikiWall', 0,0,0)
|
||||
world.addObjectAtPos('KikiWall', 10,0,0)
|
||||
world.addObjectAtPos('KikiWall', 10,8,0)
|
||||
world.addObjectAtPos('KikiWall', 0,8,0)
|
||||
|
||||
g.setActive(True)
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ module.exports =
|
|||
# x=range(5)
|
||||
# for (i,j,l) in [(i,j,l) for i in x for j in x for l in x]
|
||||
# if (-1)**(i+j+l) == -1
|
||||
# world.addObjectAtPos(KikiStone(), KikiPos(i,j,l))
|
||||
# world.addObjectAtPos(KikiStone(), i,j,l)
|
||||
|
||||
for i in [0...5]
|
||||
for j in [0...5]
|
||||
|
|
|
@ -25,8 +25,8 @@ module.exports =
|
|||
if (i==2 or j==2 or l==2) and i>=1 and j>=1 and l >=1
|
||||
c = 0.6 - (0.3)*Math.pow(-1, i+j+l)
|
||||
d = 0.6 + (0.3)*Math.pow(-1, i+j+l)
|
||||
world.addObjectAtPos(KikiStone(KColor(c ,0, d, 0.8), false), KikiPos(i,j,l))
|
||||
world.addObjectAtPos(KikiStone(KColor(c ,0, d, 0.8), false), KikiPos(s.x-i-1,s.y-j-1,s.z-l-1))
|
||||
world.addObjectAtPos(KikiStone(KColor(c ,0, d, 0.8), false), KikiPos(s.x-i-1,j,l))
|
||||
world.addObjectAtPos(KikiStone(KColor(c ,0, d, 0.8), false), KikiPos(i,s.y-j-1,s.z-l-1))
|
||||
world.addObjectAtPos(KikiStone(KColor(c ,0, d, 0.8), false), i,j,l)
|
||||
world.addObjectAtPos(KikiStone(KColor(c ,0, d, 0.8), false), s.x-i-1,s.y-j-1,s.z-l-1)
|
||||
world.addObjectAtPos(KikiStone(KColor(c ,0, d, 0.8), false), s.x-i-1,j,l)
|
||||
world.addObjectAtPos(KikiStone(KColor(c ,0, d, 0.8), false), i,s.y-j-1,s.z-l-1)
|
||||
|
|
@ -38,32 +38,32 @@ module.exports =
|
|||
world.addObjectLine('KikiWireStone', world.decenter( d, 0, 0), world.decenter( 0, 0, 0))
|
||||
world.addObjectLine('KikiWireStone', world.decenter(-d, 0, 0), world.decenter( 0, 0, 0))
|
||||
|
||||
world.addObjectAtPos(KikiGear(KikiFace.PY), KikiPos(s.x/2-1, 0, s.z/2-1))
|
||||
world.addObjectAtPos(KikiGear(KikiFace.PY), s.x/2-1, 0, s.z/2-1)
|
||||
|
||||
world.addObjectAtPos(KikiGenerator(KikiFace.PY), KikiPos(s.x/2+1, 0, s.z/2+1))
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.PY), KikiPos(s.x/2, 1, s.z/2))
|
||||
world.addObjectAtPos(KikiMotorGear(KikiFace.PY), KikiPos(s.x/2, 0, s.z/2))
|
||||
world.addObjectAtPos(KikiGenerator(KikiFace.PY), s.x/2+1, 0, s.z/2+1)
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.PY), s.x/2, 1, s.z/2)
|
||||
world.addObjectAtPos(KikiMotorGear(KikiFace.PY), s.x/2, 0, s.z/2)
|
||||
|
||||
# floor wire square
|
||||
world.addObjectLine(KikiWire(KikiFace.PY, 10), KikiPos(s.x/2-d+1, 0, s.z/2-d), KikiPos(s.x/2+d, 0, s.z/2-d))
|
||||
world.addObjectLine(KikiWire(KikiFace.PY, 10), KikiPos(s.x/2-d+1, 0, s.z/2+d), KikiPos(s.x/2+d, 0, s.z/2+d))
|
||||
world.addObjectLine(KikiWire(KikiFace.PY, 5), KikiPos(s.x/2-d, 0, s.z/2-d+1), KikiPos(s.x/2-d, 0, s.z/2+d))
|
||||
world.addObjectLine(KikiWire(KikiFace.PY, 5), KikiPos(s.x/2+d, 0, s.z/2-d+1), KikiPos(s.x/2+d, 0, s.z/2+d))
|
||||
world.addObjectLine(KikiWire(KikiFace.PY, 10), s.x/2-d+1, 0, s.z/2-d, s.x/2+d, 0, s.z/2-d)
|
||||
world.addObjectLine(KikiWire(KikiFace.PY, 10), s.x/2-d+1, 0, s.z/2+d, s.x/2+d, 0, s.z/2+d)
|
||||
world.addObjectLine(KikiWire(KikiFace.PY, 5), s.x/2-d, 0, s.z/2-d+1, s.x/2-d, 0, s.z/2+d)
|
||||
world.addObjectLine(KikiWire(KikiFace.PY, 5), s.x/2+d, 0, s.z/2-d+1, s.x/2+d, 0, s.z/2+d)
|
||||
# corners of wire square
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 6), KikiPos(s.x/2-d, 0, s.z/2-d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 3), KikiPos(s.x/2-d, 0, s.z/2+d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 9), KikiPos(s.x/2+d, 0, s.z/2+d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 12), KikiPos(s.x/2+d, 0, s.z/2-d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 6), s.x/2-d, 0, s.z/2-d)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 3), s.x/2-d, 0, s.z/2+d)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 9), s.x/2+d, 0, s.z/2+d)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 12), s.x/2+d, 0, s.z/2-d)
|
||||
|
||||
world.addObjectLine(KikiWire(KikiFace.PX, 5), KikiPos( 0, 0, s.z/2), KikiPos( 0, s.y, s.z/2))
|
||||
world.addObjectLine(KikiWire(KikiFace.NX, 5), KikiPos(s.x-1, 0, s.z/2), KikiPos(s.x-1, s.y, s.z/2))
|
||||
world.addObjectLine(KikiWire(KikiFace.PX, 5), 0, 0, s.z/2, 0, s.y, s.z/2)
|
||||
world.addObjectLine(KikiWire(KikiFace.NX, 5), s.x-1, 0, s.z/2, s.x-1, s.y, s.z/2)
|
||||
|
||||
world.addObjectLine(KikiWire(KikiFace.NY, 10), KikiPos(0, s.y-1, s.z/2), KikiPos(s.x/2-d, s.y-1, s.z/2))
|
||||
world.addObjectLine(KikiWire(KikiFace.NY, 10), KikiPos(s.x-d, s.y-1, s.z/2), KikiPos(s.x, s.y-1, s.z/2))
|
||||
world.addObjectLine(KikiWire(KikiFace.NY, 10), 0, s.y-1, s.z/2, s.x/2-d, s.y-1, s.z/2)
|
||||
world.addObjectLine(KikiWire(KikiFace.NY, 10), s.x-d, s.y-1, s.z/2, s.x, s.y-1, s.z/2)
|
||||
|
||||
world.addObjectLine(KikiWire(KikiFace.PY, 10), KikiPos(0, 0, s.z/2), KikiPos(s.x/2-d, 0, s.z/2))
|
||||
world.addObjectLine(KikiWire(KikiFace.PY, 10), KikiPos(s.x-d, 0, s.z/2), KikiPos(s.x, 0, s.z/2))
|
||||
world.addObjectLine(KikiWire(KikiFace.PY, 10), 0, 0, s.z/2, s.x/2-d, 0, s.z/2)
|
||||
world.addObjectLine(KikiWire(KikiFace.PY, 10), s.x-d, 0, s.z/2, s.x, 0, s.z/2)
|
||||
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 13), KikiPos(s.x/2-d, 0, s.z/2))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 7), KikiPos(s.x/2+d, 0, s.z/2))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 13), s.x/2-d, 0, s.z/2)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 7), s.x/2+d, 0, s.z/2)
|
||||
|
|
@ -28,5 +28,5 @@ module.exports =
|
|||
for j in [0...s.y]
|
||||
for o in [0...s.z]
|
||||
if Math.pow(-1, i+j+l)==1 and not (d<=i<=s.x-d-1 and d<=j<=s.y-d-1 and d<=l<=s.z-d-1)
|
||||
world.addObjectAtPos(KikiStone(KColor(0,0.8,0.2,0.8), true), KikiPos(i,j,l))
|
||||
world.addObjectAtPos(KikiStone(KColor(0,0.8,0.2,0.8), true), i,j,l)
|
||||
|
||||
|
|
|
@ -34,29 +34,29 @@ module.exports =
|
|||
s = world.size
|
||||
|
||||
#hop back on
|
||||
world.addObjectAtPos('KikiWall', KikiPos(2, 12, 12))
|
||||
world.addObjectAtPos('KikiWall', 2, 12, 12)
|
||||
|
||||
#orient world
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2, s.y/2+2, s.z/2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2+2, s.y/2+2, s.z/2))
|
||||
world.addObjectAtPos('KikiStone', s.x/2, s.y/2+2, s.z/2)
|
||||
world.addObjectAtPos('KikiStone', s.x/2+2, s.y/2+2, s.z/2)
|
||||
|
||||
#some Hops
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2+2, s.y/2-2, s.z/2+2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2+2, s.y/2-2, s.z/2+4))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2, s.y/2-2, s.z/2+4))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2+2, s.y/2-2, s.z/2+4))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2, s.y/2-4, s.z/2+4))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2-2, s.y/2-4, s.z/2+4))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2-4, s.y/2-4, s.z/2+4))
|
||||
world.addObjectAtPos('KikiStone', s.x/2+2, s.y/2-2, s.z/2+2)
|
||||
world.addObjectAtPos('KikiStone', s.x/2+2, s.y/2-2, s.z/2+4)
|
||||
world.addObjectAtPos('KikiStone', s.x/2, s.y/2-2, s.z/2+4)
|
||||
world.addObjectAtPos('KikiStone', s.x/2+2, s.y/2-2, s.z/2+4)
|
||||
world.addObjectAtPos('KikiStone', s.x/2, s.y/2-4, s.z/2+4)
|
||||
world.addObjectAtPos('KikiStone', s.x/2-2, s.y/2-4, s.z/2+4)
|
||||
world.addObjectAtPos('KikiStone', s.x/2-4, s.y/2-4, s.z/2+4)
|
||||
|
||||
#long fall and strip1
|
||||
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2-4, s.y/2+4, s.z/2+2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2-3, s.y/2+4, s.z/2+2))
|
||||
world.addObjectAtPos('KikiStone', s.x/2-4, s.y/2+4, s.z/2+2)
|
||||
world.addObjectAtPos('KikiStone', s.x/2-3, s.y/2+4, s.z/2+2)
|
||||
|
||||
#short fall and strip2
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2-4, s.y/2+1, s.z/2-2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2-4, s.y/2+1, s.z/2-1))
|
||||
world.addObjectAtPos('KikiStone', s.x/2-4, s.y/2+1, s.z/2-2)
|
||||
world.addObjectAtPos('KikiStone', s.x/2-4, s.y/2+1, s.z/2-1)
|
||||
|
||||
world.addObjectAtPos('KikiStone', KikiPos(0, 0, 0))
|
||||
world.addObjectAtPos('KikiStone', 0, 0, 0)
|
||||
|
|
@ -24,14 +24,16 @@ module.exports =
|
|||
]
|
||||
create: ->
|
||||
s = world.size
|
||||
for m in [[1,KikiWall], [2,KikiStone]]
|
||||
Stone = require './stone'
|
||||
for m in [[1,'Wall'], [2,'Stone']]
|
||||
for k in [-1*m[0],1*m[0]]
|
||||
for l in [-1*m[0],1*m[0]]
|
||||
world.addObjectLine(m[1], KikiPos(s.x/2+k, s.y/2+l ,0), KikiPos(s.x/2+k, s.y/2+l ,3))
|
||||
world.addObjectLine(m[1], KikiPos(s.x/2+k, s.y/2+l ,8), KikiPos(s.x/2+k, s.y/2+l ,s.z))
|
||||
|
||||
world.addObjectAtPos(KikiStone(KColor(0,1,0,0.5), true), world.decenter(1,0,0))
|
||||
world.addObjectAtPos(KikiStone(KColor(0,1,0,0.5), true), world.decenter(-1,0,0))
|
||||
world.addObjectAtPos(KikiStone(KColor(0,1,0,0.5), true), world.decenter(0,1,0))
|
||||
world.addObjectAtPos(KikiStone(KColor(0,1,0,0.5), true), world.decenter(0,-1,0))
|
||||
world.addObjectLine m[1], s.x/2+k, s.y/2+l ,0, s.x/2+k, s.y/2+l ,3
|
||||
world.addObjectLine m[1], s.x/2+k, s.y/2+l ,8, s.x/2+k, s.y/2+l ,s.z
|
||||
|
||||
|
||||
world.addObjectAtPos new Stone(KColor(0,1,0,0.5), true), world.decenter(1,0,0)
|
||||
world.addObjectAtPos new Stone(KColor(0,1,0,0.5), true), world.decenter(-1,0,0)
|
||||
world.addObjectAtPos new Stone(KColor(0,1,0,0.5), true), world.decenter(0,1,0)
|
||||
world.addObjectAtPos new Stone(KColor(0,1,0,0.5), true), world.decenter(0,-1,0)
|
||||
|
|
@ -50,27 +50,27 @@ module.exports =
|
|||
dswitch.getEventWithName("switched").addAction(continuous((s=dswitch) -> switched(s)))
|
||||
eswitch.getEventWithName("switched").addAction(continuous((s=eswitch) -> switched(s)))
|
||||
|
||||
world.addObjectAtPos(aswitch , KikiPos(s.x-1,0,0))
|
||||
world.addObjectAtPos(bswitch , KikiPos(0,0,0))
|
||||
world.addObjectAtPos(aswitch , s.x-1,0,0))
|
||||
world.addObjectAtPos(bswitch , 0,0,0))
|
||||
|
||||
world.addObjectAtPos('KikiMutant', KikiPos(s.x/2,0,0))
|
||||
world.addObjectLine('KikiWall', KikiPos(0,0,1), KikiPos(s.x,0,1))
|
||||
world.addObjectLine('KikiWall', KikiPos(0,1,0), KikiPos(s.x,1,0))
|
||||
world.addObjectAtPos('KikiMutant', s.x/2,0,0))
|
||||
world.addObjectLine('KikiWall', 0,0,1), s.x,0,1))
|
||||
world.addObjectLine('KikiWall', 0,1,0), s.x,1,0))
|
||||
|
||||
world.addObjectLine('KikiWall', KikiPos(0,2,2), KikiPos(s.x-3,2,2))
|
||||
world.addObjectAtPos('KikiSwitch', KikiPos(s.x-3,2,2))
|
||||
world.addObjectLine('KikiWall', KikiPos(2,2,2), KikiPos(2,2,s.z-3))
|
||||
world.addObjectAtPos('KikiSwitch', KikiPos(2,2,s.z-3))
|
||||
world.addObjectLine('KikiWall', KikiPos(2,2,4), KikiPos(2,s.y-3,4))
|
||||
world.addObjectLine('KikiWall', 0,2,2), s.x-3,2,2))
|
||||
world.addObjectAtPos('KikiSwitch', s.x-3,2,2))
|
||||
world.addObjectLine('KikiWall', 2,2,2), 2,2,s.z-3))
|
||||
world.addObjectAtPos('KikiSwitch', 2,2,s.z-3))
|
||||
world.addObjectLine('KikiWall', 2,2,4), 2,s.y-3,4))
|
||||
#exit
|
||||
world.addObjectAtPos('KikiSwitch' , KikiPos(2,s.y-3,4))
|
||||
world.addObjectAtPos('KikiSwitch' , 2,s.y-3,4))
|
||||
|
||||
world.addObjectLine('KikiWall', KikiPos(2,4,4), KikiPos(s.x-4,4,4))
|
||||
world.addObjectAtPos(cswitch , KikiPos(s.x-3,4,4))
|
||||
world.addObjectLine('KikiWall', 2,4,4), s.x-4,4,4))
|
||||
world.addObjectAtPos(cswitch , s.x-3,4,4))
|
||||
|
||||
world.addObjectLine('KikiWall', KikiPos(4,4,4), KikiPos(4,4,s.z-4))
|
||||
world.addObjectAtPos(dswitch , KikiPos(4,4,s.z-3))
|
||||
world.addObjectLine('KikiWall', 4,4,4), 4,4,s.z-4))
|
||||
world.addObjectAtPos(dswitch , 4,4,s.z-3))
|
||||
|
||||
world.addObjectLine('KikiWall', KikiPos(4,4,6), KikiPos(4,s.y-4,6))
|
||||
world.addObjectAtPos(eswitch , KikiPos(4,s.y-3,6))
|
||||
world.addObjectLine('KikiWall', 4,4,6), 4,s.y-4,6))
|
||||
world.addObjectAtPos(eswitch , 4,s.y-3,6))
|
||||
|
|
@ -31,30 +31,30 @@ module.exports =
|
|||
world.addObjectAtPos('KikiWireStone', world.decenter( 0, 0,-1))
|
||||
world.addObjectAtPos('KikiWireStone', world.decenter( 0, 0, 1))
|
||||
|
||||
world.addObjectAtPos(KikiGear(KikiFace.PY), KikiPos(s.x/2-1, 0, s.z/2-1))
|
||||
world.addObjectAtPos(KikiGear(KikiFace.PY), KikiPos(s.x/2+1, 0, s.z/2-1))
|
||||
world.addObjectAtPos(KikiGear(KikiFace.PY), KikiPos(s.x/2-1, 0, s.z/2+1))
|
||||
world.addObjectAtPos(KikiGear(KikiFace.PY), s.x/2-1, 0, s.z/2-1)
|
||||
world.addObjectAtPos(KikiGear(KikiFace.PY), s.x/2+1, 0, s.z/2-1)
|
||||
world.addObjectAtPos(KikiGear(KikiFace.PY), s.x/2-1, 0, s.z/2+1)
|
||||
|
||||
d = 3
|
||||
world.addObjectAtPos(KikiGenerator(KikiFace.PY), KikiPos(s.x/2+1, 0, s.z/2+1))
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.PY), KikiPos(s.x/2, 1, s.z/2))
|
||||
world.addObjectAtPos(KikiMotorGear(KikiFace.PY), KikiPos(s.x/2, 0, s.z/2))
|
||||
world.addObjectAtPos(KikiGenerator(KikiFace.PY), s.x/2+1, 0, s.z/2+1)
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.PY), s.x/2, 1, s.z/2)
|
||||
world.addObjectAtPos(KikiMotorGear(KikiFace.PY), s.x/2, 0, s.z/2)
|
||||
|
||||
# floor wire square
|
||||
world.addObjectLine("KikiWire(KikiFace.PY, 10)", KikiPos(s.x/2-d+1, 0, s.z/2-d), KikiPos(s.x/2+d, 0, s.z/2-d))
|
||||
world.addObjectLine("KikiWire(KikiFace.PY, 10)", KikiPos(s.x/2-d+1, 0, s.z/2+d), KikiPos(s.x/2+d, 0, s.z/2+d))
|
||||
world.addObjectLine("KikiWire(KikiFace.PY, 5)", KikiPos(s.x/2-d, 0, s.z/2-d+1), KikiPos(s.x/2-d, 0, s.z/2+d))
|
||||
world.addObjectLine("KikiWire(KikiFace.PY, 5)", KikiPos(s.x/2+d, 0, s.z/2-d+1), KikiPos(s.x/2+d, 0, s.z/2+d))
|
||||
world.addObjectLine("KikiWire(KikiFace.PY, 10)", s.x/2-d+1, 0, s.z/2-d, s.x/2+d, 0, s.z/2-d)
|
||||
world.addObjectLine("KikiWire(KikiFace.PY, 10)", s.x/2-d+1, 0, s.z/2+d, s.x/2+d, 0, s.z/2+d)
|
||||
world.addObjectLine("KikiWire(KikiFace.PY, 5)", s.x/2-d, 0, s.z/2-d+1, s.x/2-d, 0, s.z/2+d)
|
||||
world.addObjectLine("KikiWire(KikiFace.PY, 5)", s.x/2+d, 0, s.z/2-d+1, s.x/2+d, 0, s.z/2+d)
|
||||
# corners of wire square
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 6), KikiPos(s.x/2-d, 0, s.z/2-d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 3), KikiPos(s.x/2-d, 0, s.z/2+d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 9), KikiPos(s.x/2+d, 0, s.z/2+d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 12), KikiPos(s.x/2+d, 0, s.z/2-d))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 6), s.x/2-d, 0, s.z/2-d)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 3), s.x/2-d, 0, s.z/2+d)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 9), s.x/2+d, 0, s.z/2+d)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PY, 12), s.x/2+d, 0, s.z/2-d)
|
||||
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PX, 1), KikiPos(0, 0, s.z/2))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NX, 1), KikiPos(s.x-1, 0, s.z/2))
|
||||
world.addObjectAtPos(KikiWire(KikiFace.PX, 1), 0, 0, s.z/2)
|
||||
world.addObjectAtPos(KikiWire(KikiFace.NX, 1), s.x-1, 0, s.z/2)
|
||||
|
||||
world.addObjectLine("KikiWire(KikiFace.PX, 5)", KikiPos( 0, 1, s.z/2), KikiPos( 0, s.y, s.z/2))
|
||||
world.addObjectLine("KikiWire(KikiFace.NX, 5)", KikiPos(s.x-1, 1, s.z/2), KikiPos(s.x-1, s.y, s.z/2))
|
||||
world.addObjectLine("KikiWire(KikiFace.NY, 10)", KikiPos(0, s.y-1, s.z/2), KikiPos(s.x, s.y-1, s.z/2))
|
||||
world.addObjectLine "KikiWire(KikiFace.PX, 5)", 0, 1, s.z/2, 0, s.y, s.z/2
|
||||
world.addObjectLine "KikiWire(KikiFace.NX, 5)", s.x-1, 1, s.z/2, s.x-1, s.y, s.z/2
|
||||
world.addObjectLine "KikiWire(KikiFace.NY, 10)", 0, s.y-1, s.z/2, s.x, s.y-1, s.z/2
|
||||
|
|
@ -22,24 +22,24 @@ module.exports =
|
|||
|
||||
s = world.size
|
||||
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2-1, s.y/2+1, 0))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2+1, s.y/2+1, 0))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2+1, s.y/2-1, 0))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2-1, s.y/2-1, 0))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2-1, s.y/2, 0))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2+1, s.y/2, 0))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2, s.y/2-1, 0))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2, s.y/2+1, 0))
|
||||
world.addObjectAtPos('KikiStone', s.x/2-1, s.y/2+1, 0)
|
||||
world.addObjectAtPos('KikiStone', s.x/2+1, s.y/2+1, 0)
|
||||
world.addObjectAtPos('KikiStone', s.x/2+1, s.y/2-1, 0)
|
||||
world.addObjectAtPos('KikiStone', s.x/2-1, s.y/2-1, 0)
|
||||
world.addObjectAtPos('KikiStone', s.x/2-1, s.y/2, 0)
|
||||
world.addObjectAtPos('KikiStone', s.x/2+1, s.y/2, 0)
|
||||
world.addObjectAtPos('KikiStone', s.x/2, s.y/2-1, 0)
|
||||
world.addObjectAtPos('KikiStone', s.x/2, s.y/2+1, 0)
|
||||
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2, s.y/2, 1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2+1, s.y/2, 2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2-1, s.y/2, 2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2+2, s.y/2, 1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2-2, s.y/2, 1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2+2, s.y/2, 4))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2-2, s.y/2, 4))
|
||||
world.addObjectAtPos('KikiStone', s.x/2, s.y/2, 1)
|
||||
world.addObjectAtPos('KikiStone', s.x/2+1, s.y/2, 2)
|
||||
world.addObjectAtPos('KikiStone', s.x/2-1, s.y/2, 2)
|
||||
world.addObjectAtPos('KikiStone', s.x/2+2, s.y/2, 1)
|
||||
world.addObjectAtPos('KikiStone', s.x/2-2, s.y/2, 1)
|
||||
world.addObjectAtPos('KikiStone', s.x/2+2, s.y/2, 4)
|
||||
world.addObjectAtPos('KikiStone', s.x/2-2, s.y/2, 4)
|
||||
|
||||
exit_switch = KikiSwitch()
|
||||
exit_switch.getEventWithName("switched").addAction(continuous(() -> world.toggle("exit")))
|
||||
world.addObjectAtPos(exit_switch, KikiPos(s.x/2, s.y/2, 0))
|
||||
world.addObjectAtPos(exit_switch, s.x/2, s.y/2, 0)
|
||||
|
|
@ -23,43 +23,42 @@ module.exports =
|
|||
create: ->
|
||||
s = world.size
|
||||
|
||||
world.addObjectAtPos('KikiStone', KikiPos(0,0,1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(0,1,0))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(1,0,1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(1,1,0))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(2,0,0))
|
||||
world.addObjectAtPos('KikiStone', 0,0,1)
|
||||
world.addObjectAtPos('KikiStone', 0,1,0)
|
||||
world.addObjectAtPos('KikiStone', 1,0,1)
|
||||
world.addObjectAtPos('KikiStone', 1,1,0)
|
||||
world.addObjectAtPos('KikiStone', 2,0,0)
|
||||
switch1 = KikiSwitch()
|
||||
world.addObjectAtPos(switch1, KikiPos(1,0,0))
|
||||
world.addObjectAtPos(switch1, 1,0,0)
|
||||
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x-1,0,1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x-1,1,0))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x-2,0,1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x-2,1,0))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x-3,0,0))
|
||||
world.addObjectAtPos('KikiStone', s.x-1,0,1)
|
||||
world.addObjectAtPos('KikiStone', s.x-1,1,0)
|
||||
world.addObjectAtPos('KikiStone', s.x-2,0,1)
|
||||
world.addObjectAtPos('KikiStone', s.x-2,1,0)
|
||||
world.addObjectAtPos('KikiStone', s.x-3,0,0)
|
||||
switch2 = KikiSwitch()
|
||||
world.addObjectAtPos(switch2, KikiPos(s.x-2,0,0))
|
||||
world.addObjectAtPos(switch2, s.x-2,0,0)
|
||||
|
||||
world.addObjectAtPos('KikiStone', KikiPos(0,0,s.z-2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(0,1,s.z-1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(1,0,s.z-2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(1,1,s.z-1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(2,0,s.z-1))
|
||||
world.addObjectAtPos('KikiStone', 0,0,s.z-2)
|
||||
world.addObjectAtPos('KikiStone', 0,1,s.z-1)
|
||||
world.addObjectAtPos('KikiStone', 1,0,s.z-2)
|
||||
world.addObjectAtPos('KikiStone', 1,1,s.z-1)
|
||||
world.addObjectAtPos('KikiStone', 2,0,s.z-1)
|
||||
switch3 = KikiSwitch()
|
||||
world.addObjectAtPos(switch3, KikiPos(1,0,s.z-1))
|
||||
world.addObjectAtPos(switch3, 1,0,s.z-1)
|
||||
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x-1,0,s.z-2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x-1,1,s.z-1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x-2,0,s.z-2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x-2,1,s.z-1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x-3,0,s.z-1))
|
||||
world.addObjectAtPos('KikiStone', s.x-1,0,s.z-2)
|
||||
world.addObjectAtPos('KikiStone', s.x-1,1,s.z-1)
|
||||
world.addObjectAtPos('KikiStone', s.x-2,0,s.z-2)
|
||||
world.addObjectAtPos('KikiStone', s.x-2,1,s.z-1)
|
||||
world.addObjectAtPos('KikiStone', s.x-3,0,s.z-1)
|
||||
switch4 = KikiSwitch()
|
||||
world.addObjectAtPos(switch4, KikiPos(s.x-2,0,s.z-1))
|
||||
world.addObjectAtPos(switch4, s.x-2,0,s.z-1)
|
||||
|
||||
world.addObjectPoly('KikiStone', [KikiPos(s.x/2-1,s.y-1,s.z/2-1), KikiPos(s.x/2-1,s.y-1,s.z/2+1), \
|
||||
KikiPos(s.x/2+1,s.y-1,s.z/2+1), KikiPos(s.x/2+1,s.y-1,s.z/2-1)])
|
||||
world.addObjectPoly('KikiStone', [ [s.x/2-1,s.y-1,s.z/2-1], [s.x/2-1,s.y-1,s.z/2+1], [s.x/2+1,s.y-1,s.z/2+1], [s.x/2+1,s.y-1,s.z/2-1]])
|
||||
switch5 = KikiSwitch()
|
||||
world.addObjectAtPos('KikiStone', KikiPos(s.x/2,s.y-2,s.z/2))
|
||||
world.addObjectAtPos(switch5, KikiPos(s.x/2,s.y-1,s.z/2))
|
||||
world.addObjectAtPos('KikiStone', s.x/2,s.y-2,s.z/2)
|
||||
world.addObjectAtPos(switch5, s.x/2,s.y-1,s.z/2)
|
||||
|
||||
world.switch_counter = 0
|
||||
|
||||
|
|
|
@ -68,42 +68,42 @@ module.exports =
|
|||
|
||||
# Invisimaze
|
||||
for y in [0, 1]
|
||||
world.addObjectLine('KikiStone', KikiPos(4, y, 2), KikiPos(4, y, 5))
|
||||
world.addObjectLine('KikiStone', KikiPos(5, y, 2), KikiPos(7, y, 2))
|
||||
world.addObjectLine('KikiStone', 4, y, 2, 4, y, 5)
|
||||
world.addObjectLine('KikiStone', 5, y, 2, 7, y, 2)
|
||||
|
||||
# for y in [0]
|
||||
# for x in [2]
|
||||
world.addObjectPoly('KikiStone', [world.decenter(-2, 0, -2), world.decenter(-2, 0, 2), world.decenter(2, 0, 2), world.decenter(2, 0, -2)])
|
||||
|
||||
world.addObjectPoly('KikiStone', [KikiPos(2, 4, 2), KikiPos(2, 4, 4), KikiPos(4, 4, 4), KikiPos(4, 4, 2)])
|
||||
world.addObjectPoly('KikiStone', [[2, 4, 2], [2, 4, 4], [4, 4, 4], [4, 4, 2]])
|
||||
|
||||
world.addObjectAtPos('KikiStone', KikiPos(2, 3, 2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(6, 3, 1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(6, 3, 3))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(2, 1, 1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(3, 0, 1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(2, 1, 2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(2, 0, 2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(4, 2, 3))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(5, 2, 2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(5, 2, 1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(4, 2, 1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(3, 2, 2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(3, 2, 3))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(5, 3, 0))
|
||||
world.addObjectAtPos('KikiStone', 2, 3, 2)
|
||||
world.addObjectAtPos('KikiStone', 6, 3, 1)
|
||||
world.addObjectAtPos('KikiStone', 6, 3, 3)
|
||||
world.addObjectAtPos('KikiStone', 2, 1, 1)
|
||||
world.addObjectAtPos('KikiStone', 3, 0, 1)
|
||||
world.addObjectAtPos('KikiStone', 2, 1, 2)
|
||||
world.addObjectAtPos('KikiStone', 2, 0, 2)
|
||||
world.addObjectAtPos('KikiStone', 4, 2, 3)
|
||||
world.addObjectAtPos('KikiStone', 5, 2, 2)
|
||||
world.addObjectAtPos('KikiStone', 5, 2, 1)
|
||||
world.addObjectAtPos('KikiStone', 4, 2, 1)
|
||||
world.addObjectAtPos('KikiStone', 3, 2, 2)
|
||||
world.addObjectAtPos('KikiStone', 3, 2, 3)
|
||||
world.addObjectAtPos('KikiStone', 5, 3, 0)
|
||||
|
||||
world.addObjectAtPos('KikiStone', KikiPos(6, 4, 0))
|
||||
world.addObjectAtPos('KikiStone', 6, 4, 0)
|
||||
|
||||
#the bombLock
|
||||
world.addObjectAtPos('KikiStone', KikiPos(7, 1, 2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(7, 1, 3))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(7, 3, 2))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(7, 2, 1))
|
||||
world.addObjectAtPos('KikiStone', KikiPos(7, 2, 2))
|
||||
world.addObjectAtPos('KikiBomb', KikiPos(7, 2, 2))
|
||||
world.addObjectAtPos('KikiStone', 7, 1, 2)
|
||||
world.addObjectAtPos('KikiStone', 7, 1, 3)
|
||||
world.addObjectAtPos('KikiStone', 7, 3, 2)
|
||||
world.addObjectAtPos('KikiStone', 7, 2, 1)
|
||||
world.addObjectAtPos('KikiStone', 7, 2, 2)
|
||||
world.addObjectAtPos('KikiBomb', 7, 2, 2)
|
||||
|
||||
# Exit 1 is blocked!!!
|
||||
world.addObjectAtPos('KikiMotorCylinder', KikiPos(1, 2, 2))
|
||||
world.addObjectAtPos('KikiMotorCylinder', 1, 2, 2)
|
||||
|
||||
# Walls
|
||||
# for y in [-4,]
|
||||
|
|
|
@ -16,28 +16,28 @@ module.exports =
|
|||
]
|
||||
create: ->
|
||||
s = world.size
|
||||
world.addObjectAtPos(KikiMotorGear(KikiFace.X), KikiPos(0,2,4))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(0,2,3))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(0,2,5))
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.X), KikiPos(1,2,4))
|
||||
world.addObjectAtPos(KikiMotorGear(KikiFace.X), 0,2,4)
|
||||
world.addObjectAtPos('KikiWall', 0,2,3)
|
||||
world.addObjectAtPos('KikiWall', 0,2,5)
|
||||
world.addObjectAtPos(KikiMotorCylinder(KikiFace.X), 1,2,4)
|
||||
|
||||
world.addObjectAtPos(KikiWireStone(), KikiPos(0,2,6))
|
||||
world.addObjectAtPos(KikiWireStone(), 0,2,6)
|
||||
|
||||
for i in range(1,9,2)
|
||||
world.addObjectAtPos('KikiWall', KikiPos(4,0,i))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(4,4,i))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(0,0,i))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(0,4,i))
|
||||
world.addObjectAtPos('KikiWall', 4,0,i)
|
||||
world.addObjectAtPos('KikiWall', 4,4,i)
|
||||
world.addObjectAtPos('KikiWall', 0,0,i)
|
||||
world.addObjectAtPos('KikiWall', 0,4,i)
|
||||
for i in range(2,8,2)
|
||||
gear = KikiGear(KikiFace.X)
|
||||
world.addObjectAtPos(gear, KikiPos(0,1,i))
|
||||
world.addObjectAtPos(gear, 0,1,i)
|
||||
if i == 4
|
||||
gear.setActive(true)
|
||||
gear = KikiGear(KikiFace.X)
|
||||
world.addObjectAtPos(gear, KikiPos(0,3,i))
|
||||
world.addObjectAtPos(gear, 0,3,i)
|
||||
if i == 4
|
||||
gear.setActive(true)
|
||||
|
||||
world.addObjectAtPos(KikiGenerator(KikiFace.X), KikiPos(0,2,2))
|
||||
world.addObjectAtPos(KikiGenerator(KikiFace.X), 0,2,2)
|
||||
|
||||
|
|
@ -26,52 +26,52 @@ module.exports =
|
|||
# | #| |
|
||||
# | ##k| -> x
|
||||
|
||||
world.addObjectAtPos('KikiWall', KikiPos(1,0,0))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(2,0,0))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(3,1,0))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(1,2,0))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(2,3,0))
|
||||
world.addObjectAtPos('KikiWall', 1,0,0)
|
||||
world.addObjectAtPos('KikiWall', 2,0,0)
|
||||
world.addObjectAtPos('KikiWall', 3,1,0)
|
||||
world.addObjectAtPos('KikiWall', 1,2,0)
|
||||
world.addObjectAtPos('KikiWall', 2,3,0)
|
||||
|
||||
#level 1|# # |
|
||||
# |# ##|
|
||||
# |## #|
|
||||
# | # |
|
||||
world.addObjectAtPos('KikiWall', KikiPos(2,0,1))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(0,1,1))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(1,1,1))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(3,1,1))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(0,2,1))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(2,2,1))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(3,2,1))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(0,3,1))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(2,3,1))
|
||||
world.addObjectAtPos('KikiWall', 2,0,1)
|
||||
world.addObjectAtPos('KikiWall', 0,1,1)
|
||||
world.addObjectAtPos('KikiWall', 1,1,1)
|
||||
world.addObjectAtPos('KikiWall', 3,1,1)
|
||||
world.addObjectAtPos('KikiWall', 0,2,1)
|
||||
world.addObjectAtPos('KikiWall', 2,2,1)
|
||||
world.addObjectAtPos('KikiWall', 3,2,1)
|
||||
world.addObjectAtPos('KikiWall', 0,3,1)
|
||||
world.addObjectAtPos('KikiWall', 2,3,1)
|
||||
|
||||
#level 2| ###|
|
||||
# |# ##|
|
||||
# | #e#|
|
||||
# |### |
|
||||
world.addObjectAtPos('KikiWall', KikiPos(0,0,2))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(1,0,2))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(2,0,2))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(1,1,2))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(3,1,2))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(0,2,2))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(2,2,2))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(3,2,2))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(1,3,2))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(2,3,2))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(3,3,2))
|
||||
world.addObjectAtPos('KikiWall', 0,0,2)
|
||||
world.addObjectAtPos('KikiWall', 1,0,2)
|
||||
world.addObjectAtPos('KikiWall', 2,0,2)
|
||||
world.addObjectAtPos('KikiWall', 1,1,2)
|
||||
world.addObjectAtPos('KikiWall', 3,1,2)
|
||||
world.addObjectAtPos('KikiWall', 0,2,2)
|
||||
world.addObjectAtPos('KikiWall', 2,2,2)
|
||||
world.addObjectAtPos('KikiWall', 3,2,2)
|
||||
world.addObjectAtPos('KikiWall', 1,3,2)
|
||||
world.addObjectAtPos('KikiWall', 2,3,2)
|
||||
world.addObjectAtPos('KikiWall', 3,3,2)
|
||||
|
||||
#level 3| # |
|
||||
# | # |
|
||||
# | ## |
|
||||
# | |
|
||||
world.addObjectAtPos('KikiWall', KikiPos(1,1,3))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(2,1,3))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(2,2,3))
|
||||
world.addObjectAtPos('KikiWall', KikiPos(1,3,3))
|
||||
world.addObjectAtPos('KikiWall', 1,1,3)
|
||||
world.addObjectAtPos('KikiWall', 2,1,3)
|
||||
world.addObjectAtPos('KikiWall', 2,2,3)
|
||||
world.addObjectAtPos('KikiWall', 1,3,3)
|
||||
|
||||
world.addObjectAtPos(KikiLight(), KikiPos(3,0,0))
|
||||
world.addObjectAtPos(KikiLight(), 3,0,0)
|
||||
|
||||
world.setCameraMode(world.CAMERA_INSIDE)
|
||||
|
|
@ -32,5 +32,5 @@ module.exports =
|
|||
for j in [0...s.y]
|
||||
for l in [0...s.z]
|
||||
if (i+1)%2 and (j+1)%2 and (l+1)%2
|
||||
world.addObjectAtPos(KikiStone(KColor(0.1*i,0.1*j,0.1*l,middlemin(i,j,l)), true) , KikiPos(i,j,l))
|
||||
world.addObjectAtPos(KikiStone(KColor(0.1*i,0.1*j,0.1*l,middlemin(i,j,l)), true) , i,j,l)
|
||||
|
|
@ -44,4 +44,4 @@ module.exports =
|
|||
|
||||
# exit_switch = KikiSwitch()
|
||||
# exit_switch.getEventWithName("switched").addAction(continuous(()-> world.toggle("exit")))
|
||||
# world.addObjectAtPos(exit_switch, KikiPos(s.x/2, s.y/2, 0))
|
||||
# world.addObjectAtPos(exit_switch, s.x/2, s.y/2, 0))
|
||||
|
|
|
@ -18,24 +18,24 @@ module.exports =
|
|||
supercube = (point=[5,5,5],size=2,obj=KikiWall) ->
|
||||
p=point
|
||||
s=size
|
||||
world.addObjectPoly(obj,[KikiPos(p[0]+s,p[1]+s,p[2]),
|
||||
KikiPos(p[0]+s,p[1]-s,p[2]),
|
||||
KikiPos(p[0]-s,p[1]-s,p[2]),
|
||||
KikiPos(p[0]-s,p[1]+s,p[2]) ])
|
||||
world.addObjectPoly(obj,[KikiPos(p[0]+s,p[1],p[2]+s),
|
||||
KikiPos(p[0]+s,p[1],p[2]-s),
|
||||
KikiPos(p[0]-s,p[1],p[2]-s),
|
||||
KikiPos(p[0]-s,p[1],p[2]+s) ])
|
||||
world.addObjectPoly(obj,[KikiPos(p[0],p[1]+s,p[2]+s),
|
||||
KikiPos(p[0],p[1]+s,p[2]-s),
|
||||
KikiPos(p[0],p[1]-s,p[2]-s),
|
||||
KikiPos(p[0],p[1]-s,p[2]+s) ])
|
||||
world.addObjectPoly(obj,[[p[0]+s,p[1]+s,p[2]],
|
||||
[p[0]+s,p[1]-s,p[2]],
|
||||
[p[0]-s,p[1]-s,p[2]],
|
||||
[p[0]-s,p[1]+s,p[2]] ])
|
||||
world.addObjectPoly(obj,[[p[0]+s,p[1],p[2]+s],
|
||||
[p[0]+s,p[1],p[2]-s],
|
||||
[p[0]-s,p[1],p[2]-s],
|
||||
[p[0]-s,p[1],p[2]+s] ])
|
||||
world.addObjectPoly(obj,[[p[0],p[1]+s,p[2]+s],
|
||||
[p[0],p[1]+s,p[2]-s],
|
||||
[p[0],p[1]-s,p[2]-s],
|
||||
[p[0],p[1]-s,p[2]+s] ])
|
||||
|
||||
s = world.size
|
||||
world.addObjectLine(KikiWall, KikiPos(1,1,1), KikiPos(9,9,9))
|
||||
world.addObjectLine(KikiWall, KikiPos(1,1,9), KikiPos(9,9,1))
|
||||
world.addObjectLine(KikiWall, KikiPos(1,9,1), KikiPos(9,1,9))
|
||||
world.addObjectLine(KikiWall, KikiPos(9,1,1), KikiPos(1,9,9))
|
||||
world.addObjectLine(KikiWall, 1,1,1, 9,9,9)
|
||||
world.addObjectLine(KikiWall, 1,1,9, 9,9,1)
|
||||
world.addObjectLine(KikiWall, 1,9,1, 9,1,9)
|
||||
world.addObjectLine(KikiWall, 9,1,1, 1,9,9)
|
||||
world.deleteObject(world.getOccupantAtPos(world.decenter(0,0,0)))
|
||||
supercube(point=[5,5,5],size=5,obj=KikiWall)
|
||||
supercube(point=[5,5,5],size=3,obj=KikiStone)
|
||||
|
|
|
@ -23,18 +23,18 @@ module.exports =
|
|||
for j in [0...s.y]
|
||||
for l in [0..s.z/2]
|
||||
if Math.po(-1, i+j+l) == 1 and not (d<=i<=s.x-d-1 and d<=j<=s.y-d-1 and d<=l)
|
||||
world.addObjectAtPos(KikiStone(KColor(0.3,0.3,1.0,0.9), true) , KikiPos(i,j,l))
|
||||
world.addObjectAtPos(KikiStone(KColor(0.3,0.3,1.0,0.9), true) , i,j,l)
|
||||
|
||||
stone=KikiWall
|
||||
|
||||
for h in [ s.z/2 -1, s.z-5]
|
||||
world.addObjectPoly(stone,[ KikiPos(0,0,h),KikiPos(s.x-1,0,h),KikiPos(s.x-1,s.y-1,h),KikiPos(0,s.y-1,h)],close=1)
|
||||
world.addObjectPoly(stone,[ [0,0,h],[s.x-1,0,h],[s.x-1,s.y-1,h],[0,s.y-1,h]],close=1)
|
||||
|
||||
# for (i,j) in [ (m,n) for m in range(s.x) for n in range(s.y) ]
|
||||
for i in [0...s.x]
|
||||
for j in [0...s.y]
|
||||
if Math.pow(-1,i+j) == 1
|
||||
world.addObjectAtPos(KikiWall(), KikiPos(i,j,s.z-1))
|
||||
world.addObjectAtPos(KikiWall(), KikiPos(i,j,s.z-2))
|
||||
world.addObjectAtPos(KikiWall(), KikiPos(i,j,s.z-3))
|
||||
world.addObjectAtPos(KikiWall(), i,j,s.z-1)
|
||||
world.addObjectAtPos(KikiWall(), i,j,s.z-2)
|
||||
world.addObjectAtPos(KikiWall(), i,j,s.z-3)
|
||||
|
|
@ -21,216 +21,216 @@ module.exports =
|
|||
]
|
||||
create: ->
|
||||
#startblock
|
||||
world.addObjectAtPos(KikiWall(), KikiPos(1,2,2))
|
||||
world.addObjectAtPos(KikiWall(), KikiPos(1,18,2))
|
||||
world.addObjectAtPos(KikiWall(), KikiPos(1,2,18))
|
||||
world.addObjectAtPos(KikiWall(), KikiPos(1,18,18))
|
||||
|
||||
world.addObjectAtPos(KikiWall(), KikiPos(19,2,2))
|
||||
world.addObjectAtPos(KikiWall(), KikiPos(19,18,2))
|
||||
world.addObjectAtPos(KikiWall(), KikiPos(19,2,18))
|
||||
world.addObjectAtPos(KikiWall(), KikiPos(19,18,18))
|
||||
|
||||
world.addObjectAtPos(KikiLight(), KikiPos(0,0,0))
|
||||
world.addObjectAtPos(KikiLight(), KikiPos(20,20,20))
|
||||
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,2,6))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,2,6))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(12,4,6))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(14,16,6))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(2,16,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(2,14,15))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(2,12,13))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(4,4,13))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(6,4,11))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,4,13))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,6,11))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(6,6,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,5,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(10,6,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,17,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(10,15,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,15,6))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,13,10))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(6,13,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,15,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,15,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,17,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(15,15,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(9,13,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,13,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,15,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,13,7))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,12,5))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,12,11))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,7,11))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,7,13))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,17,13))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(18,17,11))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(18,7,9))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(15,9,9))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(17,11,9))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(15,11,5))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(13,11,3))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(2,11,5))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(2,13,18))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,11,18))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,9,18))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,11,18))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,9,10))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,11,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,13,10))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,8,8))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,6,16))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,4,5))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(18,6,5))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(15,8,5))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(15,6,8))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(10,6,6))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,6,10))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,4,7))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(10,4,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,4,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,6,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,4,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,6,16))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,8,16))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,10,7))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,13,9))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,15,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,13,10))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,7,8))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,13,6))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(4,13,8))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(4,15,15))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(4,18,17))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(6,18,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(10,18,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(4,18,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(18,16,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(18,18,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(16,5,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(16,3,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,5,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,7,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(13,9,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,9,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(2,9,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(2,11,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(4,11,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(17,9,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(17,7,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(15,7,8))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(17,15,8))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(17,13,15))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(6,11,15))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(6,13,10))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(6,2,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(10,4,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(12,4,10))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(14,4,11))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(14,2,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,4,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,14,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,7,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,5,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,3,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,5,9))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,5,7))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,6,7))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(10,4,7))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(12,10,7))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,12,7))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,12,7))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(13,12,5))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,12,3))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,10,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,8,13))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,10,15))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,12,17))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(10,3,17))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(11,3,15))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(13,3,13))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(13,5,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(14,7,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(16,18,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(14,18,6))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(12,18,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(16,18,16))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(2,18,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(10,18,16))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,18,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,18,5))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,18,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,16,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,16,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,14,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,12,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(10,12,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(12,6,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(14,6,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(14,9,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(14,3,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(11,3,10))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(9,3,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,3,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,5,3))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,7,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,15,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(18,17,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(17,17,10))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(17,15,15))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(10,13,15))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,11,15))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(8,7,17))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(18,9,17))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(16,7,17))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(14,3,17))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(16,6,17))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(14,6,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(15,8,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(17,8,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(14,8,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(16,2,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(14,6,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(16,6,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(18,6,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(18,4,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,6,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,6,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(6,6,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(10,4,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,2,12))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,2,10))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(2,2,8))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(2,4,13))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(15,4,15))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(13,4,15))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(13,2,7))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(11,15,7))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(9,11,7))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,2,7))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(9,2,14))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(9,4,18))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(9,2,15))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,2,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,4,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(5,6,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(12,4,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,4,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,12,6))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(2,12,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(15,14,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(7,12,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(9,12,2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(14,12,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(12,3,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(14,10,4))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(16,10,13))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(15,8,13))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(15,6,8))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(17,15,8))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(6,15,10))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(3,13,10))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(15,15,10))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(19,4,4))
|
||||
world.addObjectAtPos(KikiWall(), 1,2,2)
|
||||
world.addObjectAtPos(KikiWall(), 1,18,2)
|
||||
world.addObjectAtPos(KikiWall(), 1,2,18)
|
||||
world.addObjectAtPos(KikiWall(), 1,18,18)
|
||||
|
||||
world.addObjectAtPos(KikiWall(), 19,2,2)
|
||||
world.addObjectAtPos(KikiWall(), 19,18,2)
|
||||
world.addObjectAtPos(KikiWall(), 19,2,18)
|
||||
world.addObjectAtPos(KikiWall(), 19,18,18)
|
||||
|
||||
world.addObjectAtPos(KikiLight(), 0,0,0)
|
||||
world.addObjectAtPos(KikiLight(), 20,20,20)
|
||||
|
||||
world.addObjectAtPos(KikiStone(), 3,2,6)
|
||||
world.addObjectAtPos(KikiStone(), 5,2,6)
|
||||
world.addObjectAtPos(KikiStone(), 12,4,6)
|
||||
world.addObjectAtPos(KikiStone(), 14,16,6)
|
||||
world.addObjectAtPos(KikiStone(), 2,16,4)
|
||||
world.addObjectAtPos(KikiStone(), 2,14,15)
|
||||
world.addObjectAtPos(KikiStone(), 2,12,13)
|
||||
world.addObjectAtPos(KikiStone(), 4,4,13)
|
||||
world.addObjectAtPos(KikiStone(), 6,4,11)
|
||||
world.addObjectAtPos(KikiStone(), 8,4,13)
|
||||
world.addObjectAtPos(KikiStone(), 8,6,11)
|
||||
world.addObjectAtPos(KikiStone(), 6,6,4)
|
||||
world.addObjectAtPos(KikiStone(), 8,5,4)
|
||||
world.addObjectAtPos(KikiStone(), 10,6,4)
|
||||
world.addObjectAtPos(KikiStone(), 8,17,4)
|
||||
world.addObjectAtPos(KikiStone(), 10,15,4)
|
||||
world.addObjectAtPos(KikiStone(), 8,15,6)
|
||||
world.addObjectAtPos(KikiStone(), 8,13,10)
|
||||
world.addObjectAtPos(KikiStone(), 6,13,12)
|
||||
world.addObjectAtPos(KikiStone(), 5,15,12)
|
||||
world.addObjectAtPos(KikiStone(), 5,15,14)
|
||||
world.addObjectAtPos(KikiStone(), 3,17,14)
|
||||
world.addObjectAtPos(KikiStone(), 15,15,14)
|
||||
world.addObjectAtPos(KikiStone(), 9,13,14)
|
||||
world.addObjectAtPos(KikiStone(), 7,13,14)
|
||||
world.addObjectAtPos(KikiStone(), 7,15,12)
|
||||
world.addObjectAtPos(KikiStone(), 7,13,7)
|
||||
world.addObjectAtPos(KikiStone(), 7,12,5)
|
||||
world.addObjectAtPos(KikiStone(), 5,12,11)
|
||||
world.addObjectAtPos(KikiStone(), 7,7,11)
|
||||
world.addObjectAtPos(KikiStone(), 5,7,13)
|
||||
world.addObjectAtPos(KikiStone(), 3,17,13)
|
||||
world.addObjectAtPos(KikiStone(), 18,17,11)
|
||||
world.addObjectAtPos(KikiStone(), 18,7,9)
|
||||
world.addObjectAtPos(KikiStone(), 15,9,9)
|
||||
world.addObjectAtPos(KikiStone(), 17,11,9)
|
||||
world.addObjectAtPos(KikiStone(), 15,11,5)
|
||||
world.addObjectAtPos(KikiStone(), 13,11,3)
|
||||
world.addObjectAtPos(KikiStone(), 2,11,5)
|
||||
world.addObjectAtPos(KikiStone(), 2,13,18)
|
||||
world.addObjectAtPos(KikiStone(), 7,11,18)
|
||||
world.addObjectAtPos(KikiStone(), 7,9,18)
|
||||
world.addObjectAtPos(KikiStone(), 3,11,18)
|
||||
world.addObjectAtPos(KikiStone(), 3,9,10)
|
||||
world.addObjectAtPos(KikiStone(), 3,11,4)
|
||||
world.addObjectAtPos(KikiStone(), 3,13,10)
|
||||
world.addObjectAtPos(KikiStone(), 3,8,8)
|
||||
world.addObjectAtPos(KikiStone(), 3,6,16)
|
||||
world.addObjectAtPos(KikiStone(), 3,4,5)
|
||||
world.addObjectAtPos(KikiStone(), 18,6,5)
|
||||
world.addObjectAtPos(KikiStone(), 15,8,5)
|
||||
world.addObjectAtPos(KikiStone(), 15,6,8)
|
||||
world.addObjectAtPos(KikiStone(), 10,6,6)
|
||||
world.addObjectAtPos(KikiStone(), 8,6,10)
|
||||
world.addObjectAtPos(KikiStone(), 8,4,7)
|
||||
world.addObjectAtPos(KikiStone(), 10,4,12)
|
||||
world.addObjectAtPos(KikiStone(), 5,4,14)
|
||||
world.addObjectAtPos(KikiStone(), 8,6,14)
|
||||
world.addObjectAtPos(KikiStone(), 7,4,14)
|
||||
world.addObjectAtPos(KikiStone(), 7,6,16)
|
||||
world.addObjectAtPos(KikiStone(), 8,8,16)
|
||||
world.addObjectAtPos(KikiStone(), 8,10,7)
|
||||
world.addObjectAtPos(KikiStone(), 8,13,9)
|
||||
world.addObjectAtPos(KikiStone(), 8,15,4)
|
||||
world.addObjectAtPos(KikiStone(), 8,13,10)
|
||||
world.addObjectAtPos(KikiStone(), 8,7,8)
|
||||
world.addObjectAtPos(KikiStone(), 8,13,6)
|
||||
world.addObjectAtPos(KikiStone(), 4,13,8)
|
||||
world.addObjectAtPos(KikiStone(), 4,15,15)
|
||||
world.addObjectAtPos(KikiStone(), 4,18,17)
|
||||
world.addObjectAtPos(KikiStone(), 6,18,2)
|
||||
world.addObjectAtPos(KikiStone(), 10,18,4)
|
||||
world.addObjectAtPos(KikiStone(), 4,18,2)
|
||||
world.addObjectAtPos(KikiStone(), 18,16,2)
|
||||
world.addObjectAtPos(KikiStone(), 18,18,4)
|
||||
world.addObjectAtPos(KikiStone(), 16,5,4)
|
||||
world.addObjectAtPos(KikiStone(), 16,3,4)
|
||||
world.addObjectAtPos(KikiStone(), 3,5,4)
|
||||
world.addObjectAtPos(KikiStone(), 3,7,2)
|
||||
world.addObjectAtPos(KikiStone(), 13,9,2)
|
||||
world.addObjectAtPos(KikiStone(), 8,9,4)
|
||||
world.addObjectAtPos(KikiStone(), 2,9,2)
|
||||
world.addObjectAtPos(KikiStone(), 2,11,2)
|
||||
world.addObjectAtPos(KikiStone(), 4,11,12)
|
||||
world.addObjectAtPos(KikiStone(), 17,9,12)
|
||||
world.addObjectAtPos(KikiStone(), 17,7,14)
|
||||
world.addObjectAtPos(KikiStone(), 15,7,8)
|
||||
world.addObjectAtPos(KikiStone(), 17,15,8)
|
||||
world.addObjectAtPos(KikiStone(), 17,13,15)
|
||||
world.addObjectAtPos(KikiStone(), 6,11,15)
|
||||
world.addObjectAtPos(KikiStone(), 6,13,10)
|
||||
world.addObjectAtPos(KikiStone(), 6,2,12)
|
||||
world.addObjectAtPos(KikiStone(), 10,4,12)
|
||||
world.addObjectAtPos(KikiStone(), 12,4,10)
|
||||
world.addObjectAtPos(KikiStone(), 14,4,11)
|
||||
world.addObjectAtPos(KikiStone(), 14,2,12)
|
||||
world.addObjectAtPos(KikiStone(), 3,4,12)
|
||||
world.addObjectAtPos(KikiStone(), 5,14,12)
|
||||
world.addObjectAtPos(KikiStone(), 7,7,12)
|
||||
world.addObjectAtPos(KikiStone(), 7,5,2)
|
||||
world.addObjectAtPos(KikiStone(), 3,3,2)
|
||||
world.addObjectAtPos(KikiStone(), 3,5,9)
|
||||
world.addObjectAtPos(KikiStone(), 5,5,7)
|
||||
world.addObjectAtPos(KikiStone(), 7,6,7)
|
||||
world.addObjectAtPos(KikiStone(), 10,4,7)
|
||||
world.addObjectAtPos(KikiStone(), 12,10,7)
|
||||
world.addObjectAtPos(KikiStone(), 3,12,7)
|
||||
world.addObjectAtPos(KikiStone(), 5,12,7)
|
||||
world.addObjectAtPos(KikiStone(), 13,12,5)
|
||||
world.addObjectAtPos(KikiStone(), 8,12,3)
|
||||
world.addObjectAtPos(KikiStone(), 8,10,2)
|
||||
world.addObjectAtPos(KikiStone(), 8,8,13)
|
||||
world.addObjectAtPos(KikiStone(), 8,10,15)
|
||||
world.addObjectAtPos(KikiStone(), 8,12,17)
|
||||
world.addObjectAtPos(KikiStone(), 10,3,17)
|
||||
world.addObjectAtPos(KikiStone(), 11,3,15)
|
||||
world.addObjectAtPos(KikiStone(), 13,3,13)
|
||||
world.addObjectAtPos(KikiStone(), 13,5,12)
|
||||
world.addObjectAtPos(KikiStone(), 14,7,12)
|
||||
world.addObjectAtPos(KikiStone(), 16,18,12)
|
||||
world.addObjectAtPos(KikiStone(), 14,18,6)
|
||||
world.addObjectAtPos(KikiStone(), 12,18,14)
|
||||
world.addObjectAtPos(KikiStone(), 16,18,16)
|
||||
world.addObjectAtPos(KikiStone(), 2,18,14)
|
||||
world.addObjectAtPos(KikiStone(), 10,18,16)
|
||||
world.addObjectAtPos(KikiStone(), 7,18,14)
|
||||
world.addObjectAtPos(KikiStone(), 5,18,5)
|
||||
world.addObjectAtPos(KikiStone(), 3,18,12)
|
||||
world.addObjectAtPos(KikiStone(), 5,16,12)
|
||||
world.addObjectAtPos(KikiStone(), 5,16,14)
|
||||
world.addObjectAtPos(KikiStone(), 5,14,2)
|
||||
world.addObjectAtPos(KikiStone(), 8,12,2)
|
||||
world.addObjectAtPos(KikiStone(), 10,12,12)
|
||||
world.addObjectAtPos(KikiStone(), 12,6,12)
|
||||
world.addObjectAtPos(KikiStone(), 14,6,12)
|
||||
world.addObjectAtPos(KikiStone(), 14,9,14)
|
||||
world.addObjectAtPos(KikiStone(), 14,3,12)
|
||||
world.addObjectAtPos(KikiStone(), 11,3,10)
|
||||
world.addObjectAtPos(KikiStone(), 9,3,12)
|
||||
world.addObjectAtPos(KikiStone(), 7,3,12)
|
||||
world.addObjectAtPos(KikiStone(), 7,5,3)
|
||||
world.addObjectAtPos(KikiStone(), 7,7,14)
|
||||
world.addObjectAtPos(KikiStone(), 7,15,12)
|
||||
world.addObjectAtPos(KikiStone(), 18,17,12)
|
||||
world.addObjectAtPos(KikiStone(), 17,17,10)
|
||||
world.addObjectAtPos(KikiStone(), 17,15,15)
|
||||
world.addObjectAtPos(KikiStone(), 10,13,15)
|
||||
world.addObjectAtPos(KikiStone(), 8,11,15)
|
||||
world.addObjectAtPos(KikiStone(), 8,7,17)
|
||||
world.addObjectAtPos(KikiStone(), 18,9,17)
|
||||
world.addObjectAtPos(KikiStone(), 16,7,17)
|
||||
world.addObjectAtPos(KikiStone(), 14,3,17)
|
||||
world.addObjectAtPos(KikiStone(), 16,6,17)
|
||||
world.addObjectAtPos(KikiStone(), 14,6,14)
|
||||
world.addObjectAtPos(KikiStone(), 15,8,14)
|
||||
world.addObjectAtPos(KikiStone(), 17,8,12)
|
||||
world.addObjectAtPos(KikiStone(), 14,8,14)
|
||||
world.addObjectAtPos(KikiStone(), 16,2,14)
|
||||
world.addObjectAtPos(KikiStone(), 14,6,14)
|
||||
world.addObjectAtPos(KikiStone(), 16,6,14)
|
||||
world.addObjectAtPos(KikiStone(), 18,6,12)
|
||||
world.addObjectAtPos(KikiStone(), 18,4,12)
|
||||
world.addObjectAtPos(KikiStone(), 3,6,12)
|
||||
world.addObjectAtPos(KikiStone(), 3,6,14)
|
||||
world.addObjectAtPos(KikiStone(), 6,6,12)
|
||||
world.addObjectAtPos(KikiStone(), 10,4,12)
|
||||
world.addObjectAtPos(KikiStone(), 3,2,12)
|
||||
world.addObjectAtPos(KikiStone(), 3,2,10)
|
||||
world.addObjectAtPos(KikiStone(), 2,2,8)
|
||||
world.addObjectAtPos(KikiStone(), 2,4,13)
|
||||
world.addObjectAtPos(KikiStone(), 15,4,15)
|
||||
world.addObjectAtPos(KikiStone(), 13,4,15)
|
||||
world.addObjectAtPos(KikiStone(), 13,2,7)
|
||||
world.addObjectAtPos(KikiStone(), 11,15,7)
|
||||
world.addObjectAtPos(KikiStone(), 9,11,7)
|
||||
world.addObjectAtPos(KikiStone(), 7,2,7)
|
||||
world.addObjectAtPos(KikiStone(), 9,2,14)
|
||||
world.addObjectAtPos(KikiStone(), 9,4,18)
|
||||
world.addObjectAtPos(KikiStone(), 9,2,15)
|
||||
world.addObjectAtPos(KikiStone(), 7,2,4)
|
||||
world.addObjectAtPos(KikiStone(), 5,4,4)
|
||||
world.addObjectAtPos(KikiStone(), 5,6,2)
|
||||
world.addObjectAtPos(KikiStone(), 12,4,2)
|
||||
world.addObjectAtPos(KikiStone(), 3,4,4)
|
||||
world.addObjectAtPos(KikiStone(), 3,12,6)
|
||||
world.addObjectAtPos(KikiStone(), 2,12,4)
|
||||
world.addObjectAtPos(KikiStone(), 15,14,4)
|
||||
world.addObjectAtPos(KikiStone(), 7,12,4)
|
||||
world.addObjectAtPos(KikiStone(), 9,12,2)
|
||||
world.addObjectAtPos(KikiStone(), 14,12,4)
|
||||
world.addObjectAtPos(KikiStone(), 12,3,4)
|
||||
world.addObjectAtPos(KikiStone(), 14,10,4)
|
||||
world.addObjectAtPos(KikiStone(), 16,10,13)
|
||||
world.addObjectAtPos(KikiStone(), 15,8,13)
|
||||
world.addObjectAtPos(KikiStone(), 15,6,8)
|
||||
world.addObjectAtPos(KikiStone(), 17,15,8)
|
||||
world.addObjectAtPos(KikiStone(), 6,15,10)
|
||||
world.addObjectAtPos(KikiStone(), 3,13,10)
|
||||
world.addObjectAtPos(KikiStone(), 15,15,10)
|
||||
world.addObjectAtPos(KikiStone(), 19,4,4)
|
||||
|
|
|
@ -25,33 +25,33 @@ module.exports =
|
|||
|
||||
switched = ->
|
||||
unoccupied = false
|
||||
# for (i,j) in [ (i,j) for i in range(3,6) for j in range(3,6) ]
|
||||
for i in [3...6]
|
||||
for j in [3...6]
|
||||
if world.isUnoccupiedPos(KikiPos(i,j,0))
|
||||
if world.isUnoccupiedPos i,j,0
|
||||
unoccupied=true
|
||||
|
||||
world.toggle("exit") if not unoccupied
|
||||
world.toggle "exit" if not unoccupied
|
||||
|
||||
swtch = KikiSwitch()
|
||||
swtch.getEventWithName("switched").addAction(continuous(switched))
|
||||
Switch = require '../switch'
|
||||
swtch = new Switch
|
||||
swtch.getEventWithName("switched").addAction world.continuous switched
|
||||
|
||||
world.addObjectAtPos(swtch , KikiPos(0,5,0))
|
||||
world.addObjectPoly(KikiWall, [ KikiPos(2,2,0),KikiPos(2,6,0),KikiPos(6,6,0),KikiPos(6,2,0)], 1)
|
||||
world.addObjectAtPos swtch , 0,5,0
|
||||
world.addObjectPoly 'KikiWall', [ [2,2,0], [2,6,0], [6,6,0], [6,2,0] ], 1
|
||||
|
||||
#inside
|
||||
world.addObjectAtPos(KikiStone() , KikiPos(3,4,2))
|
||||
world.addObjectAtPos(KikiStone() , KikiPos(3,5,1))
|
||||
world.addObjectAtPos(KikiStone() , KikiPos(5,3,1))
|
||||
world.addObjectAtPos(KikiStone() , KikiPos(5,4,2))
|
||||
world.addObjectAtPos 'KikiStone', 3,4,2
|
||||
world.addObjectAtPos 'KikiStone', 3,5,1
|
||||
world.addObjectAtPos 'KikiStone', 5,3,1
|
||||
world.addObjectAtPos 'KikiStone', 5,4,2
|
||||
#border
|
||||
world.addObjectAtPos(KikiStone() , KikiPos(3,6,1))
|
||||
world.addObjectAtPos(KikiStone() , KikiPos(4,6,1))
|
||||
world.addObjectAtPos(KikiStone() , KikiPos(3,2,1))
|
||||
world.addObjectAtPos(KikiStone() , KikiPos(5,2,1))
|
||||
world.addObjectAtPos(KikiStone() , KikiPos(6,4,1))
|
||||
world.addObjectAtPos(KikiStone() , KikiPos(6,3,1))
|
||||
world.addObjectAtPos 'KikiStone', 3,6,1
|
||||
world.addObjectAtPos 'KikiStone', 4,6,1
|
||||
world.addObjectAtPos 'KikiStone', 3,2,1
|
||||
world.addObjectAtPos 'KikiStone', 5,2,1
|
||||
world.addObjectAtPos 'KikiStone', 6,4,1
|
||||
world.addObjectAtPos 'KikiStone', 6,3,1
|
||||
#outside
|
||||
world.addObjectAtPos(KikiStone() , KikiPos(5,1,0))
|
||||
world.addObjectAtPos(KikiStone() , KikiPos(1,7,0))
|
||||
world.addObjectAtPos 'KikiStone', 5,1,0
|
||||
world.addObjectAtPos 'KikiStone', 1,7,0
|
||||
|
|
@ -26,8 +26,8 @@ module.exports =
|
|||
# for (k,l) in [ (i,j) for i in range(b+1,s.x-b-1) for j in range(b+1,s.y-b-1) ]
|
||||
for k in [b+1..s.x-b]
|
||||
for j in [b+1..s.y-b]
|
||||
world.addObjectAtPos(KikiStone(KColor(0,1,0,0.5), true), KikiPos(k,l,b*3))
|
||||
world.addObjectAtPos(KikiStone(KColor(0,1,0,0.5), true), k,l,b*3)
|
||||
|
||||
world.addObjectAtPos(KikiWall(), KikiPos(s.x/2,s.y/2,0))
|
||||
world.addObjectAtPos(KikiStone(KColor(0,1,0,0.5), true), KikiPos(s.x/2,s.y/2,2))
|
||||
world.addObjectAtPos(KikiWall(), s.x/2,s.y/2,0)
|
||||
world.addObjectAtPos(KikiStone(KColor(0,1,0,0.5), true), s.x/2,s.y/2,2)
|
||||
|
|
@ -31,13 +31,13 @@ module.exports =
|
|||
[s.x/2+i, s.y/2+i, i-1],
|
||||
[s.x/2-i, s.y/2+i, i-1]])
|
||||
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2-2, s.y/2, 3))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2+2, s.y/2, 3))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2, s.y/2+2, 3))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2, s.y/2-2, 3))
|
||||
world.addObjectAtPos(KikiStone(), s.x/2-2, s.y/2, 3)
|
||||
world.addObjectAtPos(KikiStone(), s.x/2+2, s.y/2, 3)
|
||||
world.addObjectAtPos(KikiStone(), s.x/2, s.y/2+2, 3)
|
||||
world.addObjectAtPos(KikiStone(), s.x/2, s.y/2-2, 3)
|
||||
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2-1, s.y/2, 2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2+1, s.y/2, 2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2, s.y/2+1, 2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2, s.y/2-1, 2))
|
||||
world.addObjectAtPos(KikiStone(), s.x/2-1, s.y/2, 2)
|
||||
world.addObjectAtPos(KikiStone(), s.x/2+1, s.y/2, 2)
|
||||
world.addObjectAtPos(KikiStone(), s.x/2, s.y/2+1, 2)
|
||||
world.addObjectAtPos(KikiStone(), s.x/2, s.y/2-1, 2)
|
||||
|
|
@ -16,10 +16,10 @@ module.exports =
|
|||
],
|
||||
create: ->
|
||||
s = world.size
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2-1, s.y/2+1, 0))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2-1, s.y/2+1, 1))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2-1, s.y/2+1, 2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2+1, s.y/2+1, 0))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2+1, s.y/2+1, 1))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2+1, s.y/2+1, 2))
|
||||
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2+1, s.y/2+1, 3))
|
||||
world.addObjectAtPos(KikiStone(), s.x/2-1, s.y/2+1, 0)
|
||||
world.addObjectAtPos(KikiStone(), s.x/2-1, s.y/2+1, 1)
|
||||
world.addObjectAtPos(KikiStone(), s.x/2-1, s.y/2+1, 2)
|
||||
world.addObjectAtPos(KikiStone(), s.x/2+1, s.y/2+1, 0)
|
||||
world.addObjectAtPos(KikiStone(), s.x/2+1, s.y/2+1, 1)
|
||||
world.addObjectAtPos(KikiStone(), s.x/2+1, s.y/2+1, 2)
|
||||
world.addObjectAtPos(KikiStone(), s.x/2+1, s.y/2+1, 3)
|
||||
|
|
|
@ -40,5 +40,5 @@ module.exports =
|
|||
for j in [0...s.y]
|
||||
for l in [0...s.z]
|
||||
if i==s.x/2 or i==s.x/2-2 or i==s.x/2+2
|
||||
world.addObjectAtPos(KikiStone(KColor(0.1*i,0.1*j,0.1*l,0.6) , false) , KikiPos(i,j,l))
|
||||
world.addObjectAtPos(KikiStone(KColor(0.1*i,0.1*j,0.1*l,0.6) , false) , i,j,l)
|
||||
|
|
@ -30,7 +30,7 @@ class Pushable extends Item
|
|||
# log "Pushable.setOrientation direction:", @direction
|
||||
|
||||
pushedByObjectInDirection: (object, dir, duration) ->
|
||||
|
||||
log "pushedByObjectInDirection #{object.name} duration:#{duration}"
|
||||
pushAction = @getActionWithId Action.PUSH
|
||||
|
||||
@pusher = object
|
||||
|
@ -42,7 +42,7 @@ class Pushable extends Item
|
|||
|
||||
initAction: (action) ->
|
||||
switch action.id
|
||||
when Action.FALL
|
||||
when Action.PUSH, Action.FALL
|
||||
# log 'Pushable.initAction FALL direction:', @direction
|
||||
world.objectWillMoveToPos @, @position.plus(@direction), action.getDuration()
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@ class Stone extends Pushable
|
|||
side: THREE.DoubleSide
|
||||
shading: THREE.SmoothShading
|
||||
transparent: true
|
||||
opacity: 0.8
|
||||
opacity: 0.7
|
||||
shininess: 20
|
||||
# alphaTest: 0.05
|
||||
depthWrite: false
|
||||
# depthWrite: false
|
||||
|
||||
@mesh = new THREE.Mesh @geom, @mat
|
||||
super
|
||||
|
|
|
@ -11,13 +11,19 @@ Cage = require './cage'
|
|||
|
||||
class Wall extends Item
|
||||
|
||||
@rasterMat = new THREE.MeshPhongMaterial
|
||||
color: 0x770000
|
||||
side: THREE.FrontSide
|
||||
shading: THREE.SmoothShading
|
||||
shininess: 10
|
||||
|
||||
isSpaceEgoistic: -> true
|
||||
|
||||
constructor: ->
|
||||
|
||||
|
||||
geom = Cage.wallTiles new Pos(1,1,1), 'outside', 0
|
||||
geom.translate -0.5, -0.5, -0.5
|
||||
@raster = new THREE.Mesh geom, Cage.rasterMat
|
||||
@raster = new THREE.Mesh geom, Wall.rasterMat
|
||||
@raster.receiveShadow = true
|
||||
|
||||
geom = Cage.wallTiles new Pos(1,1,1), 'outside', Cage.gap
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
# 00 00 0000000 000 000 0000000 0000000
|
||||
{
|
||||
absMin,
|
||||
randrange,
|
||||
clamp,
|
||||
first,
|
||||
last} = require "/Users/kodi/s/ko/js/tools/tools"
|
||||
|
@ -20,6 +21,7 @@ Player = require './player'
|
|||
Cage = require './cage'
|
||||
Timer = require './timer'
|
||||
Actor = require './actor'
|
||||
Item = require './item'
|
||||
Action = require './action'
|
||||
TmpObject = require './tmpobject'
|
||||
Pushable = require './pushable'
|
||||
|
@ -364,19 +366,23 @@ class World extends Actor
|
|||
@addObject object
|
||||
|
||||
addObjectLine: (object, sx,sy,sz, ex,ey,ez) ->
|
||||
if sx instanceof Pos
|
||||
log "world.addObjectLine sx:#{sx} sy:#{sy} sz:#{sz} ex:#{ex} ey:#{ey} ez:#{ez}"
|
||||
if sx instanceof Pos or Array.isArray sx
|
||||
start = sx
|
||||
end = sy
|
||||
else
|
||||
start = new Pos sx,sy,sz
|
||||
end = new Pos ex,ey,ez
|
||||
# adds a line of objects of type to the world. start and end should be 3-tuples or Pos objects
|
||||
if start instanceof Pos
|
||||
start = [start.x, start.y, start.z]
|
||||
[sx, sy, sz] = start
|
||||
if end instanceof Pos
|
||||
end = [end.x, end.y, end.z]
|
||||
[ex, ey, ez] = end
|
||||
|
||||
if start instanceof Pos
|
||||
start = [start.x, start.y, start.z]
|
||||
[sx, sy, sz] = start
|
||||
|
||||
log "world.addObjectLine sx:#{sx} sy:#{sy} sz:#{sz} ex:#{ex} ey:#{ey} ez:#{ez}"
|
||||
|
||||
diff = [ex-sx, ey-sy, ez-sz]
|
||||
maxdiff = _.max diff.map Math.abs
|
||||
|
@ -384,24 +390,21 @@ class World extends Actor
|
|||
for i in [0...maxdiff]
|
||||
# pos = apply(Pos, (map (lambda a, b: int(a+i*b), start, deltas)))
|
||||
pos = new Pos (start[j]+i*deltas[j] for j in [0..2])
|
||||
log "addObjectLine #{i}:", pos
|
||||
if @isUnoccupiedPos pos
|
||||
@addObjectAtPos object, pos
|
||||
# if _.isString object
|
||||
# @addObjectAtPos eval(object), pos
|
||||
# else
|
||||
# @addObjectAtPos object(), pos
|
||||
|
||||
addObjectPoly: (object, points, close=1) ->
|
||||
# adds a polygon of objects of type to the world. points should be 3-tuples or Pos objects
|
||||
if close
|
||||
points.append (points[0])
|
||||
for index in range(1, len(points))
|
||||
points.push points[0]
|
||||
for index in [1...points.length]
|
||||
@addObjectLine object, points[index-1], points[index]
|
||||
|
||||
addObjectRandom: (object, number) ->
|
||||
# adds number objects of type at random positions to the world
|
||||
for i in [0...number]
|
||||
if type (object) == types.StringType
|
||||
if _.isString object
|
||||
@setObjectRandom eval object
|
||||
else
|
||||
@setObjectRandom object()
|
||||
|
@ -410,9 +413,9 @@ class World extends Actor
|
|||
# adds number objects of type at random positions to the world
|
||||
object_set = 0
|
||||
while not object_set # hack alert!
|
||||
random_pos = Pos random.randrange(@size.x),
|
||||
random.randrange(@size.y),
|
||||
random.randrange(@size.z)
|
||||
random_pos = Pos randrange(@size.x),
|
||||
randrange(@size.y),
|
||||
randrange(@size.z)
|
||||
if not object.isSpaceEgoistic() or @isUnoccupiedPos(random_pos)
|
||||
@addObjectAtPos object, random_pos
|
||||
object_set = 1
|
||||
|
@ -426,7 +429,9 @@ class World extends Actor
|
|||
getObjectsOfType: (clss) -> @objects.filter (o) -> o instanceof clss
|
||||
getObjectsOfTypeAtPos: (clss, pos) -> @getCellAtPos(pos)?.getObjectsOfType clss
|
||||
getObjectOfTypeAtPos: (clss, pos) -> @getCellAtPos(pos)?.getRealObjectOfType clss
|
||||
getOccupantAtPos: (pos) -> @getCellAtPos(pos)?.getOccupant()
|
||||
getOccupantAtPos: (pos) ->
|
||||
# log "getOccupantAtPos cell? #{@getCellAtPos(pos)?}", pos
|
||||
@getCellAtPos(pos)?.getOccupant()
|
||||
getRealOccupantAtPos: (pos) ->
|
||||
occupant = @getOccupantAtPos pos
|
||||
if occupant and occupant instanceof TmpObject
|
||||
|
@ -435,8 +440,9 @@ class World extends Actor
|
|||
occupant
|
||||
|
||||
setObjectAtPos: (object, pos) ->
|
||||
pos = new Pos pos
|
||||
if @isInvalidPos pos
|
||||
log "World.setObjectAtPos invalid pos:", pos
|
||||
log "World.setObjectAtPos [WARNING] invalid pos:", pos
|
||||
return
|
||||
|
||||
if object.isSpaceEgoistic()
|
||||
|
@ -471,10 +477,13 @@ class World extends Actor
|
|||
|
||||
newObject: (object) ->
|
||||
if _.isString object
|
||||
# log "newObject:", object
|
||||
if object.startsWith 'Kiki'
|
||||
return new (require "./#{object.slice(4).toLowerCase()}")()
|
||||
object
|
||||
return new (require "./#{object.toLowerCase()}")()
|
||||
if object instanceof Item
|
||||
return object
|
||||
else
|
||||
return object()
|
||||
|
||||
addObject: (object) ->
|
||||
object = @newObject object
|
||||
|
@ -565,79 +574,80 @@ class World extends Actor
|
|||
# 0000000 0000000 0000000 000 000 0000000 0 00000000
|
||||
|
||||
objectWillMoveToPos: (object, pos, duration) ->
|
||||
# log "world.objectWillMoveToPos #{object.name} #{duration}", pos
|
||||
|
||||
if @isInvalidPos pos
|
||||
log "world.objectWillMoveToPos [WARNING] #{object.name} invalid pos:", pos
|
||||
sourcePos = object.getPos()
|
||||
targetPos = new Pos pos
|
||||
|
||||
# log "world.objectWillMoveToPos #{object.name} #{duration}", targetPos
|
||||
|
||||
if @isInvalidPos targetPos
|
||||
log "world.objectWillMoveToPos [WARNING] #{object.name} invalid targetPos:", targetPos
|
||||
return
|
||||
|
||||
if object.getPos().eql pos
|
||||
log "world.objectWillMoveToPos [WARNING] #{object.name} equal pos:", pos
|
||||
if sourcePos.eql targetPos
|
||||
log "world.objectWillMoveToPos [WARNING] #{object.name} equal pos:", targetPos
|
||||
return
|
||||
|
||||
if cell = @getCellAtPos pos
|
||||
if objectAtNewPos = cell.getOccupant()
|
||||
targetCell = @getCellAtPos pos
|
||||
if targetCell
|
||||
if objectAtNewPos = targetCell.getOccupant()
|
||||
if objectAtNewPos instanceof TmpObject
|
||||
if objectAtNewPos.time < 0 and -objectAtNewPos.time <= duration
|
||||
# temporary object at new pos will vanish before object will arrive . delete it
|
||||
objectAtNewPos.del()
|
||||
else
|
||||
log "world.objectWillMoveToPos [WARNING] #{object.name} timing conflict at pos:", pos
|
||||
log "world.objectWillMoveToPos [WARNING] #{object.name} timing conflict at pos:", targetPos
|
||||
else
|
||||
log "world.objectWillMoveToPos [WARNING] #{object.name} already occupied:", pos
|
||||
log "world.objectWillMoveToPos [WARNING] #{object.name} already occupied:", targetPos
|
||||
|
||||
if object.name != 'player'
|
||||
log "---------- tmpObjects not player? #{object.name}"
|
||||
# log "---------- tmpObjects not player? #{object.name}"
|
||||
@unsetObject object # remove object from cell grid
|
||||
# log 'tmpObject at new pos', pos
|
||||
tmpObject = new TmpObject object # insert tmp object at new pos
|
||||
tmpObject.setPosition pos
|
||||
tmpObject.time = duration
|
||||
@addObjectAtPos tmpObject, pos
|
||||
# log 'tmpObject at old pos', object.position
|
||||
|
||||
# log 'tmpObject at old pos', sourcePos
|
||||
tmpObject = new TmpObject object # insert tmp object at old pos
|
||||
tmpObject.setPosition object.position
|
||||
tmpObject.setPosition sourcePos
|
||||
tmpObject.time = -duration
|
||||
@addObjectAtPos tmpObject, object.getPos()
|
||||
else @player.targetPos = pos
|
||||
|
||||
@addObjectAtPos tmpObject, sourcePos
|
||||
|
||||
# log 'tmpObject at new pos', targetPos
|
||||
tmpObject = new TmpObject object # insert tmp object at new pos
|
||||
tmpObject.setPosition targetPos
|
||||
tmpObject.time = duration
|
||||
@addObjectAtPos tmpObject, targetPos
|
||||
|
||||
objectMoved: (movedObject, from, to) ->
|
||||
sourcePos = new Pos from
|
||||
targetPos = new Pos to
|
||||
|
||||
# log "world.objectMoved #{movedObject.name}", sourcePos
|
||||
|
||||
# if cell = @getCellAtPos sourcePos
|
||||
# if tmpObject = cell.getObjectOfType TmpObject
|
||||
# if tmpObject.object == object
|
||||
# tmpObject.del()
|
||||
|
||||
if @isInvalidPos targetPos
|
||||
log "World.objectMoved [WARNING] #{movedObject.name} invalid targetPos:", targetPos
|
||||
return
|
||||
|
||||
# if tmpObject = @getObjectOfTypeAtPos TmpObject, pos
|
||||
# if tmpObject.object == movedObject
|
||||
# tmpObject.del()
|
||||
# else
|
||||
# log "World.updateStatus wrong tmp object at pos:", pos
|
||||
# else
|
||||
|
||||
if @isOccupiedPos targetPos
|
||||
log "World.objectMoved [WARNING] #{movedObject.name} moved to occupied pos:", targetPos
|
||||
|
||||
# log 'World.objectMovedFromPos sourcePos:', sourcePos
|
||||
# log 'World.objectMovedFromPos targetPos:', targetPos
|
||||
|
||||
# log "world.objectMoved #{movedObject.name}", sourcePos
|
||||
|
||||
sourceCell = @getCellAtPos sourcePos
|
||||
targetCell = @getCellAtPos targetPos
|
||||
|
||||
if tmpObject = sourceCell?.getObjectOfType TmpObject
|
||||
tmpObject.del() if tmpObject.object == movedObject
|
||||
|
||||
if tmpObject = targetCell?.getObjectOfType TmpObject
|
||||
tmpObject.del() if tmpObject.object == movedObject
|
||||
|
||||
if @isOccupiedPos targetPos
|
||||
log "World.objectMoved [WARNING] #{movedObject.name} occupied target pos:", targetPos
|
||||
|
||||
# log 'World.objectMovedFromPos sourcePos:', sourcePos
|
||||
# log 'World.objectMovedFromPos targetPos:', targetPos
|
||||
|
||||
if sourceCell?
|
||||
sourceCell.removeObject movedObject
|
||||
if sourceCell.isEmpty()
|
||||
# log 'world.objectMoved remove empty cell at pos:', sourcePos
|
||||
@cells[@posToIndex(sourcePos)] = null
|
||||
|
||||
|
||||
targetCell = @getCellAtPos targetPos
|
||||
if not targetCell?
|
||||
cellIndex = @posToIndex targetPos
|
||||
targetCell = new Cell()
|
||||
|
@ -645,6 +655,7 @@ class World extends Actor
|
|||
@cells[cellIndex] = targetCell
|
||||
|
||||
if targetCell?
|
||||
# log "add #{movedObject.name} to targetCell at pos", targetPos
|
||||
targetCell.addObject movedObject
|
||||
else
|
||||
log "world.objectMoved [WARNING] #{movedObject.name} no target cell?"
|
||||
|
|
Loading…
Reference in New Issue
Block a user