coteh / lavaescape Goto Github PK
View Code? Open in Web Editor NEW:arrow_up: Jump game made using Phaser 3 and TypeScript
Home Page: https://coteh.github.io/LavaEscape/
License: MIT License
:arrow_up: Jump game made using Phaser 3 and TypeScript
Home Page: https://coteh.github.io/LavaEscape/
License: MIT License
To my understanding, env vars cannot be passed to spec files because they run on browser. But with karma-env-preprocessor they can be written in.
Separated from PR #31 to reduce scope and because it's not necessary for the tests to function. Assess whether this will actually provide a performance boost.
Split from #31 . Not slowing the build down significantly but may be worth looking into whether this step can be cached.
Right now, moving platforms check for hardcoded values of -100 for left side and 600 for right side to determine when to reverse direction. Fix this by instead checking for game width + offset on right side and 0 + offset on left side, where offset is the displacement of the camera from 0 on the x-axis.
Test scenes such as lava scenes load extremely quickly, making the test suite fail completely since they end up starting before the onTestStart
handler can add the test case-specific objects to the suite. I tried making the preload
function async and that didn't appear to work either.
Investigate into how the test scenes can be initialized in a more predictable fashion. (ie. test cases should ALWAYS run AFTER the scene has loaded completely)
This appears to be more of an issue on the headless integration tests, but if the delta
were to spike really high, then the player will jump and fall much faster than they are supposed to. The delta
is there to keep the movement calculations synced with render speed (e.g. if render speed becomes half of what it usually is, then simulation will calculate movements using twice as large delta
to compensate), but it should not be higher when it's not supposed to.
Study up on these resources:
Assess whether this issue can be fixed using Phaser engine features, or if a makeshift solution with a numerical accumulator needs to be baked into scene update. Also, if this is only an issue that happens in integration tests, then possibly close this if frame rate can be mocked with a fixed value without performance/correctness issues.
https://www.npmjs.com/package/karma-typescript-mock
Leaving this here while working on #47. To be closed when that issue is complete.
Collision detection does not take into account fast moving objects. With the issue in integration tests right now (#37), if the player goes too fast due to delta spike, then the player will go past the ground.
All collision detection should take into account speed. If object is on one side of another object on the first frame but will be on the other side of the object on the second frame, then the object should be pushed back on the second frame.
Tests to be added (list to be updated, and issues can be created in the future for cases I've missed):
Remainder of classes TDB since the rest of them rely on Phaser constructs, and it's not certain how difficult it'll be to mock out Phaser functionality to be worth it.
A platform that breaks when player steps on it.
If player held down space for more than a certain time threshold, then that may indicate that the player deliberately held down space and is aware of the hold down mechanic. There would be no need to show the space bar graphic in this case.
Lines 8 to 10 in 67f3214
Right now it's not easy for the player to see where the lava is.
Two ideas:
Once it's decided which ideas to go with, make separate issues for each.
Two parts to this:
1) should be able to speed up after 10 seconds
Lava
15 06 2020 05:49:13.577:WARN [reporter]: SourceMap position not found for trace: AssertionError: expected 45.08331750021165 to be above 45.670042499482946
at Object.<anonymous> (base/test/Lava.spec.js?59f07e7a040ef901a70b8b4962f0802e56e327b5:44:58)
at Generator.next (<anonymous>)
at fulfilled (base/test/Lava.spec.js?59f07e7a040ef901a70b8b4962f0802e56e327b5:4:58)
AssertionError: expected 45.08331750021165 to be above 45.670042499482946
at Object.<anonymous> (test/Lava.spec.ts:41:51 <- test/Lava.spec.js:44:58)
at Generator.next (<anonymous>)
at fulfilled (test/Lava.spec.js:4:58)
Don't really have any good guesses right now as to why it did not speed up as expected. Look into whether this is a problem with my test code, if there's a problem with the specification of Lava behaviour, or if there's a bug.
Add test coverage with codecov and https://istanbul.js.org/ or some other combination of tools.
Due to increased complexity of #29, remaining work has been added as a new issue to work on.
List has been carried over from #29, and will be updated:
Remainder of classes TDB since the rest of them rely on Phaser constructs, and it's not certain how difficult it'll be to mock out Phaser functionality to be worth it.
These tests only need the one platform that's actually under test, but the extra platform is there for the player to get into jump state. It shouldn't have to be there - the test can be written so that player goes into jump state automatically. This will make the test case easier to understand.
When release is ready, merge it into a release
branch, which will then kick off build process that places compiled output into gh-pages
branch.
PhaserTester
would create a PhaserTestCase
for each test, which would contain things such as:
At the end of the test case (in afterEach
) the test case instance can be disposed of with a dispose
method that would remove all test objects from scene and clear all relevant event handlers.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.