elemel / cannonball Goto Github PK
View Code? Open in Web Editor NEW2D physics puzzle game
License: MIT License
2D physics puzzle game
License: MIT License
The current draw scheme causes the frame rate to drop when many new actors are drawn in a short period of time. Since e.g. most particle actors draw the same or similar geometries, the should share display lists. Adding a Geometry class also opens up for separating physics and graphics geometries.
The actor will still receive the draw() call, but may delegate to a Geometry, perhaps after applying transforms for position, rotation, scale, and special effects.
The grappling gun is currently limited to static bodies. Extend it to work on dynamic bodies as well.
Currently, e.g. the cannonball disappears in mid-air whan falling off the physics world. It would be better if it fell off-screen as well.
As the cannonball approaches e.g. the lower right corner of the level, it should also approach the lower right corner of the screen.
Convexify the path for filling and physics, and keep the original path for drawing the outline.
Generate particles when the cannonball receives a strong impact. Maybe this can be achieved using the contact result callback.
Explosions could generate smoke (rename jet particles to smoke), sparks, and fire. Also use invisible impulse particles?
Materials are specified in SVG with e.g. data "material: stone". Materials provide defaults for density, texture, and destructibility.
Grenades and jet particles should be propelled by impulses instead of directly setting the velocity. The corresponding counter-impulse should be applied on the cannonball.
No rush. But if Cannonball only uses NumPy for matrix multiplication, maybe it can do without it.
Fade particle alpha during lifetime.
Explosions currently apply an impulse in the world center of the body, which does not give any rotation. Try doing raycasts and applying the impulse where the ray hits instead. If multiple rays hit a body, use their average. Try 16 rays per explosion to begin with.
Use large cloud images as Cannonball backgrounds for now. Parallax scrolling. Preferably load from SVG.
Calculate vertex normals before triangulating paths.
Requires implementing Path.triangulate(). Use triangulations for graphics and convexifications for physics.
Fire grenades longer when the space key is pressed for a longer period of time.
Generate skid particles when the tangential velocity of the cannonball at a contact is different from its linear velocity.
Normalization reverses paths with negative areas and removes vertices with straight angles.
Create Box2D bodies for all cannons and attach them to the cannonball body with prismatic joints. Also use damped springs for stability and recoil handling. Apply an impulse on the cannon when firing, corresponding to the impulse propelling the shot.
Do something useful when you take e.g. a grenade launcher upgrade and already have a grenade launcher.
Grappling gun upgrade increases grappling range. Grenade launcher upgrade increases max firing range. Jet engine upgrade could increase flight range (to be implemented).
Currently, the grappling wire passes through all objects once attached. It could reattach itself instead, or detach if it cannot attach to the obstructing object.
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.