Skip to content

Commit

Permalink
Close #135 refactor SceneNode to Scene
Browse files Browse the repository at this point in the history
  • Loading branch information
eonarheim committed Jan 29, 2014
1 parent 81a13ae commit 9d6e4a1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion sample-game/ts/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ player.addEventListener('keyup', (e? : ex.KeyUp) => {



var newScene = new ex.SceneNode();
var newScene = new ex.Scene();
newScene.addChild(new ex.Actor(100, 100, 100, 100, new ex.Color(0,0,0,.5)));

game.addEventListener('keydown', (keyDown? : ex.KeyDown)=>{
Expand Down
10 changes: 5 additions & 5 deletions ts/Core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ module ex {
public mouseUp: MouseUp[] = [];

public camera: ICamera;
public currentScene: SceneNode;
public rootScene: SceneNode;
private sceneStack: SceneNode[] = [];
public currentScene: Scene;
public rootScene: Scene;
private sceneStack: Scene[] = [];

private animations: AnimationNode[] = [];

Expand Down Expand Up @@ -184,7 +184,7 @@ module ex {

this.eventDispatcher = new EventDispatcher(this);

this.rootScene = this.currentScene = new SceneNode();
this.rootScene = this.currentScene = new Scene();
this.sceneStack.push(this.rootScene);

if (canvasElementId) {
Expand Down Expand Up @@ -229,7 +229,7 @@ module ex {
this.currentScene.removeChild(actor);
}

public pushScene(scene: SceneNode) {
public pushScene(scene: Scene) {
if (this.sceneStack.indexOf(scene) === -1) {
this.sceneStack.push(scene);
this.currentScene = scene;
Expand Down
8 changes: 4 additions & 4 deletions ts/Entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module ex {
constructor(public x: number, public y: number) { }
}

export class SceneNode {
export class Scene {
public children: Actor[] = [];
private engine: Engine;
private killQueue: Actor[] = [];
Expand Down Expand Up @@ -96,11 +96,11 @@ module ex {

private eventDispatcher: EventDispatcher;

private sceneNode: SceneNode;
private sceneNode: Scene;

private logger: Logger = Logger.getInstance();

public parent: SceneNode = null;
public parent: Scene = null;

public fixed = true;
public preventCollisions = false;
Expand All @@ -122,7 +122,7 @@ module ex {
this.color = color;
this.actionQueue = new ex.Internal.Actions.ActionQueue(this);
this.eventDispatcher = new EventDispatcher(this);
this.sceneNode = new SceneNode();
this.sceneNode = new Scene();
}


Expand Down

0 comments on commit 9d6e4a1

Please sign in to comment.