-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a prototype for Level #117
Conversation
@@ -0,0 +1,86 @@ | |||
function Level(home, backgroundLayers, obstaclesLayer){ | |||
this._backgrounds = backgroundLayers; | |||
this.obstacleLayer = obstaclesLayer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, we can have several obstacle layers
@niccokunzmann I removed the typos and added the multiple obstacle thing as well. |
@@ -59,21 +69,62 @@ function newLevel(name,backgroundLayers,obstaclesLayer){ | |||
} | |||
|
|||
function AlllevelObjects(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be executed several times? Can you remove this function and make the spec a global variable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everytime you start a game this function should be executed.
} | ||
|
||
|
||
function AlllevelObjects(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect getAllLevels to return the same levels all the time.
Thus, I expect AlllevelObjects() to be called only once.
There are several ways to meet this expectation, which I see:
- Run this function in this file when it is loaded and make it "private"
- Remove the function around the for-loop and execute the for-loop when the file is loaded.
What is your perspective on this?
I would prefer the second one . running it with window.onload. I made necessary changes. |
I agree with what is written there, we can merge :) |
In reference to #90. Even though it does not fullfill all requirements it provides a basic idea.
@niccokunzmann See the changes and comment on the status.