RequireJs と Backbone を使用して JavaScript ゲームのファイル構造を構築しました。今、Box2DWeb と組み合わせるのに問題があります。
// Filename: game/controller/arena.js
define([
'jquery',
'underscore',
'backbone',
'_69_',
'game/controller/object',
'game/model/arena',
'game/view/arena',
'box2d'
], function($, _, Backbone, _69_, Object, Model, View, Box2D){
var ArenaController = Object.extend ({
init : function (){
this._super(Model, View);
this.world = new b2World(
new b2Vec2(0, 10) //gravity
, true //allow sleep
);
this.appView;
this.loops=0;
},
start : function (){
_69_.l('start')
},
update :function (){
_69_.l('update')
},
stop : function (){
_69_.l('stop')
}
});
return new ArenaController;
});
しかし、コンソールでは b2World が定義されていません。それを機能させるにはどうすればよいですか?