サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
ノーベル賞
lab.polygonal.de
Bitwise operators are very fast in AS3, so here is a small collection of code snippets which can speed up certain computations. I won’t explain what bit operators are and how to use them, rather pointing to an excellent article hosted on gamedev.net: ‘Bitwise Operations in C’. If you know any good tricks that are not included here, feel free to leave a comment or send me an email. All benchmarks w
Here is a minimalistic FlashDevelop AS3 project that demonstrates how to use the Molehill API to draw a single 2D sprite on the screen. You can get the project here: fdproject-mole2d.zip. Assuming you have followed the instructions below the result should look like this: Flash: Simple 2D Molehill Example To compile the example you need the Incubator version of the Flash Player, a new FlexSDK (“Her
Joa Ebert is right when he says that utilizing object pools can make your code perform a lot faster. An object pool is just a container for a bunch of pre-constructed objects that are kept in memory ready for use, rather than being repeatedly allocated and destroyed on demand. Object pooling makes sense if: you create dozens of short-lived objects in real-time applications like games you need to s
More examples: 200 stacked boxes polygon soup compound shapes So here it is – due to lack of free time I have not managed to include all planned features, but I’m working hard to include those in the next update. For now I have removed many things and tried to clean up the source a little bit. Still some parts are very messy but will be fixed in the next days, so this is more a preview than a full
I’ve been working on different approaches to speed up the collision detection stage for some while now (mainly for the motor engine and some games). This includes a Quadtree which I started working on last year, but just recently got around to pick it up again. I’m still fine-tuning the code, so I can’t share it at the moment. But, because I added some visualization stuff to help fix some bugs, I
When developing games you often need a PRNG that, once initialized with a seed value, produces always the same sequence of random numbers after it. The Math.rand() function in Flash is a PRNG, but it doesn’t let you define a seed value (I think it’s picked randomly when the swf starts, but there isn’t much information about it) so another solution has to be found. One of the best PRNGs is the Mers
Trigonometric functions are costly operations and can slow down your application if they are extensively used. There are two reasons why: First, Math.sin() is a function, and thus needs a function call which simple eats up some time. Second, the result is computed with much more precision than you would ever need in most situations. Most often you just want the periodic wave-like characteristics o
What I have done the last days: – contact point calculations – two collision response models (simple & fast + physical accurate) – different integrators (Euler, Verlet, Mid-Point, RK4) – basic forces (gravity, spring, attractor, repulsor..) – dynamic and static friction So basically the engine is working now. There are some small bugs when handling multiple simultaneous contacts which I’ll solve l
I’ve just uploaded a new version of my data structures library for Haxe to haxelib. Please note that the new version requires Haxe 3.3.0-rc.1 and might not even compile using an older version like 3.2.x. Many thanks go to Simon Krajewski and Hugh Sanderson for fixing countless Haxe bugs related to my library :) The update includes many small breaking changes so I’ve decided to release a new major
First, I have updated the data structures source to version 0.7.3, so make sure you have the latest version. The source code for the SWFs in this post can be obtained here (Flash CS3 required). Using the tree iterator Before we build a tree its important to understand how the tree iterator works. Normally the iterator is used to iterate over the structure’s data – in this case the iterator additio
Collision detection with Recursive Dimensional Clustering Brute force comparison Collision detection can be done in many ways. The most straightforward and simplest way is to just test every object against all other objects. Because every object has to test only for others after it in the list of objects, and testing an object with itself is useless, we arrive at the well known brute force compari
So the main thing to keep in mind is that a for..in loop is now roughly 28 times slower than a standard integer loop - in AS2 the impact wasn't that big. Also don't overload the loop header, but put everything in the loop body instead, for example: // slower var k:int = 1000; for (var j:int = k - 1, i:int = 0; i < k; j = i, i++) { } // faster var k:int = 1000; var j:int = k - 1; for (var i:int = 0
このページを最初にブックマークしてみませんか?
『http://lab.polygonal.de/』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く