Hot answers tagged

3

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: http://flashgamedojo.com/wiki/index.php?title=Timer_(Flixel)


2

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 ...


2

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 ...


2

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 ...


2

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.


2

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 ...


2

openfl.Assets.getText("assets/dialogs/exampleDialog.txt"); should do the trick.


1

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 ...


1

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 ...


1

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: var dilog_boxes:Array<...


1

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 ...


1

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 ...


1

I've found it helps to set all references for objects to null on destroy.


1

So what i did to fix this is, i made 10 variabiles in advance and made the code check if there are any dead ones first, and then just revive the dead one. Recycling 10 objects forever fixed the leak


1

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 : http://jamesvango.co.uk/blog/?p=136 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 ...


1

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 ...


1

Your signature for SetDirection() is incorrect. It should be SetDirection(e:TimerEvent). Flash can be forgiving about this sort of thing resulting in some infuriatingly subtle errors.


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