diff --git a/coffee/Game.coffee b/coffee/Game.coffee index 4811af0..7d00e60 100644 --- a/coffee/Game.coffee +++ b/coffee/Game.coffee @@ -113,7 +113,7 @@ define ["Layer", "Naub", "Graph", "Shapes", "CollisionHandler"], (Layer, Naub, G naub.kind = 'ball' @add_object naub - naub.add_shape new NumberShape + #naub.add_shape new NumberShape #naub.update() # again just to get the numbers naub @@ -135,7 +135,7 @@ define ["Layer", "Naub", "Graph", "Shapes", "CollisionHandler"], (Layer, Naub, G naub.kind = 'box' @add_object naub - naub.add_shape new NumberShape + #naub.add_shape new NumberShape #naub.update() # again just to get the numbers naub diff --git a/coffee/Naub.coffee b/coffee/Naub.coffee index 8795160..abf0ed3 100644 --- a/coffee/Naub.coffee +++ b/coffee/Naub.coffee @@ -186,8 +186,10 @@ define -> class Naub # do things a naub is supposed to do join_with: (other) -> #restLength, stiffness, damping - joint = new cp.DampedSpring( @physical_body, other.physical_body, cp.vzero, cp.vzero, @radius*2, 5, 5) - joint2 = new cp.SlideJoint( @physical_body, other.physical_body, cp.vzero, cp.vzero, @radius*2.5, @radius*4.5) + minlen = Naubino.settings.naub.min_join_len * @size + maxlen = Naubino.settings.naub.max_join_len * @size + joint = new cp.DampedSpring( @physical_body, other.physical_body, cp.vzero, cp.vzero, minlen, 10, 4) + joint2 = new cp.SlideJoint( @physical_body, other.physical_body, cp.vzero, cp.vzero, minlen, maxlen) @layer.space.addConstraint( joint ) @layer.space.addConstraint( joint2 ) diff --git a/coffee/Naubino.coffee b/coffee/Naubino.coffee index 4c285d1..e8b6fa1 100644 --- a/coffee/Naubino.coffee +++ b/coffee/Naubino.coffee @@ -16,7 +16,7 @@ define ["Background", "Game", "Keybindings", "Menu", "Overlay", "StandardGame", constructor: () -> console.log "Naubino Constructor" - @name = "Naubino" + @name = "Naubino (chipmunk branch)" @settings = Settings @colors = @settings.colors.output @create_fsm() @@ -56,8 +56,8 @@ define ["Background", "Game", "Keybindings", "Menu", "Overlay", "StandardGame", @game_standard = new StandardGame(@game_canvas) @game_testcase = new TestCase(@game_canvas) @game_tutorial = new Tutorial(@game_canvas) - #@game = @game_standard - @game = @game_testcase + @game = @game_standard + #@game = @game_testcase #@game = @game_tutorial #@menu = new Menu(@menu_canvas) @overlay = new Overlay(@overlay_canvas) diff --git a/coffee/Settings.coffee b/coffee/Settings.coffee index 8d8d19d..eb54f8b 100644 --- a/coffee/Settings.coffee +++ b/coffee/Settings.coffee @@ -9,24 +9,26 @@ define -> Settings = { game: creation_offset: 50 - min_joining_force: 300 + min_joining_force: 100 naub: size: 28 - mass: 1 + mass: 5 friction: 0.5 - elasticity: .8 + elasticity: 1 + min_join_len: 1.2 # times size + max_join_len: 2 # times size physics: center_join: restLength: 0 stiffness: 2 - damping: 12 + damping: 5 fps: 35 # bug: slows down if high cpu usage calming_const: 0.5 join_length: 3.0 # margin between joined naubs (n* avg size) spring_force: 0.6 - damping: 0.4 + damping: 0.3 canvas: scale: 1 # not yet implemented diff --git a/coffee/StandardGame.coffee b/coffee/StandardGame.coffee index 9b143db..f29fc8e 100644 --- a/coffee/StandardGame.coffee +++ b/coffee/StandardGame.coffee @@ -24,13 +24,13 @@ define ["Game"], (Game) -> class StandardGame extends Game @basket_size = @default_basket_size = 160 @spammers = @default_spammers = { pair: - method: => @create_naub_pair(null, null, @max_color(), @max_color() ) + method: => @create_naub_pair(null, @max_color(), @max_color() ) probability: 5 mixed_pair: - method: => @create_naub_pair(null, null, @max_color(), @max_color(), true ) + method: => @create_naub_pair(null, @max_color(), @max_color(), true ) probability: 0 triple: - method: => @create_naub_triple(null, null, @max_color(), @max_color(), @max_color() ) + method: => @create_naub_triple(null, @max_color(), @max_color(), @max_color() ) probability: 0 }