Tag Info

Hot answers tagged

116

Now for a less flippant response, with some suggestions. Don't take these as implementation recommendations, more as examples of possible use. Builder: set up component-based entity one component at a time, based on data Factory Method: create NPCs or GUI widgets based on a string read from a file Prototype: store one generic 'Elf' character with initial ...


32

I wrote a book on exactly that topic: Game Programming Patterns. The chapters that are there might be helpful for you.


23

Here is an article about setting up the environment for FlashDevelop so you are purely working with it.


18

First I'll explain the principle, then the drawing part: In my example I'm assuming that you have a progress value of 0 to 100 (%), even though anything else will do. On a straight line, the current position of progress-bar would simply be that progress value. On a circle you get that position with trigonometry. Any point on a circle is given as: ...


16

Let's separate your problem into its distinct issues... A word on code quality Your code currently has your platforms directly controlling your player's velocity and even the world's gravity constant. It's hacky, and it's procedural when it should be object-oriented. Once you start expanding this game things are going to get ugly fast. You need to ...


15

If you're looking for free, you can take a look at haXe


13

Flash garbage collector doesn't work very well, nor its destructors do a good job of actually destroying things either. Even if your code is correct and shouldn't leak, Flash might mess it anyway. Try to allocate the bare minimum of things you actually need, and instead of destorying and recreating them, just recycle them.


12

Find an engine that runs on all three platforms (i.e., is cross-/multi-platform) and meets your requirements. The latter will vary with time and only you know all the requirements you need, so finding the correct engine is left up to you.


10

Pygame is by far my favorite. Since programming in python means you will program fast and since 2D things are fast to do, pygame will be fun...


10

Since you already check if the player is inside the viewing-area of a cop, you can follow this up by a line-of-sight check. It seems like you use a bitmap-based approach for your entire world. Therefore I suggest you do the following: Check if player is inside a viewing-area of a cop If yes, use the Bresenham line algorithm to sample pixels of the walls ...


10

If you're talking a tile-based isometric game, you have a fixed number of different depths that are bounded between some known nearest and farthest depth. In that case, it's a perfect candidate for a pigeonhole sort, which has the best possible algorithmic complexity. Just make an array where each index corresponds to a depth, and each element is a ...


10

There are a lot of ways to compute distances, every dot product can be used: a looot of ways. In your case you surely want to compute the distance between the center of the tiles. I take for granted that you know how to compute the center of a tile. Once you know the position, you can use the Euclidean distance in the canvas' coordinate space (i.e. ...


10

I use the following method which is pretty much just an implementation of this algorithm. It's in C# but translating it to ActionScript should be trivial. bool IsIntersecting(Point a, Point b, Point c, Point d) { float denominator = ((b.X - a.X) * (d.Y - c.Y)) - ((b.Y - a.Y) * (d.X - c.X)); float numerator1 = ((a.Y - c.Y) * (d.X - c.X)) - ((a.X - ...


9

I've been using LÖVE for some time now and I like it a lot. You would have to learn Lua, but it is a fun little language to learn anyway. The people at the forum are extremely helpful.


9

Definitely look into flixel. It already covers a lot of your requirements. Also check out Flash Game Dojo. That will help getting you started. Update: For the sake of completeness: Also look at FlashPunk. It is similar to flixel but has some other strenghts/philosophy. Check out the Flash Game Dojo page for a brief comparison.


9

At our studio we are working with haXe and NME, and the advantages are great. Performance and cross-platform are the more important points (at least for us). Pros Even with only a few people in the forums, you can receive a lot of help. It's a very active community. Check at haxenme.org, haxe.org, and haxe group in Google groups. Numerous people ...


9

It is important to note that Flash cookies (or Local Shared Objects, as they are called) are different from browser cookies stored by webpages and JavaScript. From the Wikipedia article on Local Shared Objects: By default, a Flash application may store up to 100kb of data to user's hard drive (browser cookies have a limit of just 4kb). The defined ...


9

What you're asking is related to probability theory. It's easiest to work with one reel, and then extend it to multiple reels once you understand how it works. Consider if you had a reel you have some symbols which you want to assign to the stops. More symbols on a reel will lead to greater control over the final results, but will feel more random to the ...


9

There are 360 degrees (2π radians) in a circle. Divide that by the number of objects, and that tells you the correct angle between the objects, for even spacing. If you want to keep the objects the same distance apart no matter how many objects are in the circle, we need to calculate the distance out from the center at which points are that distance apart. ...


9

As I said in the comments, a 2D array would probably help you out. Lets say this is our 5 by 5 grid and we have a match So we know 3 tiles will be removed, therefore we need to randomize 3 new values for 3 spots. The catch is however we first need to move the tiles in the same column that were above( blue ) the tiles that were removed (red). It would be ...


8

Flash is dying. Whatever some Flashers may tell you, HTML5 is slowly taking its place. Slowly, because HTML5 still isn't really production ready in many senses, for full-fledged and straightforward game dev. You can see solid stats for the shift over the last year if you look (for example) at those jobseeking sites that record these things, Flash demand is ...


8

It's probably good to stage your beta into at least 2 sections. The key issue is that having a "public" beta too early is a bad idea, as it can server as bad word of mouth. The people who are in your public beta test are the same people you want to use to spread some publicity (even for a free game). If you need to get some early testing in, I would ...


8

You could use a recursive function to generate a root crack, and along that root crack, generate smaller branches of cracks, and so on. You could even animate this to make the effect even cooler.


8

Apparently for iOS specifically, there is no Bluetooth API exposed via the SDK. While the rest of this answer may apply to other platforms, you aren't going to be able to make it work in the iPhone. For other platforms... as far as I know there's is no API for Bluetooth access in Flex. You have a few other options though: This document describes how to ...


8

I'm not sure if I understood your problem correctly, but I assumed that what you want to do is find the resultant direction of you ball after a collision. Here's a quick drawing on my white board that shows a possible solution for that: The green arrows represent the ball's velocity (as a vector), the blue blocks represent your large black blocks and the ...


7

You can access the underlying BitmapData of a FlxSprite by using sprite.pixels or sprite.framePixels. You can then use BitmapData's drawing methods for simple things. If you need to draw a circle, you'll probably want to make a DisplayObject like a proper Sprite, draw on it using Graphics, and then use the BitmapData's draw() function to draw it onto the ...


7

If you are a programmer then I'd recommend Flex, which is Adobe's free SDK which compiles flex (essentially ActionScript) projects into Flash SWFs. This way you never have to muck around with the horrible Flash timeline etc. The SDK to compile is free, and Adobe sell the IDE Flex Builder (now called Flash Builder for some reason) for loadsa money. But ...



Only top voted, non community-wiki answers of a minimum length are eligible