This commit is contained in:
monsterkodi 2016-08-24 22:19:43 +02:00
parent 9843499d78
commit f0a7fd7ded
42 changed files with 168 additions and 118 deletions

View File

@ -78,8 +78,8 @@ class Actor extends Emitter
initAction: ->
performAction: ->
finishAction: -> log "actor.finishAction not implemented? #{@name}"
actionFinished: -> log 'actor.actionFinished not implemented? #{@name}'
finishAction: ->
actionFinished: ->
# 000000000 000 00 00 00000000 00000000
# 000 000 000 000 000 000 000

View File

@ -53,6 +53,13 @@ class Camera extends Matrix
@light.setPosition new Vector pos[X], pos[Y], pos[Z], 1.0 # positional light source
getLookAtPosition: -> @getZVector().mul(-@eye_distance).plus @getPosition()
setOrientation: (o) ->
@setYVector o.rotate Vector.unitY
@setZVector o.rotate Vector.unitZ
@setXVector o.rotate Vector.minusX
@cam.up.copy @getYVector()
@cam.lookAt @getPosition().plus @getZVector()
updateViewport: ->
ss = world.screenSize

View File

@ -11,36 +11,37 @@ class Levels
@list = [
# "test",
# --- introduction
# "steps",
# "start",
# "blocks",
# "move",
# "electro",
# "elevate",
# "throw",
"steps",
"start",
"blocks",
"move",
"electro",
"elevate",
"throw",
# # --- easy
# "gold",
# "jump",
# "escape",
# "gears",
# "gamma",
# "cube",
# "switch",
"gold",
"jump",
"escape",
"gears",
"gamma",
"cube",
"switch",
# # "borg",
# "mini",
# "bombs",
# "sandbox",
# "energy",
# "maze",
# "love",
"mini",
"bombs",
"sandbox",
"energy",
"maze",
"love",
"chain",
# --- medium
# "towers",
# "edge",
# "random",
# "plate",
# "nice",
# "entropy",
# "neutron",
"towers",
"edge",
"random",
"plate",
"nice",
"entropy",
"neutron",
"strange",
"core",
# --- difficult

View File

@ -22,7 +22,8 @@ module.exports =
next to the exit
"""
player:
position: [0,-3,1]
coordinates: [4,1,0]
orientation: minusYupZ
exits: [
name: "exit"
active: 0

View File

@ -21,7 +21,9 @@ module.exports =
and close the circuit
with the wire stones"
"""
player: position: [0,1,0]
player:
coordinates: [4,0,5]
orientation: minusYupZ
exits: [
name: "exit"

View File

@ -18,7 +18,9 @@ module.exports =
to get to the exit,
move the stones
"""
player: position: [0,-3,0]
player:
coordinates: [2,3,2]
orientation: minusZdownX
exits: [
name: "exit"
active: 1

View File

@ -22,7 +22,9 @@ module.exports =
place a wire stone
next to the exit
"""
player: position: [1,2,0]
player:
coordinates: [0,4,3]
orientation: ZupX
exits: [
name: "exit"

View File

@ -18,8 +18,8 @@ module.exports =
activate all switches.
"""
player:
coordinates: [3, 4,3]
nostatus: 0
coordinates: [4,10,0]
orientation: YupZ
exits: [
name: "exit"
active: 0

View File

@ -22,7 +22,9 @@ module.exports =
place a wire stone
next to the exit
"""
player: position: [1,0,0]
player:
coordinates: [2,1,1]
orientation: minusYupZ
exits: [
name: "exit"
active: 0

View File

@ -19,9 +19,8 @@ module.exports =
feed it with electricity
"""
player:
coordinates: [4,6,4]
nostatus: 0
orientation: rot0
coordinates: [4,5,3]
orientation: YdownZ
exits: [
name: "exit"
active: 0

View File

@ -17,7 +17,8 @@ module.exports =
use the stones
"""
player:
position: [0,-1,0]
coordinates: [3,7,0]
orientation: YupZ
exits: [
name: "exit"
active: 1
@ -27,7 +28,7 @@ module.exports =
s = world.size
for y in [-4...6]
for y in [-4...5]
for x in [-3, -1, 1, 3]
for z in [-3, -1, 1, 3 ]
world.addObjectAtPos 'Stone', world.decenter x, y, z

View File

@ -24,8 +24,8 @@ module.exports =
next to the exit
"""
player:
coordinates: [3,0,3]
nostatus: 0
coordinates: [6,2,0]
orientation: XupZ
exits: [
name: "exit"
active: 0

View File

@ -12,9 +12,8 @@ module.exports =
size: [7,7,7]
help: "$scale(1.5)mission:\nget to the exit!"
player:
coordinates: [3,0,0]
nostatus: 0
orientation: rot0
coordinates: [3,0,5]
orientation: ZupY
exits: [
name: "exit"
active: 1

View File

@ -1,3 +1,10 @@
# 00000000 000 000 00000000 00000000 0000000 000 000
# 000 0000 000 000 000 000 000 000 000
# 0000000 000 0 000 0000000 0000000 000 0000 00000
# 000 000 0000 000 000 000 000 000 000
# 00000000 000 000 00000000 000 000 0000000 000
module.exports =
name: "energy"
scheme: "default"
@ -10,8 +17,8 @@ module.exports =
shoot the 4 switches
"""
player:
position: [0,1,0]
orientation: roty90
coordinates: [4,4,5]
orientation: XupZ
exits: [
name: "exit"
active: 0

View File

@ -18,8 +18,8 @@ module.exports =
use the stones to reach it
"""
player:
coordinates: [4,3,4]
nostatus: 0
coordinates: [4,3,2]
orientation: minusXupZ
exits: [
name: "exit"
active: 1

View File

@ -24,8 +24,8 @@ module.exports =
move the stones
"""
player:
coordinates: [3,8,4]
orientation: YupX
coordinates: [3,0,4]
orientation: minusXupY
exits: [
name: "exit"
active: 0

View File

@ -7,6 +7,7 @@
module.exports =
name: "evil"
design: "Michael Abel?"
scheme: "red"
size: [13,5,13]
help: """
@ -26,7 +27,9 @@ module.exports =
good luck!
"""
player: position: [1,1,1]
player:
coordinates: [6,0,7]
orientation: ZupY
exits: [
name: "exit"
active: 0

View File

@ -23,8 +23,8 @@ module.exports =
you have to fall of this stone, as well
"""
player:
coordinates: [6,11,6]
nostatus: 0
coordinates: [0,6,2]
orientation: minusZupX
exits: [
name: "exit"
active: 1

View File

@ -13,9 +13,8 @@ module.exports =
you can't grab it while falling
"""
player:
coordinates: [3,0,1]
nostatus: 0
orientation: rot0
coordinates: [3,0,7]
orientation: ZupY
exits: [
name: "exit"
active: 1
@ -29,8 +28,8 @@ module.exports =
for l in [-1*m[0],1*m[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(color:[0,1,0,0.5], slippery:true), world.decenter 1,0,0
world.addObjectAtPos new Stone(color:[0,1,0,0.5], slippery:true), world.decenter -1,0,0
world.addObjectAtPos new Stone(color:[0,1,0,0.5], slippery:true), world.decenter 0,1,0
world.addObjectAtPos new Stone(color:[0,1,0,0.5], slippery:true), world.decenter 0,-1,0
world.addObjectAtPos new Stone(color:[0.5,0.5,1], opacity: 0.5, slippery:true), world.decenter 1,0,0
world.addObjectAtPos new Stone(color:[0.5,0.5,1], opacity: 0.5, slippery:true), world.decenter -1,0,0
world.addObjectAtPos new Stone(color:[0.5,0.5,1], opacity: 0.5, slippery:true), world.decenter 0,1,0
world.addObjectAtPos new Stone(color:[0.5,0.5,1], opacity: 0.5, slippery:true), world.decenter 0,-1,0

View File

@ -20,8 +20,8 @@ module.exports =
shoot at the 3 switches to activate the exit
"""
player:
coordinates: [0,5,0]
nostatus: 0
coordinates: [5,5,4]
orientation: XupY
exits: [
name: "exit"
active: 0

View File

@ -14,7 +14,9 @@ module.exports =
and close the circuit
with the wire stones
"""
player: position: [0,0,0]
player:
position: [0,0,0]
orientation: minusXupZ
exits: [
name: "exit"
active: 0

View File

@ -16,8 +16,8 @@ module.exports =
to shoot, press $key(shoot)
"""
player:
coordinates: [3,0,3]
nostatus: 0
coordinates: [5,4,1]
orientation: minusYupZ
exits: [
name: "exit"
active: 0

View File

@ -8,7 +8,9 @@ module.exports =
to get to the exit,
use the stones
"""
player: position: [1,0,1]
player:
coordinates: [3,4,8]
orientation: minusXdownZ
exits: [
name: "exit"
active: 1

View File

@ -19,7 +19,9 @@ module.exports =
use the stones to
reach the exit
"""
player: position: [0,-3,1]
player:
coordinates: [4,8,2]
orientation: YdownZ
exits: [
name: "exit"

View File

@ -16,7 +16,9 @@ module.exports =
the switches move every time you play
there is only one way out!
"""
player: position: [0,1,0]
player:
coordinates: [3,3,0]
orientation: YupZ
exits: [
name: "exit1"
active: 0

View File

@ -12,9 +12,9 @@ module.exports =
size: [5,5,9]
help: "$scale(1.5)mission:\nactivate the exit!"
player:
position: [0,0,0]
orientation: roty270
exits: [
coordinates: [1,2,2]
orientation: minusZupX
exits: [
name: "exit"
active: 0
coordinates: [1,2,8]

View File

@ -17,9 +17,8 @@ module.exports =
but don't get confused :)
"""
player:
coordinates: [3,0,0]
nostatus: 0
orientation: rotz90
coordinates: [3,0,1]
orientation: minusZdownX
exits: [
name: "exit"
active: 1

View File

@ -12,8 +12,8 @@ module.exports =
size: [11,11,11]
help: "$scale(1.5)mission:\nget to the exit!"
player:
coordinates: [0,0,5]
nostatus: 0
coordinates: [6,10,5]
orientation: YdownZ
exits: [
name: "exit"
active: 1

View File

@ -12,9 +12,8 @@ module.exports =
size: [5,5,7]
help: "$scale(1.5)mission:\nget to the exit!"
player:
coordinates: [2,4,4]
nostatus: 0,
orientation: rotx90
coordinates: [2,1,0]
orientation: minusYupZ
exits: [
name: "exit"
active: 1

View File

@ -13,7 +13,9 @@ module.exports =
when all mutant bots
are deactivated
"""
player: position: [0,-1,0]
player:
coordinates: [7,1,8]
orientation: minusYdownZ
exits: [
name: "exit"
active: 0
@ -21,7 +23,7 @@ module.exports =
world: ()-> outro()
]
create: ->
#
s = world.size
{Mutant} = require '../items'

View File

@ -17,17 +17,15 @@ module.exports =
it looks simpler than it is.
"""
player:
"position": [0,-1,0]
"nostatus": 0
coordinates: [5,4,0]
orientation: minusZdownY
exits: [
"name": "exit"
"active": 1
"position": [0,0,0]
name: "exit"
active: 1
position: [0,0,0]
]
"create": ->
create: ->
# neutron_scheme["KikiStone"] = "base": [0.0, 0.5, 0.5, 0.5]
world.addObjectAtPos 'Stone', world.decenter 0,0,-5
world.addObjectAtPos 'Stone', world.decenter 0,0,+5
world.addObjectAtPos 'Stone', world.decenter +5,0,0

View File

@ -12,7 +12,9 @@ module.exports =
scheme: "tron"
size: [11,11,11]
help: "$scale(1.5)mission:\nget to the exit!"
player: position: [2,-1,0]
player:
coordinates: [7,4,0]
orientation: minusZdownY
exits: [
name: "exit"
active: 1

View File

@ -13,9 +13,8 @@ module.exports =
use the bombs :)
"""
player:
coordinates: [3,2,1]
nostatus: 0
orientation: Quaternion.rotationAroundVector(270, new Vector(1,0,0))
coordinates: [2,3,3]
orientation: minusXdownZ
exits: [
name: "exit"
active: 1

View File

@ -12,9 +12,8 @@ module.exports =
size: [11,11,11]
help: "$scale(1.5)mission:\nget to the exit!"
player:
coordinates: [5,10,5]
nostatus: 0
orientation: rotx90
coordinates: [5,9,6]
orientation: ZdownY
exits: [
name: "exit"
active: 1

View File

@ -1,9 +1,18 @@
# 00000000 00000000 0000000 0000000 000
# 000 000 000 000 000 000 000
# 0000000 0000000 000 0000 000000000 000
# 000 000 000 000 000 000 000 000
# 000 000 00000000 0000000 000 000 0000000
module.exports =
name: "regal"
scheme: "bronze"
size: [7,3,9]
help: "$scale(1.5)mission:\nactivate the exit!"
player: position: [0,0,0]
player:
coordinates: [3,2,4]
orientation: XdownY
exits: [
name: "exit"
active: 0

View File

@ -15,7 +15,9 @@ module.exports =
to get to the exit,
use the stones
"""
player: position: [0,-1,0]
player:
coordinates: [4,4,2]
orientation: minusXupZ
exits: [
name: "exit"
active: 1

View File

@ -12,8 +12,8 @@ module.exports =
size: [5,25,5]
help: "Down the Rabbit Hole"
player:
coordinates: [3,1,3]
nostatus: 0
coordinates: [0,20,2]
orientation: minusYupX
exits: [
name: "exit"
active: 0

View File

@ -12,8 +12,8 @@ module.exports =
while moving
"""
player:
position: [0,-1,-1]
orientation: rotx90.mul roty180
coordinates: [4,5,3]
orientation: ZupX
exits: [
name: "exit"
active: 1

View File

@ -1,13 +1,19 @@
# level design by Ben "mrthoughtful" Griffin
# 000000000 0000000 000 000 00000000 00000000 0000000
# 000 000 000 000 0 000 000 000 000 000
# 000 000 000 000000000 0000000 0000000 0000000
# 000 000 000 000 000 000 000 000 000
# 000 0000000 00 00 00000000 000 000 0000000
module.exports =
name: "towers"
design: 'Ben "mrthoughtful" Griffin'
scheme: "metal"
size: [9,9,15]
help: "$scale(1.5)mission:\nget to the exit!\n\nto get to the exit,\nmove the stones"
player:
coordinates: [4,5,0]
orientation: rotx90
coordinates: [4,5,3]
orientation: ZdownX
exits: [
name: "exit"
active: 1

View File

@ -20,7 +20,8 @@ module.exports =
the central wall
"""
player:
coordinates: [0,0,2]
coordinates: [0,4,2]
orientation: minusXdownY
exits: [
name: "exit"
active: 1

View File

@ -292,19 +292,19 @@ module.exports =
blue:
plate:
color: rgb 0.1, 0.1, 0.6
color: rgb 0.3, 0.3, 1
bulb:
color: rgb 0.6, 0.6, 1
stone:
color: rgb 0, 0, 0.5
opacity: 0.6
color: rgb 0, 0, 0.7
opacity: 0.6
switch:
color: rgb 0, 0, 0.6, 0.8
color: rgb 0, 0, 0.6
bomb:
color: rgb 0.2, 0.2, 0.9
opacity: 0.8
color: rgb 0, 0, 1
opacity: 0.8
gate:
color: rgb 0, 0.2, 1
color: rgb 0, 0, 1
player:
color: rgb 0, 0, 0.7
tire:
@ -318,11 +318,11 @@ module.exports =
bright: rgb 0.7, 0.8, 1
dark: rgb 0, 0, 0.6
gear:
color: rgb 0.1, 0.1, 0.9
color: rgb 0, 0, 0.9
wire:
color: rgb 0.1, 0.1, 0.9
color: rgb 0, 0, 0.9
glow:
color: rgb 1, 0.5, 0
color: rgb 1, 1, 1
# 000 000 00000000 000 000 0000000 000 000
# 000 000 000 000 000 000 000 000 0 000

View File

@ -244,6 +244,7 @@ class World extends Actor
@player = new Player
# log "player_dict", player_dict
@player.setOrientation @dict.player.orientation ? rotx90
@player.camera.setOrientation @player.orientation
if @dict.player.position?
@addObjectAtPos @player, @decenter @dict.player.position