This commit is contained in:
monsterkodi 2016-08-08 19:32:37 +02:00
parent 142091f36f
commit 0ba80f7349
31 changed files with 217 additions and 193 deletions

View File

@ -23,12 +23,9 @@ module.exports =
s = world.getSize()
for i in [-2, 2]
world.addObjectPoly (KikiStone, [world.decenter(1, 1, i), world.decenter(1, -1, i),
world.decenter(-1, -1, i), world.decenter(-1, 1, i)])
world.addObjectPoly (KikiStone, [world.decenter(1, i, 1), world.decenter(1, i, -1),\
world.decenter(-1, i, -1), world.decenter(-1, i, 1)])
world.addObjectPoly (KikiStone, [world.decenter(i, 1, 1), world.decenter(i, 1, -1),\
world.decenter(i, -1, -1), world.decenter(i, -1, 1)])
world.addObjectPoly(KikiStone, [world.decenter(1, 1, i), world.decenter(1, -1, i), world.decenter(-1, -1, i), world.decenter(-1, 1, i)])
world.addObjectPoly(KikiStone, [world.decenter(1, i, 1), world.decenter(1, i, -1), world.decenter(-1, i, -1), world.decenter(-1, i, 1)])
world.addObjectPoly(KikiStone, [world.decenter(i, 1, 1), world.decenter(i, 1, -1), world.decenter(i, -1, -1), world.decenter(i, -1, 1)])
for i in [-4, -2, 2, 4]
world.addObjectAtPos(KikiStone(), world.decenter(i, 0, 0))

View File

@ -64,19 +64,19 @@ module.exports =
world.switch_counter = 0
switched = (switch) ->
world.switch_counter += switch.isActive() and 1 or -1
switched = (swtch) ->
world.switch_counter += swtch.isActive() and 1 or -1
exit = kikiObjectToGate(world.getObjectWithName("exit"))
exit.setActive(world.switch_counter == 4)
switch1 = KikiSwitch()
switch1.getEventWithName("switched").addAction(continuous(()-> s=switch1: switched(s)))
# switch1.getEventWithName("switched").addAction(continuous(() -> s=switch1: switched(s)))
switch2 = KikiSwitch()
switch2.getEventWithName("switched").addAction(continuous(()-> s=switch2: switched(s)))
# switch2.getEventWithName("switched").addAction(continuous(() -> s=switch2: switched(s)))
switch3 = KikiSwitch()
switch3.getEventWithName("switched").addAction(continuous(()-> s=switch3: switched(s)))
# switch3.getEventWithName("switched").addAction(continuous(() -> s=switch3: switched(s)))
switch4 = KikiSwitch()
switch4.getEventWithName("switched").addAction(continuous(()-> s=switch4: switched(s)))
# switch4.getEventWithName("switched").addAction(continuous(() -> s=switch4: switched(s)))
world.addObjectAtPos(switch1, KikiPos(1, 0 ,2))
world.addObjectAtPos(switch2, KikiPos(7, 1, 0))

View File

@ -30,16 +30,16 @@ module.exports =
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))
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))
for h in [2,4,6]
world.addObjectLine (KikiWall, KikiPos(5,2,h), KikiPos(5,6,h) )
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))
@ -48,8 +48,8 @@ module.exports =
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.addObjectAtPos( KikiWire(KikiFace.NY, 5), KikiPos(5,1,2))
world.addObjectAtPos( KikiWire(KikiFace.Y, 5), KikiPos(5,6,2))
world.addObjectAtPos(KikiMotorGear(KikiFace.Z), KikiPos(5,0,0))

View File

@ -18,7 +18,13 @@ module.exports =
],
create: ->
#startblock
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))
# 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))
for i in [0...5]
for j in [0...5]
for l in [0...5]
if Math.pow(-1, i+j+l) == -1
world.addObjectAtPos(KikiStone(), KikiPos(i,j,l))

View File

@ -18,12 +18,15 @@ module.exports =
create: ->
s=world.getSize()
for (i,j,l) in [ (m,n,o) for m in range(3) for n in range(3) for o in range(3)]:
if (i==2 or j==2 or l==2) and i>=1 and j>=1 and l >=1 :
c= 0.6 - (0.3)*(-1)**(i+j+l)
d= 0.6 + (0.3)*(-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))
# for (i,j,l) in [ (m,n,o) for m in range(3) for n in range(3) for o in range(3)]
for i in [0...3]
for j in [0...3]
for l in [0...3]
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))

View File

@ -23,13 +23,13 @@ module.exports =
position: [0,0,0]
],
create: ->
s = world.getSize ()
s = world.getSize()
d = 2
world.addObjectLine(KikiWireStone, world.decenter(-d, s.y/2, 0), world.decenter(-d, 0, 0))
world.addObjectLine(KikiWireStone, world.decenter( d, s.y/2, 0), world.decenter( d, 0, 0))
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.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))
@ -43,10 +43,10 @@ module.exports =
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))
# 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), 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.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))
@ -58,4 +58,5 @@ module.exports =
world.addObjectLine("KikiWire(KikiFace.PY, 10)", KikiPos(s.x-d, 0, s.z/2), KikiPos(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, 7), KikiPos(s.x/2+d, 0, s.z/2))

View File

@ -66,8 +66,8 @@ module.exports =
world.switch_counter = 0
switched = (switch) ->
world.switch_counter += switch.isActive() and 1 or -1
switched = (swtch) ->
world.switch_counter += swtch.isActive() and 1 or -1
exit = kikiObjectToGate (world.getObjectWithName("exit"))
exit.setActive(world.switch_counter == 4)

View File

@ -23,7 +23,10 @@ module.exports =
create: ->
s=world.getSize()
d=2
for (i,j,l) in [ (m,n,o) for m in range(s.x) for n in range(s.y) for o in range(s.z)]
if (-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))
# for (i,j,l) in [ (m,n,o) for m in range(s.x) for n in range(s.y) for o in range(s.z)]
for i in [0...s.x]
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))

View File

@ -30,7 +30,7 @@ module.exports =
s = world.getSize()
exit_switch = KikiSwitch()
exit_switch.getEventWithName("switched").addAction(continuous(()-> : world.toggle("exit")))
exit_switch.getEventWithName("switched").addAction(continuous(() -> world.toggle("exit")))
world.addObjectAtPos(exit_switch, world.decenter( 0, -2, 0))
world.addObjectAtPos(KikiStone(), world.decenter( 0, s.y/2, 0))

View File

@ -28,7 +28,7 @@ module.exports =
],
create: ->
sx, sy, sz = 13,5,13
[sx, sy, sz] = [13,5,13]
for z in range(-sz/2+2, sz/2)

View File

@ -31,7 +31,7 @@ module.exports =
]
create: ->
s = world.getSize ()
s = world.getSize()
#hop back on
world.addObjectAtPos(KikiWall(), KikiPos(2, 12, 12))

View File

@ -16,18 +16,19 @@ module.exports =
player:
coordinates: [3,0,1]
nostatus: 0
orientation: roty0
orientation: roty0
exits: [
name: "exit"
active: 1
position: [0,0,0]
]
create: ->
s=world.getSize()
for m in [ [1,KikiWall], [2,KikiStone] ]
for (k,l) in [[i,j] for i in [-1*m[0],1*m[0]] for j 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))
create: ->
s = world.getSize()
for m in [[1,KikiWall], [2,KikiStone]]
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))

View File

@ -33,10 +33,10 @@ module.exports =
world.switch_countera=0
else
world.switch_countera+=1
switched = (switch) ->
world.switch_counter += switch.isActive() and 1 or -1
switched = (swtch) ->
world.switch_counter += swtch.isActive() and 1 or -1
exit = kikiObjectToGate(world.getObjectWithName("exit"))
exit.setActive(world.switch_counter == 4)
exit.setActive(world.switch_counter == 4)
aswitch = KikiSwitch()
bswitch = KikiSwitch()
@ -44,33 +44,33 @@ module.exports =
dswitch = KikiSwitch()
eswitch = KikiSwitch()
aswitch.getEventWithName("switched").addAction(continuous( aswitched ))
bswitch.getEventWithName("switched").addAction(continuous(()-> s= bswitch : switched(s) ))
cswitch.getEventWithName("switched").addAction(continuous(()-> s= cswitch : switched(s) ))
dswitch.getEventWithName("switched").addAction(continuous(()-> s= dswitch : switched(s) ))
eswitch.getEventWithName("switched").addAction(continuous(()-> s= eswitch : switched(s) ))
aswitch.getEventWithName("switched").addAction(continuous(aswitched))
bswitch.getEventWithName("switched").addAction(continuous((s=bswitch) -> switched(s)))
cswitch.getEventWithName("switched").addAction(continuous((s=cswitch) -> switched(s)))
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 , KikiPos(s.x-1,0,0))
world.addObjectAtPos(bswitch , KikiPos(0,0,0))
world.addObjectAtPos(KikiMutant() , KikiPos (s.x/2,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.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, 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))
#exit
world.addObjectAtPos(KikiSwitch() , KikiPos (2,s.y-3,4))
world.addObjectAtPos(KikiSwitch() , KikiPos(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, KikiPos(2,4,4), KikiPos(s.x-4,4,4))
world.addObjectAtPos(cswitch , KikiPos(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, KikiPos(4,4,4), KikiPos(4,4,s.z-4))
world.addObjectAtPos(dswitch , KikiPos(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, KikiPos(4,4,6), KikiPos(4,s.y-4,6))
world.addObjectAtPos(eswitch , KikiPos(4,s.y-3,6))

View File

@ -40,6 +40,6 @@ module.exports =
world.addObjectAtPos(KikiStone(), KikiPos(s.x/2-2, s.y/2, 4))
exit_switch = KikiSwitch()
exit_switch.getEventWithName("switched").addAction(continuous(()-> : world.toggle("exit")))
exit_switch.getEventWithName("switched").addAction(continuous(() -> world.toggle("exit")))
world.addObjectAtPos(exit_switch, KikiPos(s.x/2, s.y/2, 0))

View File

@ -24,7 +24,7 @@ module.exports =
]
create: ->
#
sx, sy, sz = 13,5,13
[sx, sy, sz] = [13,5,13]
for z in range(-sz/2+2, sz/2)

View File

@ -22,16 +22,16 @@ module.exports =
for y in [-1, 1]
for x in range(-s.x/2+3, s.x/2-1, 2)
for z in range(-s.z/2+3, s.z/2-1, 2)
world.addObjectAtPos(KikiWall (), world.decenter(x, y, z))
world.addObjectAtPos(KikiWall(), world.decenter(x, y, z))
for y in [-4, 4]
for x in range(-s.x/2+1, s.x/2+1, 2)
for z in range(-s.z/2+1, s.z/2+1, 2)
world.addObjectAtPos(KikiWall (), world.decenter(x, y, z))
world.addObjectAtPos(KikiWall(), world.decenter(x, y, z))
world.addObjectAtPos(KikiStone (), world.decenter(3,-3,0))
world.addObjectAtPos(KikiStone (), world.decenter(-3,-3,0))
world.addObjectAtPos(KikiStone (), world.decenter(3,3,0))
world.addObjectAtPos(KikiStone (), world.decenter(-3,3,0))
world.addObjectAtPos(KikiStone (), world.decenter(0,-3,0))
world.addObjectAtPos(KikiStone (), world.decenter(0,3,0))
world.addObjectAtPos(KikiStone(), world.decenter(3,-3,0))
world.addObjectAtPos(KikiStone(), world.decenter(-3,-3,0))
world.addObjectAtPos(KikiStone(), world.decenter(3,3,0))
world.addObjectAtPos(KikiStone(), world.decenter(-3,3,0))
world.addObjectAtPos(KikiStone(), world.decenter(0,-3,0))
world.addObjectAtPos(KikiStone(), world.decenter(0,3,0))

View File

@ -63,8 +63,8 @@ module.exports =
world.switch_counter = 0
switched = (switch) ->
world.switch_counter += switch.isActive() and 1 or -1
switched = (swtch) ->
world.switch_counter += swtch.isActive() and 1 or -1
exit = kikiObjectToGate(world.getObjectWithName("exit"))
exit.setActive(world.switch_counter == 5)

View File

@ -26,17 +26,17 @@ module.exports =
s = world.getSize()
def switched(switch):
world.switch_counter += switch.isActive() and 1 or -1
exit = kikiObjectToGate(world.getObjectWithName("exit"))
exit.setActive(world.switch_counter == 5)
switched = (swtch) ->
world.switch_counter += swtch.isActive() and 1 or -1
exit = kikiObjectToGate(world.getObjectWithName("exit"))
exit.setActive(world.switch_counter == 5)
def switchBoth():
world.toggle("exit1")
world.toggle("exit2")
switchBoth = () ->
world.toggle("exit1")
world.toggle("exit2")
#randomly assign the switches to different locations
tup_array = [(0,0,0),( 2, 1, -2),( -2, -2, 0),( -1, 2, 1),( -2, -2, -1),( 1, -1,2),]
tup_array = [[0,0,0], [2,1,-2], [-2,-2,0], [-1,2,1], [-2,-2,-1], [1,-1,2]]
random.shuffle(tup_array)
i0 = tup_array[0]
@ -47,37 +47,35 @@ module.exports =
i5 = tup_array[5]
exit_switch = KikiSwitch()
exit_switch.getEventWithName("switched").addAction(continuous(()-> : switchBoth()))
world.addObjectAtPos(exit_switch, world.decenter(i0) )
exit_switch.getEventWithName("switched").addAction(continuous(() -> switchBoth()))
world.addObjectAtPos(exit_switch, world.decenter(i0))
exit2_switch = KikiSwitch()
exit2_switch.getEventWithName("switched").addAction(continuous(()-> : world.toggle("exit2")))
exit2_switch.getEventWithName("switched").addAction(continuous(() -> world.toggle("exit2")))
world.addObjectAtPos(exit2_switch, world.decenter(i1))
exit3_switch = KikiSwitch()
exit3_switch.getEventWithName("switched").addAction(continuous(()-> : world.toggle("exit1")))
exit3_switch.getEventWithName("switched").addAction(continuous(() -> world.toggle("exit1")))
world.addObjectAtPos(exit3_switch, world.decenter(i2))
exit4_switch = KikiSwitch()
exit4_switch.getEventWithName("switched").addAction(continuous(()-> : world.toggle("exit1")))
exit4_switch.getEventWithName("switched").addAction(continuous(() -> world.toggle("exit1")))
world.addObjectAtPos(exit4_switch, world.decenter(i3))
exit5_switch = KikiSwitch()
exit5_switch.getEventWithName("switched").addAction(continuous(()-> : world.toggle("exit1")))
exit5_switch.getEventWithName("switched").addAction(continuous(() -> world.toggle("exit1")))
world.addObjectAtPos(exit5_switch, world.decenter(i4))
# Invisimaze
for y in [0, 1, ]:
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))
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)])
# 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, [KikiPos(2, 4, 2), KikiPos(2, 4, 4), KikiPos(4, 4, 4), KikiPos(4, 4, 2)])
world.addObjectAtPos(KikiStone(), KikiPos(2, 3, 2))
world.addObjectAtPos(KikiStone(), KikiPos(6, 3, 1))
@ -108,22 +106,23 @@ module.exports =
world.addObjectAtPos(KikiMotorCylinder(), KikiPos(1, 2, 2))
# Walls
for y in [-4,]:
for x in [1, -1]:
world.addObjectPoly(KikiWall, [world.decenter(y, -x, -x), world.decenter(y, -x, x), \
world.decenter(y, x, x), world.decenter(y, x, -x)])
for y in [-3]:
for x in [2, -2]:
world.addObjectPoly(KikiWall, [world.decenter(y, -x, -x), world.decenter(y, -x, x), \
world.decenter(y, x, x), world.decenter(y, x, -x)])
# for y in [-4,]
y = -4
for x in [1, -1]
world.addObjectPoly(KikiWall, [world.decenter(y, -x, -x), world.decenter(y, -x, x), world.decenter(y, x, x), world.decenter(y, x, -x)])
# for y in [-3]
y = -3
for x in [2, -2]
world.addObjectPoly(KikiWall, [world.decenter(y, -x, -x), world.decenter(y, -x, x), world.decenter(y, x, x), world.decenter(y, x, -x)])
for y in [4,]:
for x in [1, -1]:
world.addObjectPoly(KikiWall, [world.decenter(y, -x, -x), world.decenter(y, -x, x), \
world.decenter(y, x, x), world.decenter(y, x, -x)])
for y in [3]:
for x in [2, -2]:
world.addObjectPoly(KikiWall, [world.decenter(y, -x, -x), world.decenter(y, -x, x), \
world.decenter(y, x, x), world.decenter(y, x, -x)])
# for y in [4,]
y = 4
for x in [1, -1]
world.addObjectPoly(KikiWall, [world.decenter(y, -x, -x), world.decenter(y, -x, x), world.decenter(y, x, x), world.decenter(y, x, -x)])
# for y in [3]
y = 3
for x in [2, -2]
world.addObjectPoly(KikiWall, [world.decenter(y, -x, -x), world.decenter(y, -x, x), world.decenter(y, x, x), world.decenter(y, x, -x)])

View File

@ -4,7 +4,7 @@ module.exports =
size: [7,7,13]
intro: "jump"
help: """
$scale"""1.5)mission:
$scale(1.5)mission:
get to the exit!
jump on the stones to reach it

View File

@ -14,7 +14,7 @@ module.exports =
active: 0
coordinates: [1,2,8]
]
create:
create: ->
s = world.getSize()
world.addObjectAtPos(KikiMotorGear(KikiFace.X), KikiPos(0,2,4))
world.addObjectAtPos(KikiWall(), KikiPos(0,2,3))

View File

@ -5,26 +5,32 @@ module.exports =
size: [11,11,11]
intro: "mesh"
help: "$scale(1.5)mission:\nget to the exit!"
player: coordinates: [0,0,5]
nostatus: 0
player:
coordinates: [0,0,5]
nostatus: 0
exits: [
name: "exit"
active: 1
position: [0,0,0]
]
create: ->
s=world.getSize()
middlemax = (u,v,w) ->
s=world.getSize()
d= 3.0/( (u-s.x/2.0)**2+ (v-s.y/2.0)**2 + (w-s.z/2.0)**2 + 1 )
return min(1.0 ,max(0.2,d))
middlemin = (u,v,w) ->
s=world.getSize()
d= ( (u-s.x/2.0)**2+ (v-s.y/2.0)**2 + (w-s.z/2.0)**2 )/25
return min(1.0 ,max(0.4,d))
for (i,j,l) in [ (m,n,o) for m in range(s.x) for n in range(s.y) for o in range(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))
# for (i,j,l) in [ (m,n,o) for m in range(s.x) for n in range(s.y) for o in range(s.z)]
for i in [0...sx]
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))

View File

@ -15,7 +15,7 @@ module.exports =
]
create: ->
supercube = (point=(5,5,5),size=2,obj=KikiWall) ->
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]),
@ -32,11 +32,11 @@ module.exports =
KikiPos(p[0],p[1]-s,p[2]+s) ])
s = world.getSize()
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, 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.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)
supercube(point=[5,5,5],size=5,obj=KikiWall)
supercube(point=[5,5,5],size=3,obj=KikiStone)

View File

@ -15,21 +15,26 @@ module.exports =
active: 1
position: [0,0,-1]
]
create:
create: ->
s=world.getSize()
d=1
for (i,j,l) in [ (m,n,o) for m in range(s.x) for n in range(s.y) for o in range( s.z/2-1)]
if (-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))
# for (i,j,l) in [ (m,n,o) for m in range(s.x) for n in range(s.y) for o in range( s.z/2-1)]
for i in [0...s.x]
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))
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)
for (i,j) in [ (m,n) for m in range(s.x) for n in range(s.y) ]
if (-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))
# 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))

View File

@ -12,7 +12,7 @@ module.exports =
]
create: ->
sx, sy, sz = 7,3,9
[sx, sy, sz] = [7,3,9]
for z in range(-sz/2+1, sz/2+1)
@ -22,9 +22,9 @@ module.exports =
if z
world.addObjectAtPos(KikiWall(), world.decenter(-sx/2+2, 0, z))
world.addObjectAtPos(KikiWall(), world.decenter( sx/2-1, 0, z))
if z <> 4 and z <> -4
if z != 4 and z != -4
world.addObjectAtPos(KikiWall(), world.decenter(0, -sy/2+1, z))
if z <> 1 and z <> -1
if z != 1 and z != -1
world.addObjectAtPos(KikiWall(), world.decenter(0, sy/2, z))

View File

@ -21,11 +21,9 @@ module.exports =
for y in [-1, 1]
x = 3
world.addObjectPoly (KikiStone, [world.decenter(-x, y, -x), world.decenter(-x, y, x), \
world.decenter(x, y, x), world.decenter(x, y, -x)])
world.addObjectPoly(KikiStone, [world.decenter(-x, y, -x), world.decenter(-x, y, x), world.decenter(x, y, x), world.decenter(x, y, -x)])
for y in [-3, 3]
for x in [-3, -1, 1, 3]
world.addObjectPoly (KikiStone, [world.decenter(-x, y, -x), world.decenter(-x, y, x), \
world.decenter(x, y, x), world.decenter(x, y, -x)])
world.addObjectPoly(KikiStone, [world.decenter(-x, y, -x), world.decenter(-x, y, x), world.decenter(x, y, x), world.decenter(x, y, -x)])

View File

@ -25,17 +25,18 @@ module.exports =
switched = ->
unoccupied = false
for (i,j) in [ (i,j) for i in range(3,6) for j in range(3,6) ]
if world.isUnoccupiedPos(KikiPos(i,j,0))
unoccupied=True
# 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))
unoccupied=true
if not unoccupied:
world.toggle("exit")
world.toggle("exit") if not unoccupied
switch = KikiSwitch()
switch.getEventWithName("switched").addAction ( continuous ( switched ))
swtch = KikiSwitch()
swtch.getEventWithName("switched").addAction(continuous(switched))
world.addObjectAtPos(switch , KikiPos (0,5,0))
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)
#inside

View File

@ -4,7 +4,7 @@ module.exports =
name: "slick"
scheme: "tron_scheme"
size: (9,11,15)
size: [9,11,15]
intro: "slick"
help: """
$scale(1.5)mission:
@ -20,11 +20,13 @@ module.exports =
active: 1
position: [0,0,4]
]
create:
create: ->
s=world.getSize()
for b in range(1,4)
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) ]
world.addObjectAtPos(KikiStone(KColor(0,1,0,0.5), true), KikiPos(k,l,b*3))
for b in [1..3]
# 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(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))

View File

@ -16,7 +16,7 @@ module.exports =
player:
coordinates: [3,0,6]
nostatus: 0
exits:
exits: [
name: "exit"
active: 1
position: [0,1,3]

View File

@ -1,8 +1,8 @@
module.exports =
name: "stones"
scheme: "blue_scheme",
size: (11,11,12),
intro: "stones",
scheme: "blue_scheme"
size: [11,11,12]
intro: "stones"
help: """
$scale(1.5)mission:
get to the exit!
@ -25,11 +25,11 @@ module.exports =
s = world.getSize()
num = 4
for i in range(1,num+1):
world.addObjectPoly (KikiWall, [(s.x/2-i, s.y/2-i, i-1),
(s.x/2+i, s.y/2-i, i-1),
(s.x/2+i, s.y/2+i, i-1),
(s.x/2-i, s.y/2+i, i-1)])
for i in [1..num]
world.addObjectPoly(KikiWall, [[s.x/2-i, s.y/2-i, i-1],
[s.x/2+i, s.y/2-i, i-1],
[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))

View File

@ -29,8 +29,8 @@ module.exports =
position: [0,-1,0]
]
create: ->
#
s = world.getSize ()
s = world.getSize()
h = 0
# bomb and stones
@ -65,23 +65,22 @@ module.exports =
world.switch_counter = 0
switched = (switch) ->
world.switch_counter += switch.isActive() and 1 or -1
switched = (swtch) ->
world.switch_counter += swtch.isActive() and 1 or -1
exit = kikiObjectToGate(world.getObjectWithName("exit"))
exit.setActive(world.switch_counter == 4)
switch1 = KikiSwitch()
switch1.getEventWithName("switched").addAction (continuous (()-> s=switch1: switched(s)))
switch1.getEventWithName("switched").addAction(continuous((s=switch1) -> switched(s)))
switch2 = KikiSwitch()
switch2.getEventWithName("switched").addAction (continuous (()-> s=switch2: switched(s)))
switch2.getEventWithName("switched").addAction(continuous((s=switch2) -> switched(s)))
switch3 = KikiSwitch()
switch3.getEventWithName("switched").addAction (continuous (()-> s=switch3: switched(s)))
switch3.getEventWithName("switched").addAction(continuous((s=switch3) -> switched(s)))
switch4 = KikiSwitch()
switch4.getEventWithName("switched").addAction (continuous (()-> s=switch4: switched(s)))
switch4.getEventWithName("switched").addAction(continuous((s=switch4) -> switched(s)))
world.addObjectAtPos(switch1, world.decenter(-s.x/2+1, 0, 0))
world.addObjectAtPos(switch2, world.decenter( s.x/2, 0, 0))
world.addObjectAtPos(switch3, world.decenter(0, 0, -s.z/2+1))
world.addObjectAtPos(switch4, world.decenter(0, 0, s.z/2))

View File

@ -35,7 +35,10 @@ module.exports =
d= 2* ( (u-s.x/2.0)**2+ (v-s.y/2.0)**2 + (w-s.z/2.0)**2 )/25
return min(1.0 ,max(0.4,d))
for (i,j,l) in [ (m,n,o) for m in range(s.x) for n in range(s.y) for o in range(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))
# for (i,j,l) in [ (m,n,o) for m in range(s.x) for n in range(s.y) for o in range(s.z)]
for i in [0...s.x]
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))