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 ...
When you set level to a new value, you lose the reference to it in your code. Its parent FlxGroup still maintains a reference to it in its members array, however, so it continues to display. Using remove is a good idea, but I suspect you're doing it like this:
level = new FlxTilemap();
Using Flash's built inTimer isn't a great idea in Flixel. You should really use the Update function in conjunction with FlxG.elapsed, as this will respect pausing and resuming the game using Flixel.
Here's an overview of how to use Flixel's timing:
You don't set the world size with:
public function MyGame()
That is setting the size of the screen Flixel will draw onto. If you want a zoom level of 2 you should have super(320, 240, PlayState, 2).
You should check out the source for Mode to see how to create a world larger than the screen. What happens in Mode is that ...
Found it. It was the semicolon (;) after the [SWF(...)] that killed it. Got it rocking now :) I believe the FLEX compiler is to blame here, since tutorials also have this semicolon, they'll probably used the Flash IDE...
Not sure what went wrong there. Just tested that setAll("visible", false) call on a FlxGroup and it seemed to be working fine.
A few other things though:
You should not need to do a setAll() for visibility on a FlxGroup at all. FlxGroups have a visible property themselves, because they extend FlxBasic!
The button you're trying to implement, having a sprite ...
The choice of development technology is something you have to decide based on your goals. If you have never written a game before, then the last thing you need to worry about is any sort of middleware limitations, what you need is experience under your belt. Either way, the technology choice should be made based on the skillset of the development team, the ...
Hi Matthew and thank you for your question.
Since ActionsScript uses garbage collection there are only 2 reasons.
First you have references to these objects in your own objects or from a manager in fixel. In this case be aware to null your references. Maybe the tool mentioned here could be useful.
Second your garbage collection did not trigger ...
If you want to add a screen before all assets are loaded you have to use a preloader.
You can read about this here. Flixel provides simple preloader (FlxPreloader) that is easy to understand and to customize.
So, while there might be several ways to do it, I've found it easiest to make a seperate State for each of my game 'sections' - so, the Main Menu, the Game Itself, and the Game Over/Scoreboard screens would each be their own state: MenuState, PlayState, and EndState, respectively.
So, make a new Class: MenuState.as and make sure it extends FlxState. In the ...
Simple, you're calling bat.play("batAnimation",true); in your update loop. That means, your animation will restart every frame, resulting in a still image.
The second parameter to the play function is a flag whether or not the animation should be forced to restart (see docs). So either call:
in your update loop, or what I ...
There is this haxe ui builder you might want to check out.
In general however, if such a tool doesn't exist or doesn't give you what you want, what might help is to create the UI using an image editing program (like Flash/Animate or Photoshop). You can edit and fine tune it until you are happy with it, and when you are done write the code manually. This way ...
For now I have solved it in the following manner
in the PlayState class I added a function to move objects and an array to track what objects are currently moving
class PlayState extends FlxState
public var TILE_WIDTH:Int = 16;
public var TILE_HEIGHT:Int = 16;
// since flixel pathfinding does not have an onComplete callback, lets add it ...
Gama11's method is the one I would use personally. Basically you put all of your text inside a text file dialog.txt and split each dialog up with some special character or character sequence (i.e. @@).
------ dialog.txt ------
This is dialog for box 1.@@
Dialog for box 2.@@
And so on...@@
inside of your game use the following:
My guess would be it's a floating point precision difference (do the two environments use different runtimes/sandboxes? I'm not very familiar with flash).
It looks like yPos is always turning out fine. My suspicion is that it has something to do with "(yPos % 2)", try yPos as a float instead of an int. A little hack that could fix it if that doesn't work ...
You could create a Sprite subclass that features a pivot point and uses transformation matrix to update position, scaling and rotation. A nice example with source code can be found here :
Another lazy way to get around, is adding your sprite in a container sprite, then move it
so it's center is alligned with the parent's ...
I looked at what I think is the AS3Math lib you're talking about. Here is their amCircle2d class.
It doesn't look terribly useful, since it inherits from (amCurve2d)[https://code.google.com/p/as3math/source/browse/trunk/src/As3Math/geo2d/amCurve2d.as] but doesn't implement getPointAtDist, which, if you fed it a distance a long the circumference of the ...
You can successfully compile a Flixel project on Ubuntu by downloading the Flex SDK, adding it to your PATH, and running mxmlc YourMainGameFile.as -static-link-runtime-shared-libraries=true
Install Eclipse 3.7 Indigo, FDT 5 (http://marketplace.eclipse.org/content/fdt-1#.UPolm32Ux0w), and the Flex SDK mentioned above. Make a new Flash Web project and ...
You might need to mark the buffer as "dirty". Looks like you can do this via setDirty().
These threads touch on "dirty" a bit:
stamp() doesn't work with blend?
FlxSprite.pixels vs. FlxSprite.framePixels (2.55) odd behavior?.
My understanding is that Flixel has some optimizations that pre-compute values for drawing and it will only recompute them when the ...
You can have one (or a few) PNG sprite sheet and use it for multiple different sprites. You'll need to create the sprite object and use loadGraphic(graphic,true) to load the sprite sheet. "animated" must be true; if it's false the entire image will be one static frame. "graphic" is the embedded PNG of type Class
You'll have to put them all in one horizontal ...