mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
Fixed tile and scale sizes, Fixed Animation using RequestAnimationFrame
This commit is contained in:
parent
01043a2ea3
commit
ff6456fd47
6 changed files with 137 additions and 116 deletions
|
|
@ -36,8 +36,8 @@ define(["Chuck/Settings", "Box2D/Box2D"], function(Settings, Box2D) {
|
|||
|
||||
var bodyDef = new Box2D.Dynamics.b2BodyDef();
|
||||
bodyDef.type = Box2D.Dynamics.b2Body.b2_staticBody;
|
||||
bodyDef.position.x = tile.x / Settings.RATIO * Settings.RATIO / 2;
|
||||
bodyDef.position.y = tile.y / Settings.RATIO * Settings.RATIO / 2;
|
||||
bodyDef.position.x = tile.x * Settings.TILE_SIZE / Settings.RATIO;
|
||||
bodyDef.position.y = tile.y * Settings.TILE_SIZE / Settings.RATIO;
|
||||
bodyDef.angle = tile.r * 90 * Math.PI / 180;
|
||||
|
||||
var tileShape = new Box2D.Collision.Shapes.b2PolygonShape();
|
||||
|
|
@ -179,82 +179,83 @@ define(["Chuck/Settings", "Box2D/Box2D"], function(Settings, Box2D) {
|
|||
|
||||
this.levelObject = {
|
||||
tiles: [
|
||||
{s:1, x: 3, y:18},
|
||||
{s:1, x:37, y:27},
|
||||
{s:1, x:20, y:24},
|
||||
{s:1, x:24, y:27},
|
||||
{s:1, x:37, y:26},
|
||||
{s:1, x: 9, y:18},
|
||||
{s:2, x:32, y:25, r:1},
|
||||
{s:1, x:23, y:27},
|
||||
{s:3, x:34, y:24, r:1},
|
||||
{s:1, x:35, y:28},
|
||||
{s:4, x:17, y:21},
|
||||
{s:2, x:21, y:24},
|
||||
{s:2, x:42, y:23, r:3},
|
||||
{s:3, x:30, y:24, r:3},
|
||||
{s:2, x:22, y:25},
|
||||
{s:1, x:40, y:25},
|
||||
{s:1, x:38, y:26},
|
||||
{s:1, x: 8, y: 8},
|
||||
{s:1, x:38, y:25},
|
||||
{s:1, x:28, y:28},
|
||||
{s:1, x:36, y:27},
|
||||
{s:1, x: 7, y:18},
|
||||
{s:2, x:20, y:23},
|
||||
{s:2, x:43, y:23, r:1},
|
||||
{s:6, x:31, y:24},
|
||||
{s:1, x:16, y:21},
|
||||
{s:1, x: 1, y:18},
|
||||
{s:1, x:31, y:29},
|
||||
{s:2, x:30, y:25, r:2},
|
||||
{s:4, x:11, y:18},
|
||||
{s:1, x:28, y:27},
|
||||
{s:1, x:28, y:26},
|
||||
{s:1, x:28, y:29},
|
||||
{s:1, x:19, y:23},
|
||||
{s:5, x:12, y:18, r:1},
|
||||
{s:1, x:42, y:24},
|
||||
{s:6, x:33, y:24, r:2},
|
||||
{s:1, x:39, y:25},
|
||||
{s:1, x:33, y:29},
|
||||
{s:1, x:29, y:29},
|
||||
{s:1, x:21, y:25},
|
||||
{s:1, x:27, y:27},
|
||||
{s:5, x:16, y:20, r:1},
|
||||
{s:1, x: 5, y:18},
|
||||
{s:5, x:18, y:21, r:1},
|
||||
{s:4, x:13, y:19},
|
||||
{s:1, x:14, y:20},
|
||||
{s:1, x:30, y:29},
|
||||
{s:1, x: 4, y:18},
|
||||
{s:1, x: 6, y:18},
|
||||
{s:1, x: 2, y:18},
|
||||
{s:1, x:32, y:24},
|
||||
{s:1, x:34, y:29},
|
||||
{s:1, x:32, y:29},
|
||||
{s:2, x: 1, y:16},
|
||||
{s:1, x:10, y:18},
|
||||
{s:1, x:42, y:25},
|
||||
{s:2, x:28, y:25, r:3},
|
||||
{s:2, x: 0, y:16, r:2},
|
||||
{s:1, x:22, y:27},
|
||||
{s:1, x:25, y:27},
|
||||
{s:1, x:31, y:25},
|
||||
{s:5, x:14, y:19, r:1},
|
||||
{s:1, x:41, y:25},
|
||||
{s:1, x:36, y:28},
|
||||
{s:4, x:15, y:20},
|
||||
{s:2, x:19, y:22},
|
||||
{s:3, x:26, y:26, r:3},
|
||||
{s:1, x:26, y:27},
|
||||
{s:1, x:18, y:22},
|
||||
{s:6, x:27, y:26},
|
||||
{s:1, x:22, y:26},
|
||||
{s:1, x: 1, y:17},
|
||||
{s:1, x:35, y:29},
|
||||
{s:1, x:12, y:1}
|
||||
]
|
||||
{s:1, x:3, y:18},
|
||||
{s:1, x:37, y:27},
|
||||
{s:1, x:20, y:24},
|
||||
{s:1, x:24, y:27},
|
||||
{s:1, x:37, y:26},
|
||||
{s:1, x:9, y:18},
|
||||
{s:2, x:32, y:25, r:1},
|
||||
{s:1, x:23, y:27},
|
||||
{s:3, x:34, y:24, r:1},
|
||||
{s:1, x:35, y:28},
|
||||
{s:4, x:17, y:21},
|
||||
{s:2, x:21, y:24},
|
||||
{s:2, x:42, y:23, r:3},
|
||||
{s:3, x:30, y:24, r:3},
|
||||
{s:2, x:22, y:25},
|
||||
{s:1, x:40, y:25},
|
||||
{s:1, x:38, y:26},
|
||||
{s:1, x:8, y:18},
|
||||
{s:1, x:38, y:25},
|
||||
{s:1, x:28, y:28},
|
||||
{s:1, x:36, y:27},
|
||||
{s:1, x:7, y:18},
|
||||
{s:2, x:20, y:23},
|
||||
{s:2, x:43, y:23, r:1},
|
||||
{s:6, x:31, y:24},
|
||||
{s:1, x:16, y:21},
|
||||
{s:1, x:1, y:18},
|
||||
{s:1, x:31, y:29},
|
||||
{s:2, x:30, y:25, r:2},
|
||||
{s:4, x:11, y:18},
|
||||
{s:1, x:28, y:27},
|
||||
{s:1, x:28, y:26},
|
||||
{s:1, x:28, y:29},
|
||||
{s:1, x:19, y:23},
|
||||
{s:5, x:12, y:18, r:1},
|
||||
{s:1, x:42, y:24},
|
||||
{s:6, x:33, y:24, r:2},
|
||||
{s:1, x:39, y:25},
|
||||
{s:1, x:33, y:29},
|
||||
{s:1, x:29, y:29},
|
||||
{s:1, x:21, y:25},
|
||||
{s:1, x:27, y:27},
|
||||
{s:5, x:16, y:20, r:1},
|
||||
{s:1, x:5, y:18},
|
||||
{s:5, x:18, y:21, r:1},
|
||||
{s:4, x:13, y:19},
|
||||
{s:1, x:14, y:20},
|
||||
{s:1, x:30, y:29},
|
||||
{s:1, x:4, y:18},
|
||||
{s:1, x:6, y:18},
|
||||
{s:1, x:2, y:18},
|
||||
{s:1, x:32, y:24},
|
||||
{s:1, x:34, y:29},
|
||||
{s:1, x:32, y:29},
|
||||
{s:2, x:1, y:16},
|
||||
{s:1, x:10, y:18},
|
||||
{s:1, x:42, y:25},
|
||||
{s:2, x:28, y:25, r:3},
|
||||
{s:2, x:0, y:16, r:2},
|
||||
{s:1, x:22, y:27},
|
||||
{s:1, x:25, y:27},
|
||||
{s:1, x:31, y:25},
|
||||
{s:5, x:14, y:19, r:1},
|
||||
{s:1, x:41, y:25},
|
||||
{s:1, x:36, y:28},
|
||||
{s:4, x:15, y:20},
|
||||
{s:2, x:19, y:22},
|
||||
{s:3, x:26, y:26, r:3},
|
||||
{s:1, x:26, y:27},
|
||||
{s:1, x:18, y:22},
|
||||
{s:6, x:27, y:26},
|
||||
{s:1, x:22, y:26},
|
||||
{s:1, x:1, y:17},
|
||||
{s:1, x:35, y:29},
|
||||
{s:1, x:12, y:19}
|
||||
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue