mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
First successful attempt to implement rube ragdoll into the game. uncomment //type: rube at the bottom of ItemSettings.js to convert banana into invisible ragdoll (only visible in debug mode) - grabbing still pretty buggy.
This commit is contained in:
parent
135ed724d1
commit
ebc3da12fa
8 changed files with 2458 additions and 26 deletions
1408
app/Game/Core/GameObjects/Items/Rube.js
Normal file
1408
app/Game/Core/GameObjects/Items/Rube.js
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -6,9 +6,10 @@ define([
|
|||
"Game/" + GLOBALS.context + "/GameObjects/Tile",
|
||||
"Game/" + GLOBALS.context + "/GameObjects/Item",
|
||||
"Game/" + GLOBALS.context + "/GameObjects/Items/Skateboard",
|
||||
"Game/" + GLOBALS.context + "/GameObjects/Items/RagDoll"
|
||||
"Game/" + GLOBALS.context + "/GameObjects/Items/RagDoll",
|
||||
"Game/" + GLOBALS.context + "/GameObjects/Items/Rube"
|
||||
|
||||
], function (Settings, Box2D, Nc, CollisionDetector, Tile, Item, Skateboard, RagDoll) {
|
||||
], function (Settings, Box2D, Nc, CollisionDetector, Tile, Item, Skateboard, RagDoll, Rube) {
|
||||
|
||||
function Level (uid, engine) {
|
||||
this.uid = uid;
|
||||
|
|
@ -30,6 +31,27 @@ define([
|
|||
});
|
||||
}
|
||||
|
||||
Level.prototype.createItem = function(uid, options) {
|
||||
switch(options.type) {
|
||||
case 'skateboard':
|
||||
return new Skateboard(this.engine, uid, options);
|
||||
case 'ragdoll':
|
||||
return new RagDoll(this.engine, uid, options);
|
||||
case 'rube':
|
||||
return new Rube(this.engine, uid, options);
|
||||
default:
|
||||
return new Item(this.engine, uid, options);
|
||||
}
|
||||
};
|
||||
|
||||
Level.prototype.getRandomSpawnPoint = function() {
|
||||
throw new Error("Level not loaded.");
|
||||
return {
|
||||
x: 150 + Math.random() * 300,
|
||||
y: -500
|
||||
};
|
||||
};
|
||||
|
||||
Level.prototype.destroy = function () {
|
||||
/*
|
||||
for (var key in this.gameObjects) {
|
||||
|
|
@ -41,6 +63,7 @@ define([
|
|||
this.isLoaded = false;
|
||||
}
|
||||
|
||||
/* Extended by TiledLevel
|
||||
Level.prototype.createTiles = function () {
|
||||
|
||||
if (!this.levelData || !this.levelData.tiles || this.levelData.tiles.length < 1) {
|
||||
|
|
@ -58,7 +81,9 @@ define([
|
|||
//);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/* Extended by TiledLevel
|
||||
Level.prototype.createItems = function() {
|
||||
if (!this.levelData || !this.levelData.items) {
|
||||
return;
|
||||
|
|
@ -72,25 +97,7 @@ define([
|
|||
//this.gameObjects.animated.push(item);
|
||||
};
|
||||
};
|
||||
|
||||
Level.prototype.createItem = function(uid, options) {
|
||||
switch(options.type) {
|
||||
case 'skateboard':
|
||||
return new Skateboard(this.engine, uid, options);
|
||||
case 'ragdoll':
|
||||
return new RagDoll(this.engine, uid, options);
|
||||
default:
|
||||
return new Item(this.engine, uid, options);
|
||||
}
|
||||
};
|
||||
|
||||
Level.prototype.getRandomSpawnPoint = function() {
|
||||
throw new Error("Level not loaded.");
|
||||
return {
|
||||
x: 150 + Math.random() * 300,
|
||||
y: -500
|
||||
};
|
||||
};
|
||||
*/
|
||||
|
||||
return Level;
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue