Skip to content
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

Merged
merged 6 commits into from
Aug 5, 2016
Merged

Conversation

hkveeranki
Copy link
Contributor

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.

@@ -0,0 +1,86 @@
function Level(home, backgroundLayers, obstaclesLayer){
this._backgrounds = backgroundLayers;
this.obstacleLayer = obstaclesLayer;
Copy link
Member

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

@hkveeranki
Copy link
Contributor Author

@niccokunzmann I removed the typos and added the multiple obstacle thing as well.

@@ -59,21 +69,62 @@ function newLevel(name,backgroundLayers,obstaclesLayer){
}

function AlllevelObjects(){
Copy link
Member

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?

Copy link
Contributor Author

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(){
Copy link
Member

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?

@hkveeranki
Copy link
Contributor Author

I would prefer the second one . running it with window.onload. I made necessary changes.

@niccokunzmann
Copy link
Member

I agree with what is written there, we can merge :)

@niccokunzmann niccokunzmann merged commit 0368e56 into fossasia:gh-pages Aug 5, 2016
@hkveeranki hkveeranki deleted the levels branch August 5, 2016 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants