beghelli / atomscollector Goto Github PK
View Code? Open in Web Editor NEWEducational game about atoms and molecules
Educational game about atoms and molecules
We need a repository to hold information about all possible atoms that will appear in the game. The atom attributes will be:
That data should be indexed by strings built based on the following: atomic number + acronym + atomic mass. So a Hydrogen would be 1H1, a Hydrogen isotope could be 1H2 or 1H3, Lithium would be 3Li6, etc.
A unit should be used whenever we need to handle dimensions in the game. Then we can calculate how many pixels each unit will have based on the screen resolutions. Doing that we will be able to present the game correctly to many resolutions, instead of just one.
See how unity's approach on this problem: https://blog.unity.com/technology/choosing-the-resolution-of-your-2d-art-assets
While playing the level, players should be able to see the name of the molecule that's required on that level. They should also be able to see the atom acronym next to each atom recipient.
To perform any ability (active or passive) the player has to spend energy.
We should display an energy bar that will represent the amount of energy the player still has and will decrease based on the player actions.
Right now the entity class is responsible for not only defining the assets to be used (texture, text, sounds in the future) but also to know how to load them and add them into the assets manager. This is done by the entity load method receiving all the assets managers that the entity will need to load things into the managers. Right now we have only the texture, but we need also the text manager (the screen writer) and in the future sound manager.
We could improve this by allowing the entity to just define the asset it wants to use and let the asset manager to know how to load it. We could also set the loaded texture as an entity attribute that points to the one loaded by the texture manager, so the entity render method won't need the texture manager as a parameter.
Players should be able to produce the level desired molecule by realizing a collection combo (see #16 ), so they can produce even more molecules compared to what they could if they just depended on their atom recipients capacity.
The engine should be able to reproduce sound (in game effects and music background)
Players should be able to shoot an atom and start a fission process, so they have more influence on the atoms presented in the level and are able to complete their task (collect certain atoms) more easily.
The shot to start a fission reaction in the atom has to have a high energy level (consumes a lot of energy from the player). That level should be fixed for now, not depending on anything external.
Once the shot hit the atom, the original atom will disappear and two or more atoms (result of the fission) will spawn exactly where the original atom was. The energy released in the reaction should move all nearby atoms (including the resulting ones) to all directions. The angle should be calculated from the last x and y of the original atom that was shot to the other nearby atoms. The angle for the atoms that are products of the reaction should be random, as they will spawn right into the same x,y coordinate.
Players should be able to shoot an atom and create an isotope by providing an extra neutron to the atom nucleus, so they can better influence the game scene and enable them to combo for energy, for example.
The shot to create an isotope should have a certain energy level that the player will have to reach by holding the mouse button. The energy level to create an isotope should be fixed for now, not depending on anything else.
Once the shot is made and the atom is hit, all the physics of the simple atom collision (see #7 ) should happen, but the atom now should be represented by a new atomic mass.
It could be nice to have some electrons animation around the atoms, even though we won't be able to represent them all because of the atom sprite size.
When a player start to build a combo the game should let it very clear.
Players should open the game and see a screen with the game name and an option to start it.
Players can perform combos when collecting atoms. A combo is a correct sequence of atoms collected in a certain limited period of time.
Two scenarios where a collection combo can happen:
In both scenarios, the combo experience should be the same:
We have to consider how we can differentiate the lighter and heavier atoms. But generally the atoms should look alike.
Bullets that are created right after another is destructed are being destructed when a third one reaches the screen limit first.
It has to do with player acceleration having a double value (instead of integer) and adding the acceleration to the velocity and calculating the next position. Not sure why the issue relates to the left and up, but I suspect it has to do with the operation, when moving up and left we decrease the player x and y. When moving to down and right, we increase.
The atoms that are not required to build them molecule can be used to produce energy for the player.
The energy production process happens automatically and should start as soon as the player collects non requested atoms. As the energy bar rises, the other atoms recipient should start emptying. When the other atoms recipient is empty, the energy bar should not increase. When the energy bar is full, the others recipient should not decrease.
When user press enter to start the game, when it confirms the level start
When an atom collides with a player
Players should be able to know the level objective (which molecule to build, the molecule formula and information about the molecule) before actually starting playing the level.
All that information should be displayed and the player can decide to actually start playing the game by pressing ENTER.
The normal collision will make the neutron disappear and the atom change direction.
Filling both should feel special to the player, we could try to add a little animation of the bar filling up and a glow around the bar, for example.
We should make the id an static attribute and let the client code get it from there when registering listeners
When an atom is collected by the player
Players should see the number of produced molecules at the end of the level and an option to go to the next level.
Whenever an atom collides with the player without the player being able to collect it (see #8 ), then we have a player and atom collision.
The atom should behave like it is colliding with a neutron (see #7 ) (change direction based on its own direction, mass and velocity and the direction, mass and velocity of the player).
The player should spend energy to be able to absorb and support the collision, suffering the same physical effects that the atom.
When a shot is made with the right energy level, it can cause an atom to fission. We need a sound to represent the neutron hitting the atom and causing the fission. The process (fission) is instantaneous, so just the sound of the fission is enough.
Using the atoms repository data, we should build an atom generator to feed the hunt atoms scene. The generator must know which atoms are part of the wanted molecule, so it can balance the number of times these atoms will appear.
Atom and neutron entities can collide and the result of that collision depends on the energy of the neutron. If the energy level is minimum, the only thing that will happen is that the atom direction should change according to the direction and velocity of the neutron and the direction, velocity and atomic mass of the atom.
The heavier and faster the atom, the less it will have its trajectory changed.
When a shot is made with the right energy level and the atom that is hit has an isotope version, a sound to represent the neutron being absorbed by the atom nucleus should be played.
Players should be able to see how many molecules they already produced during the level (realizing atoms collection combos). The number of produced molecules should only display the ones that are already produced, not the amount that is possible to produce with the current stored atoms.
Player should have the ability to collect atoms. This behavior is implemented now by just allowing the player to touch the atom and collect it.
We need to make this process a little bit harder so it is more challenging and involves a little bit more skill from the player.
The collection should only happen if the player is:
To avoid spamming the SPACE key, holding it should consume energy, so players will only be holding it when they really need to.
If the player touches an atom without completing all necessary actions listed above, the collection should not happen. For now, let's not change anything related with both entities. The player and atom collision behavior should be implemented in another issue.
Player should be able to charge a neutron with more energy before shooting it, so it can either cause an atom fission or incorporate a neutron into the atom's nucleus.
To charge the player must hold the mouse click and release it whenever the energy level in the neutron is sufficient to do what the player wants to do.
The other atoms recipient should also be a source for the player shots. Each player shot needs to decrease the amount of other atoms stored in the recipient.
If the player doesn't have any other atom store, it can't shoot.
Player shooting should produce a sound. The shot has, at least, 3 different levels of energy. We could make 3 different sounds, similar but different in intensity, for each level of energy.
Players will be able to perform a combo (see #16 ) and generate a high amount of energy if they complete the combo and have enough energy to trigger the fusion process.
The engine should be able to run animations
On each level players should have as many atom recipients as the number of unique atoms the molecule has, plus one. The extra one is to store other atoms that are not part of the wanted molecule formula.
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.