diff --git a/README.md b/README.md index 45ebab9..1f1f1e2 100644 --- a/README.md +++ b/README.md @@ -5,5 +5,6 @@ ![kiki](img/shot08.png) ![kiki](img/shot06.png) ![kiki](img/shot11.png) +![kiki](img/shot12.png) ![kiki](img/shot09.png) ![kiki](img/shot10.png) diff --git a/coffee/actor.coffee b/coffee/actor.coffee index 3bcb668..77da7d3 100644 --- a/coffee/actor.coffee +++ b/coffee/actor.coffee @@ -7,7 +7,6 @@ { last } = require '/Users/kodi/s/ko/js/tools/tools' -log = require '/Users/kodi/s/ko/js/tools/log' Action = require './action' Timer = require './timer' Event = require './event' diff --git a/coffee/bot.coffee b/coffee/bot.coffee index db1eb5e..fc4a005 100644 --- a/coffee/bot.coffee +++ b/coffee/bot.coffee @@ -419,10 +419,10 @@ class Bot extends Pushable else @dir_sgn = 1 @jump_once = false if action.id != Action.NOOP - # log "bot.actionFinished '#{action.name}' position:", @position if action.id in [Action.FORWARD, Action.JUMP_FORWARD, Action.CLIMB_DOWN] - # log "bot.actionFinished '#{action.name}' orientation:", @orientation.rounded().name if action.id in [Action.TURN_LEFT, Action.TURN_RIGHT, Action.CLIMB_UP] + log "bot.actionFinished '#{action.name}' position:", @position if action.id in [Action.FORWARD, Action.JUMP_FORWARD, Action.CLIMB_DOWN] + log "bot.actionFinished '#{action.name}' orientation:", @orientation.rounded().name if action.id in [Action.TURN_LEFT, Action.TURN_RIGHT, Action.CLIMB_UP] - if world.getRealOccupantAtPos(@position.plus @getDown()).isMutant?() + if world.getRealOccupantAtPos(@position.plus @getDown())?.isMutant?() # keep action chain flowinwg in order to detect environment changes log 'bot.actionFinished mutant below: startTimedAction NOOP' @startTimedAction @getActionWithId(Action.NOOP), 0 diff --git a/coffee/cage.coffee b/coffee/cage.coffee index 02f1344..41cf9d3 100644 --- a/coffee/cage.coffee +++ b/coffee/cage.coffee @@ -4,7 +4,6 @@ # 000 000 000 000 000 000 # 0000000 000 000 0000000 00000000 -log = require '/Users/kodi/s/ko/js/tools/log' Material = require './material' class Cage diff --git a/coffee/gate.coffee b/coffee/gate.coffee index 592a917..cfed7b4 100644 --- a/coffee/gate.coffee +++ b/coffee/gate.coffee @@ -54,7 +54,7 @@ class Gate extends Switch newCellMate: (object) -> if object.name == 'player' and @active world.playSound 'GATE_WARP' - log 'gate trigger enter event', @events[@ENTER_EVENT].actions.length + # log 'gate trigger enter event', @events[@ENTER_EVENT].actions.length @events[@ENTER_EVENT].triggerActions() @active = false diff --git a/coffee/gear.coffee b/coffee/gear.coffee index 8f7687e..0c75cb6 100644 --- a/coffee/gear.coffee +++ b/coffee/gear.coffee @@ -4,7 +4,6 @@ # 000 000 000 000 000 000 000 # 0000000 00000000 000 000 000 000 -log = require '/Users/kodi/s/ko/js/tools/log' Valve = require './valve' Action = require './action' Pos = require './lib/pos' diff --git a/coffee/geom.coffee b/coffee/geom.coffee index 934749f..e90cb34 100644 --- a/coffee/geom.coffee +++ b/coffee/geom.coffee @@ -5,7 +5,6 @@ # 000 000 000 000 000 000 0 000 # 0000000 00000000 0000000 000 000 -log = require '/Users/kodi/s/ko/js/tools/log' Vector = require './lib/vector' class Geom diff --git a/coffee/item.coffee b/coffee/item.coffee index 4d13be5..d56b922 100644 --- a/coffee/item.coffee +++ b/coffee/item.coffee @@ -5,7 +5,6 @@ # 000 000 000 000 0 000 # 000 000 00000000 000 000 -log = require '/Users/kodi/s/ko/js/tools/log' Actor = require './actor' Pos = require './lib/pos' Vector = require './lib/vector' diff --git a/coffee/levels.coffee b/coffee/levels.coffee index 2c890bb..f17ccb3 100644 --- a/coffee/levels.coffee +++ b/coffee/levels.coffee @@ -10,6 +10,7 @@ class Levels @dict = {} @list = [ # "test", + "grid", # --- introduction "steps", # ok "start", # ok @@ -23,7 +24,7 @@ class Levels "gold", "escape", "gears", - "gamma", + "gamma", # scheme change doesn't work "cube", "switch", # exit doesnt open, other scheme # # "borg", @@ -33,11 +34,12 @@ class Levels "energy", "maze", "love", - "chain", # --- medium "towers", "edge", "random", + "slick", + "bridge", "plate", "nice", "entropy", @@ -45,8 +47,6 @@ class Levels "strange", "core", # --- difficult - "slick", - "bridge", "flower", "stones", "walls", diff --git a/coffee/levels/chain.coffee b/coffee/levels/chain.coffee deleted file mode 100644 index 8a04dcb..0000000 --- a/coffee/levels/chain.coffee +++ /dev/null @@ -1,46 +0,0 @@ - -# 0000000 000 000 0000000 000 000 000 -# 000 000 000 000 000 000 0000 000 -# 000 000000000 000000000 000 000 0 000 -# 000 000 000 000 000 000 000 0000 -# 0000000 000 000 000 000 000 000 000 - -module.exports = - name: "chain" - scheme: "candy" - size: [9,9,5] - help: """ - $scale(1.5)mission: - activate the exit! - - to activate the exit, - feed it with electricity: - - connect the generator - with the motor - - place a wire stone - next to the exit - """ - player: - coordinates: [0,4,3] - orientation: ZupX - - exits: [ - name: "exit" - active: 0 - position: [0,-1,0] - ], - create: -> - s = world.size - d = s.z/2 - - world.addObjectAtPos 'Wall', 0, 0, d - world.addObjectAtPos 'Bomb', 0, 1, d - world.addObjectAtPos 'Bomb', 1, 0, d - world.addObjectAtPos 'Bomb', 0, 7, d - world.addObjectAtPos 'Bomb', 5, 7, d - world.addObjectAtPos 'Bomb', 1, 3, d - world.addObjectAtPos 'Bomb', 5, 3, d - world.addObjectAtPos 'WireStone', 1, 5, d - \ No newline at end of file diff --git a/coffee/levels/grid.coffee b/coffee/levels/grid.coffee index 28a7c12..07bf962 100644 --- a/coffee/levels/grid.coffee +++ b/coffee/levels/grid.coffee @@ -1,6 +1,6 @@ module.exports = name: "grid" - scheme: "candy" + scheme: "crazy" size: [9,9,9] help: """ $scale(1.5)mission: diff --git a/coffee/levels/maze.coffee b/coffee/levels/maze.coffee index 84c5a65..5529607 100644 --- a/coffee/levels/maze.coffee +++ b/coffee/levels/maze.coffee @@ -11,6 +11,7 @@ module.exports = deisgn: 'Michael Abel' scheme: "default" size: [4,4,4] + camera: 'inside' help: """ $scale(1.5)mission: get to the exit! @@ -77,5 +78,4 @@ module.exports = world.addObjectAtPos('Light', 3,0,0) - world.setCameraMode(world.CAMERA_INSIDE) \ No newline at end of file diff --git a/coffee/levels/neutron.coffee b/coffee/levels/neutron.coffee index 5e7bc37..092d1e0 100644 --- a/coffee/levels/neutron.coffee +++ b/coffee/levels/neutron.coffee @@ -8,7 +8,7 @@ module.exports = name: "neutron" design: 'Michael Abel' - scheme: "neutron" + scheme: "tron" size: [11,11,11] help: """ $scale(1.5)mission: diff --git a/coffee/levels/slick.coffee b/coffee/levels/slick.coffee index 847f42e..cc2e051 100644 --- a/coffee/levels/slick.coffee +++ b/coffee/levels/slick.coffee @@ -18,8 +18,8 @@ module.exports = you can't grab it while falling """ player: - coordinates: [4,10,0] - orientation: rotx90 + coordinates: [0,10,13] + orientation: ZdownY exits: [ name: "exit" active: 1 diff --git a/coffee/levels/walls.coffee b/coffee/levels/walls.coffee index 529adf0..3cc42a0 100644 --- a/coffee/levels/walls.coffee +++ b/coffee/levels/walls.coffee @@ -8,7 +8,7 @@ module.exports = name: "walls" design: 'Michael Abel' - scheme: "default" + scheme: "red" size: [7,5,5] help: """ $scale(1.5)mission: @@ -31,20 +31,16 @@ module.exports = s=world.size {Stone} = require '../items' middlemax = (u,v,w) -> - # s=world.size d= 3.0/( (u-s.x/2.0)**2+ (v-s.y/2.0)**2 + (w-s.z/2.0)**2 + 1 ) Math.min 1.0 ,Math.max 0.2, d middlemin = (u,v,w) -> - # s=world.size d= 2* ( (u-s.x/2.0)**2+ (v-s.y/2.0)**2 + (w-s.z/2.0)**2 )/25 Math.min 1.0, Math.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)] for i in [0...s.x] for j in [0...s.y] for l in [0...s.z] if i==Math.floor(s.x/2) or i==Math.floor(s.x/2-2) or i==Math.floor(s.x/2+2) - log "#{i} #{j} #{l}" world.addObjectAtPos new Stone(color:[0.5*i,0.5*j,0.5*l], opacity:0.6), i,j,l \ No newline at end of file diff --git a/coffee/motorgear.coffee b/coffee/motorgear.coffee index e6b590d..e6fce54 100644 --- a/coffee/motorgear.coffee +++ b/coffee/motorgear.coffee @@ -4,7 +4,6 @@ # 000 0 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 # 000 000 0000000 000 0000000 000 000 0000000 00000000 000 000 000 000 -log = require '/Users/kodi/s/ko/js/tools/log' Gear = require './gear' Geom = require './geom' Face = require './face' diff --git a/coffee/player.coffee b/coffee/player.coffee index 3e11b6a..58e88de 100644 --- a/coffee/player.coffee +++ b/coffee/player.coffee @@ -118,10 +118,6 @@ class Player extends Bot Timer.addAction @rotate_action die: () -> - super - # Controller.displayText "game over" - world.playSound 'BOT_DEATH' - world.setCameraMode world.CAMERA_FOLLOW # 000 000 00000000 000 000 # 000 000 000 000 000 diff --git a/coffee/scheme.coffee b/coffee/scheme.coffee index 29e0773..5ccf9fc 100644 --- a/coffee/scheme.coffee +++ b/coffee/scheme.coffee @@ -88,45 +88,6 @@ module.exports = glow: color: rgb 1, 1, 0 - # 000 000 00000000 000 000 000000000 00000000 0000000 000 000 - # 0000 000 000 000 000 000 000 000 000 000 0000 000 - # 000 0 000 0000000 000 000 000 0000000 000 000 000 0 000 - # 000 0000 000 000 000 000 000 000 000 000 000 0000 - # 000 000 00000000 0000000 000 000 000 0000000 000 000 - - neutron: - plate: - color: rgb 0.5, 0.5, 0.5 - bulb: - color: rgb 0, 0, 0 - bomb: - color: rgb 0.5, 0, 0 - stone: - color: rgb 0.5, 0.5, 0.5 - opacity: 0.5 - switch: - color: rgb 0, 0, 0.5 - gate: - color: rgb 1, 1, 0 - player: - color: rgb 1, 0.5, 0 - tire: - color: rgb 0.5, 0, 0 - mutant: - color: rgb 0.5, 0, 0 - mutantTire: - color: rgb 0, 0, 0.2 - text: - color: rgb 0.8, 0.8, 0 - bright: rgb 1, 1, 0 - dark: rgb 0.6, 0.4, 0 - gear: - color: rgb 1, 0, 0 - wire: - color: rgb 0.1, 0.1, 0.9 - glow: - color: rgb 1, 1, 0 - # 000000000 00000000 0000000 000000000 # 000 000 000 000 # 000 0000000 0000000 000 @@ -175,6 +136,8 @@ module.exports = candy: plate: color: rgb 0.8, 0, 0.9 + wall: + color: rgb 0.5, 0.5, 1 bulb: color: rgb 1, 1, 1 text: @@ -182,10 +145,10 @@ module.exports = bright: rgb 1, 0, 1 dark: rgb 0.4, 0, 0.4 bomb: - color: rgb 0.73, 0, 0.75 + color: rgb 1, 0.8, 0 stone: - color: rgb 0.85, 0, 0.95 - opacity: 0.6 + color: rgb 0.85, 0, 0.5 + opacity: 0.4 switch: color: rgb 0.3, 0, 0.3 gate: @@ -201,7 +164,9 @@ module.exports = gear: color: rgb 0.7, 0, 0.7 wire: - color: rgb 1, 0, 1 + color: rgb 0.5, 0.5, 1 + wirePlate: + color: rgb 0, 0, 1 glow: color: rgb 1, 1, 0 @@ -460,18 +425,23 @@ module.exports = # 000 000 000 000 000 000 000 # 0000000 000 000 000 000 0000000 000 - crazy: + crazy: + plate: + color: rgb 0,0,0 raster: - color: rgb 0.84, 0.22, 0.20 + color: rgb 1,1,1 + stone: + color: rgb 1,0,0 + specular: rgb 1,1,1 + shininess: 1000 + wall: + color: rgb 1,0,0 bulb: - color: rgb 0, 0, 0 - stone: - color: rgb 1, 1, 1 - stone: 0.2 + color: rgb 1, 0, 0 switch: color: rgb 0.9, 1, 0.9 gate: - color: rgb 1, 1, 1, 0.8 + color: rgb 1, 0, 0 player: color: rgb 0.6, 0.6, 0.6 tire: diff --git a/coffee/world.coffee b/coffee/world.coffee index 1d0a638..dc8a904 100644 --- a/coffee/world.coffee +++ b/coffee/world.coffee @@ -251,8 +251,10 @@ class World extends Actor else if @dict.player.coordinates? @addObjectAtPos @player, new Pos @dict.player.coordinates - # @player.camera.setPosition new Vector 0,0,0 @player.camera.setPosition @player.currentPos() + + @setCameraMode Camera.INSIDE if @dict.camera == 'inside' + @creating = false restart: () -> @create @dict @@ -331,7 +333,8 @@ class World extends Actor exitLevel: (action) => @finish() # log "world.level_index #{world.level_index} nextLevel #{World.levels.list[world.level_index+1]}" - world.create World.levels.list[world.level_index+(_.isNumber(action) and action or 1)] + nextLevel = (world.level_index+(_.isNumber(action) and action or 1)) % World.levels.list.length + world.create World.levels.list[nextLevel] activate: (objectName) -> @getObjectWithName(objectName)?.setActive? true diff --git a/img/shot12.png b/img/shot12.png new file mode 100644 index 0000000..10322fd Binary files /dev/null and b/img/shot12.png differ diff --git a/levels.txt b/levels.txt index b9270c6..3c829b9 100644 --- a/levels.txt +++ b/levels.txt @@ -17,47 +17,14 @@ 16 size: 9 9 6 'sandbox' scheme: 'bronze' 17 size: 9 17 9 'energy' scheme: 'default' 18 size: 4 4 4 'maze' scheme: 'default' -world.unsetObject [WARNING] no cell at pos: -x 3 -y 3 -z 4 -world.unsetObject [WARNING] no cell at pos: -x 5 -y 1 -z 3 -world.unsetObject [WARNING] no cell at pos: -x 2 -y 1 -z 6 -world.unsetObject [WARNING] no cell at pos: -x 6 -y 1 -z 2 -world.unsetObject [WARNING] no cell at pos: -x 3 -y 1 -z 3 -world.unsetObject [WARNING] no cell at pos: -x 5 -y 1 -z 5 -world.unsetObject [WARNING] no cell at pos: -x 6 -y 1 -z 6 19 size: 13 13 13 'love' scheme: 'red' -20 size: 9 9 5 'chain' scheme: 'candy' -world.unsetObject [WARNING] no cell at pos: -x 6 -y 0 -z 7 21 size: 9 9 15 'towers' scheme: 'metal' 22 size: 7 7 7 'edge' scheme: 'candy' 23 size: 21 21 21 'random' scheme: 'default' 24 size: 7 7 9 'plate' scheme: 'blue' 25 size: 11 11 11 'nice' scheme: 'tron' 26 size: 9 9 9 'entropy' scheme: 'green' -27 size: 11 11 11 'neutron' scheme: 'neutron' +27 size: 11 11 11 'neutron' scheme: 'tron' 28 size: 9 9 9 'strange' scheme: 'default' 29 size: 9 9 9 'core' scheme: 'green' 30 size: 9 11 15 'slick' scheme: 'tron' @@ -65,9 +32,6 @@ z 7 32 size: 7 7 11 'flower' scheme: 'metal' 33 size: 11 11 12 'stones' scheme: 'blue' 34 size: 7 5 5 'walls' scheme: 'default' -1 0 0 -1 0 1 -1 0 2 35 size: 9 9 9 'grid' scheme: 'candy' 36 size: 9 7 9 'rings' scheme: 'default' 37 size: 9 6 9 'bronze' scheme: 'bronze' @@ -88,20 +52,3 @@ z 7 52 size: 11 9 11 'conductor' scheme: 'default' 53 size: 13 5 13 'evil' scheme: 'red' 54 size: 9 9 9 'mutants' scheme: 'blue' --1 size: 0 0 0 'undefined' scheme: 'default' -world.unsetObject [WARNING] no cell at pos: -x 8 -y 0 -z 1 -world.unsetObject [WARNING] no cell at pos: -x 6 -y 4 -z 0 -world.unsetObject [WARNING] no cell at pos: -x 4 -y 3 -z 7 -world.unsetObject [WARNING] no cell at pos: -x 1 -y 3 -z 6