pomax / pjs-2d-game-engine Goto Github PK
View Code? Open in Web Editor NEWProcessing.js 2D Game Engine
Processing.js 2D Game Engine
I'm trying to code some platforms that appear and disappear. If the player is above the platform, when it disappears, the player should fall down. Now the player stays at the position where the platform was an needs jumping to update its position. Should I call some function from the class Player to make it to update its position and fall down after removing the platform?
Thanks for your help!
To prevent O(n^2) collision detection, make sure everything that performed collision detection X-to-Y does not also have a codepath that checks Y-to-X
Right now it's a naive bounding box check, which will fail for angled boundaries.
Relevant code entries:
https://github.com/Pomax/Pjs-2D-Game-Engine/blob/master/Computer.pde#L30
https://github.com/Pomax/Pjs-2D-Game-Engine/blob/master/Positionable.pde#L415
https://github.com/Pomax/Pjs-2D-Game-Engine/blob/master/Boundary.pde#L301
Taken together, these tell the story of code that does what it's supposed to, but not what we want - Boundary.redirectForce/4 should be able to indicate whether we're still on the boundary or not, rather than simply whether or not the forces were manipulated.
this is most obvious when jumping through a corner where two boundaries meet. There are multiple trajectories possible where the actor ends up going through each boundary in a permitted way, even though the combination of the two boundaries should result in a block:
↘
┌--
Tried making it work with Processing 2.1 and its here https://github.com/carlmacdiarmada/spriteengine I could be doing something wrong, doesnt recognise classes, soundmanager, spritemap etc
aiming with the mouse on a level layer with default transforms +0/0 *1/1 works fine, but with non-default transforms the coordinate transformation from "mouse coordinates" to "level coordinates" seems very off.
Fiddling with the viewbox settings does not appear to restrict the draw context correctly. This might be the cause for massive slowdowns seemingly caused by the amount of repeated ground tiles being drawn.
Whilst using some methods from the ViewBox class in my code, I encounter a Null Pointer Exception with the following line(s) of code:
setLevelLayer(who.getLevelLayer());
float ax = round(who.getX()), ay = round(who.getY());
I'm using Processing 3.3.6, could this be the issue?
First of all, thanks for the awesome library!
I'm working on a simple Processing (no JS) project for my bachelor. In my PDE file I need the setup() and draw() methods because I'm using another libs that require it so. Would it be possible to create an instance of the Player class to create a player object, like it is possible with the CollisionDetection class?
Thanks for your help!
Dissolving the amount of gravity the closer something is to the ground would reduce lag. I have done this with many languages such as Processing and WebGL, trust me, it would help.
rather than doing viewbox positioning manually, this should be done automatically, where we pass the viewbox one or more actors, and the viewbox will then try to keep those in screen. This may effect zooming if there's multiplayer going on. This is good =)
fractional coordinates should be forced integer before image draws are executed, to ensure crisp rendering
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.