mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
added image preloader and doll sensor
This commit is contained in:
parent
3aa89fc8d6
commit
1dcc21d0b5
20 changed files with 651 additions and 23 deletions
|
|
@ -7,7 +7,7 @@ define([
|
|||
|
||||
function (Parent, Settings, NotificationCenter, Exception) {
|
||||
|
||||
function Doll(physicsEngine, playerId) {
|
||||
function Doll(physicsEngine, playerId) {
|
||||
this.animationDef = {
|
||||
"stand": [1,1],
|
||||
"walk": [2,28],
|
||||
|
|
@ -69,7 +69,10 @@ function (Parent, Settings, NotificationCenter, Exception) {
|
|||
NotificationCenter.trigger("view/addMesh", mesh);
|
||||
};
|
||||
|
||||
NotificationCenter.trigger("view/createAnimatedMesh", texturePaths, callback, { visible: false, pivot: "mb" });
|
||||
NotificationCenter.trigger("view/createAnimatedMesh", texturePaths, callback, {
|
||||
visible: false,
|
||||
pivot: "mb"
|
||||
});
|
||||
}
|
||||
|
||||
// Head
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ function (Parent, Settings, DomController, Box2D) {
|
|||
| Box2D.Dynamics.b2DebugDraw.e_jointBit
|
||||
//| Box2D.Dynamics.b2DebugDraw.e_coreShapeBit
|
||||
//| Box2D.Dynamics.b2DebugDraw.e_aabbBit
|
||||
| Box2D.Dynamics.b2DebugDraw.e_centerOfMassBit
|
||||
//| Box2D.Dynamics.b2DebugDraw.e_centerOfMassBit
|
||||
//| Box2D.Dynamics.b2DebugDraw.e_obbBit
|
||||
//| Box2D.Dynamics.b2DebugDraw.e_pairBit
|
||||
);
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ define({
|
|||
IS_BROWSER_ENVIRONMENT: typeof window !== 'undefined',
|
||||
USE_WEGBL: true,
|
||||
|
||||
DEBUG_MODE: 0,
|
||||
DEBUG_MODE: 1,
|
||||
|
||||
// NETWORKING
|
||||
WORLD_UPDATE_BROADCAST_INTERVAL: 70,
|
||||
|
|
|
|||
|
|
@ -74,6 +74,18 @@ function (Parent, Box2D, Settings, CollisionDetector) {
|
|||
}
|
||||
|
||||
this.body.CreateFixture(fixtureDef);
|
||||
|
||||
var grabSensorLeftShape = new Box2D.Collision.Shapes.b2PolygonShape();
|
||||
grabSensorLeftShape.SetAsOrientedBox(10 / Settings.RATIO, 20 / Settings.RATIO, new Box2D.Common.Math.b2Vec2(-10 / Settings.RATIO, -10 / Settings.RATIO));
|
||||
fixtureDef.shape = grabSensorLeftShape;
|
||||
fixtureDef.isSensor = true;
|
||||
this.body.CreateFixture(fixtureDef);
|
||||
|
||||
var grabSensorRightShape = new Box2D.Collision.Shapes.b2PolygonShape();
|
||||
grabSensorRightShape.SetAsOrientedBox(10 / Settings.RATIO, 20 / Settings.RATIO, new Box2D.Common.Math.b2Vec2(10 / Settings.RATIO, -10 / Settings.RATIO));
|
||||
fixtureDef.shape = grabSensorRightShape;
|
||||
fixtureDef.isSensor = true;
|
||||
this.body.CreateFixture(fixtureDef);
|
||||
}
|
||||
|
||||
Doll.prototype.setActionState = function(state) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue