This commit is contained in:
monsterkodi 2016-08-25 01:26:09 +02:00
parent 8f14599b5a
commit 4f4d8556f0
21 changed files with 41 additions and 180 deletions

View File

@ -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)

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -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

View File

@ -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'

View File

@ -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",

View File

@ -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

View File

@ -1,6 +1,6 @@
module.exports =
name: "grid"
scheme: "candy"
scheme: "crazy"
size: [9,9,9]
help: """
$scale(1.5)mission:

View File

@ -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)

View File

@ -8,7 +8,7 @@
module.exports =
name: "neutron"
design: 'Michael Abel'
scheme: "neutron"
scheme: "tron"
size: [11,11,11]
help: """
$scale(1.5)mission:

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -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

View File

@ -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
@ -461,17 +426,22 @@ module.exports =
# 0000000 000 000 000 000 0000000 000
crazy:
raster:
color: rgb 0.84, 0.22, 0.20
bulb:
plate:
color: rgb 0,0,0
stone:
raster:
color: rgb 1,1,1
stone: 0.2
stone:
color: rgb 1,0,0
specular: rgb 1,1,1
shininess: 1000
wall:
color: rgb 1,0,0
bulb:
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:

View File

@ -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

BIN
img/shot12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 816 KiB

View File

@ -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