splinterofchaos / gravity-battle Goto Github PK
View Code? Open in Web Editor NEWA game about gravitational orbit.
A game about gravitational orbit.
Currently, code is duplicated whenever i want to create a new high score be it a fastest time or arcade high score. Thus far neither chaos mode nor dual mode have their own high score probably due to this.
It is difficult to describe why and what happens, but something is wrong with the code. Stoppers can and have:
--Run into each other and gotten stuck.
--Not switched states from stopped when orbitals collided with them.
--many more phenomena.
When stoppers run into each other, a game rule must dictate what happens to them. Their normal behavior would be to flip endlessly between stopped and movable until the game is reset. (That's a 50/50 chance the player can get one of them.) If the game rule is that one will die, then sometimes they will crash into each other at high speed and one will die, which should never happen unless one spawned on top of the other.
To add to this problem, Stopper::collide_with has become messy in hunt for a solution. Some lines of code were scrapped, some weren't, and some no longer have a purpose. A cleanup of this code or a re-write is necessary before even solving the problem.
Currently, any score will eventually get deleted from the high score table simply by higher scores coming along. Some scores may be special, or users may want to save individual high scores in one table.
A token can be perpended to a scorer's name to identify a special score. If ten scores are kept in the table, this special score would be considered the 11th if it were lower than the 10th. The user can have as many special scores as s/he wants and would not be limited by the maximum number of scores since special scores will only count up to ten scores.
It is needless to say that regular scores will not be added if they are smaller than the 10th score, even if it is largest than the 11th. And if a regular score is bumped to 11th place, it will be deleted.
Perhaps the best method would be to put scores into a container, order by score, then:
let i = 0
while i < size of container:
if does not have special token:
remove.
i--
i++
Currently unicode is completely untested here. To test, play a game, then edit Highscores.txt to some name containing unicode characters, and run the game again. Is the high score printed properly?
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.