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

Minutes/seconds of wave? #25

Open
emurnane opened this issue Jul 11, 2016 · 1 comment
Open

Minutes/seconds of wave? #25

emurnane opened this issue Jul 11, 2016 · 1 comment
Labels
Milestone

Comments

@emurnane
Copy link
Owner

emurnane commented Jul 11, 2016

Could someone confirm how many minutes or seconds a single wave lasts in PlayMail?

Please leave a comment to respond, and feel free to link to the relevant source code in the repo.

@emurnane emurnane added this to the Pre-experiment (high priority) milestone Jul 13, 2016
@ik226
Copy link
Collaborator

ik226 commented Jul 19, 2016

I found it from controller.js, line 135:

if (GLOBAL.HOURITR > totalhourloops + (2 * GLOBAL.FPS)
            && GLOBAL.ENEMIES.length === 0) {
                GLOBAL.HOURITR = 0;
                GLOBAL.HOURENEMYNUMBER = 0;
                GLOBAL.GAMEHOUR++;
                    GameInfoDisplay.hourSplash();
            }

the GLOBAL.HOURITR increments by one every 1000/60 ms (see SGmain.js : line 36).
When it hits beyond 1320 (which is totalhourloops + (2*GLOBAL.FPS)) and the array GLOBAL.ENEMIES is empty, the game proceeds to the next round.
Whenever SGmain does player.update(), GLOBAL.ENEMIES is filtered with only enemies that are "active" (controller.js : line 75) and enemy.active is a function that return a boolean indicating whether they are inside the canvas (enemy.js : line 78)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants