mirror of
https://github.com/ysoftdevs/pf2016.git
synced 2026-03-11 21:05:57 +01:00
clean up level 02
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
var level1 = {};
|
||||
level1.create = function(context) {
|
||||
// Create redirector objects
|
||||
|
||||
addRedirector(context, 10, 2, 1, 0, 0);
|
||||
addRedirector(context, 10, 3, 0, 1, 6);
|
||||
|
||||
@@ -14,11 +13,5 @@ level1.create = function(context) {
|
||||
// Define finish coordinates
|
||||
context.finishMarker.x = 6*64;
|
||||
context.finishMarker.y = 4*64;
|
||||
|
||||
// Create collision layer
|
||||
for(var i = 21; i < context.tilemap.tileTypes.length; i++) {
|
||||
context.tilemap.tileTypes[i].allowCollisions = Kiwi.Components.ArcadePhysics.ANY;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,30 @@
|
||||
var level2 = {};
|
||||
level2.create = function(context) {
|
||||
|
||||
// Define finish coordinates
|
||||
context.finishMarker.x = 8*64;
|
||||
context.finishMarker.y = 2*64;
|
||||
|
||||
// Add teleport
|
||||
var teleport = new Kiwi.GameObjects.Sprite(context, context.textures.teleport, 4*64, 2*64);
|
||||
teleport.animation.add('idle', [ 0, 1, 2, 3 ], 0.3, true);
|
||||
teleport.animation.play('idle', true);
|
||||
teleport.type = 'teleport';
|
||||
teleport.affectedX = 9*64;
|
||||
teleport.affectedY = 2*64;
|
||||
context.redirectorGroup.addChild(teleport);
|
||||
|
||||
// Add target teleport marker
|
||||
var teleportTarget = new Kiwi.GameObjects.Sprite(context, context.textures.teleport, 9*64, 2*64);
|
||||
teleportTarget.animation.add('idle', [ 3, 2, 1, 0 ], 0.3, true);
|
||||
teleportTarget.animation.play('idle', true);
|
||||
teleportTarget.type = 'teleport';
|
||||
teleportTarget.affectedX = 4*64;
|
||||
teleportTarget.affectedY = 2*64;
|
||||
context.redirectorGroup.addChild(teleportTarget);
|
||||
|
||||
// Create redirector objects
|
||||
addRedirector(context, 9, 1, -1, 0, 9);
|
||||
addRedirector(context, 9, 3, 1, 0, 0);
|
||||
addRedirector(context, 10, 2, 0, -1, 3);
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
function addRedirector(context, x, y, vectorX, vectorY, imageIndex) {
|
||||
var redirector = new Kiwi.GameObjects.Sprite(context, context.textures.oneWay, x*64, y*64);
|
||||
redirector.type = 'vector';
|
||||
redirector.affectVelocityX = context.velocityX * vectorX;
|
||||
redirector.affectVelocityY = context.velocityY * vectorY;
|
||||
redirector.cellIndex = imageIndex;
|
||||
|
||||
Reference in New Issue
Block a user