This example illustrates the use of XMLHttpRequest as a method to conduct basic performance monitoring. While doing so you will be introduced to the basics in sending XMLHttpRequests and how to setup event handlers for managing on-going requests. Continue reading Using XMLHttpRequest to Measure Round Trip Time
If you have been playing around with Box2D then chances are you have already figured out how to simulate linear projectile motion or maybe even tried to simulate arrow flight. These are all great places to start, but maybe you are looking for something more advanced? How about a projectile that scans for targets and when it has locked on to one follows it to the bitter end? Continue reading Tracking Missile in Box2D
Simulating a single source of gravity is a sinch in Box2D. You can even switch gravity off if you like. But what about simulating multiple gravity sources, like planets? This isn’t as hard as it sounds, but requires some additional work. Something to consider is that when simulating radial gravity, or planet gravity, we don’t work with the same scales as in, um, the universe. Instead of orbits that are thousands kilometers we’re working with ten to fifty meters, depending on the canvas size and pixel to meter ratio you are using. Continue reading Simulating Multiple Sources of Gravity in Box2D
Projectiles are a common game component and Box2D can help simulate projectile motion fairly well. But even Box2D has it’s limitations. The typical flight trajectory of an arrow is a good example. Continue reading Simulate Arrow Flight
When you create a game or app that requires input from the user via the mouse then knowing the coordinates of the mouse is pretty damn important. And when trying to find the relative coordinates of the mouse on the canvas on a page where there are several elements with their own alignments and borders and margins it can seem like a pain. Continue reading Where’s my mouse at?