Created
July 11, 2011 10:54
-
-
Save Sephi-Chan/1075675 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ig | |
.module('game.entities.levelchange') | |
.requires('impact.entity') | |
.defines -> | |
window.EntityLevelchange = ig.Entity.extend | |
_wmDrawBox: true | |
_wmBoxColor: 'rgba(0, 0, 255, 0.7)' | |
size: | |
x: 8 | |
y: 8 | |
level: null # Name of the level where the player is sent. | |
door: null # Name of the door in the targetted level. | |
triggeredBy: (entity, trigger)-> | |
# Change the current level. | |
level = ig.global["Level#{@level}"] | |
ig.game.loadLevelDeferred(level) | |
console.log level | |
# Retrieve the door location, which is the "ChangeLevel" entity. | |
# This entity name follow the pattern Level_Door. | |
name = "#{@level}_#{@door}" | |
door = ig.game.getEntityByName(name) | |
console.log door | |
# Pop the player on the level and move it aside the door. | |
# .... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment