Code Monkey home page Code Monkey logo

flixelcommunity / flixel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adamatomic/flixel

84.0 25.0 17.0 11.54 MB

Community fork of Adam “Atomic” Saltsman's popular game engine Flixel. Distilled from a variety of Flash games he worked on over the last couple years, including Gravity Hook, Fathom and Canabalt, its primary function is to provide some useful base classes that you can extend to make your own game objects.

Home Page: http://flixelcommunity.org/

License: Other

ActionScript 98.88% Shell 0.30% Python 0.83%

flixel's Introduction

Flixel Community

Flixel Community is an open source game-making library that is completely free for personal or commercial use. Written entirely in ActionScript 3, and designed to be used with free development tools, it's easy to learn, extend and customize.

Features

Basic

  • Display thousands of moving objects
  • Basic collisions between objects
  • Group objects together for simplicity
  • Easily generate and emit particles
  • Create game levels using tilemaps
  • Text display, save games, scrolling
  • Mouse & keyboard input
  • Math & color utilities

Advanced

  • Record and play back replays
  • Powerful interactive debugger
  • Camera system for split screen
  • Pathfinding and following
  • Easy object recycling

##Quick start## Check Flixel Community website for tutorials.

##Contributing##

If you want to contribute with Flixel Community, be welcome! You can help us with code, testing, tutorials and much more. Take a look at the CONTRIBUTING file for more.

License

Flixel Community is licensed under the MIT license.

About Flixel and Flixel Community##

Flixel is a well known open source and free game engine created by Adam “Atomic” Saltsman. Flixel has been used in hundreds of games, including IGF nominees, Adult Swim games, and avant-garde experiments. Many Flixel users make their first game ever in Flixel.

Flixel Community was born as a healthy fork of Flixel. It is not supposed to replace Flixel or to compete with it, but to co-exist. Adam (Flixel's author) encouraged us to grow a community version and maintain it to our heart's content, even offering it as an alternative to Flixel.

flixel's People

Contributors

adamatomic avatar dovyski avatar iqandreas avatar ivangonekrazy avatar jquave avatar moly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flixel's Issues

Code for FlxG.fade() fade in

Issue #190 by: KinoftheFlames

Just added an optional boolean paramater to FlxG.fade() that controls whether the fade is fading from transparent to a color or a color to transparent (I use a fade out for states I leave and a fade in for states entered, for a smooth look).

Here are the full pastes for the FlxG and FlxCamera files on pastebin, with just the changed snippets below. Files are from the latest dev.

FlxG: http://pastebin.com/Q5bWex2K
FlxCamera: http://pastebin.com/8tbY3v4K

FlxG:

/**
         * The screen is gradually filled with this color.
         * 
         * @param   Color       The color you want to use.
         * @param   Duration    How long it takes for the fade to finish.
         * @param   FadeIn      True fades from a color, false fades to it.
         * @param   OnComplete  A function you want to run when the fade finishes.
         * @param   Force       Force the effect to reset.
         */
        static public function fade(Color:uint=0xff000000, Duration:Number=1, FadeIn:Boolean=false, OnComplete:Function=null, Force:Boolean=false):void
        {
            var i:uint = 0;
            var l:uint = FlxG.cameras.length;
            while(i < l)
                (FlxG.cameras[i++] as FlxCamera).fade(Color,Duration,FadeIn,OnComplete,Force);
        }

FlxCamera:

        /**
         * Internal, used to control the "fade" special effect.
         */
        protected var _fxFadeIn:Boolean;
            _fxFadeIn = false;

            //Update the "fade" special effect
            if((_fxFadeAlpha > 0.0) && (_fxFadeAlpha < 1.0))
            {
                if (_fxFadeIn)
                {
                    _fxFadeAlpha -= FlxG.elapsed/_fxFadeDuration;
                    if(_fxFadeAlpha <= 0.0)
                    {
                        _fxFadeAlpha = 0.0;
                        if(_fxFadeComplete != null)
                            _fxFadeComplete();
                    }
                }
                else
                {
                    _fxFadeAlpha += FlxG.elapsed/_fxFadeDuration;
                    if(_fxFadeAlpha >= 1.0)
                    {
                        _fxFadeAlpha = 1.0;
                        if(_fxFadeComplete != null)
                            _fxFadeComplete();
                    }
                }
            }
        /**
         * The screen is gradually filled with this color.
         * 
         * @param   Color       The color you want to use.
         * @param   Duration    How long it takes for the fade to finish.
         * @param   FadeIn      True fades from a color, false fades to it.
         * @param   OnComplete  A function you want to run when the fade finishes.
         * @param   Force       Force the effect to reset.
         */
        public function fade(Color:uint=0xff000000, Duration:Number=1, FadeIn:Boolean=false, OnComplete:Function=null, Force:Boolean=false):void
        {
            if(!Force && (_fxFadeAlpha > 0.0))
                return;
            _fxFadeColor = Color;
            if(Duration <= 0)
                Duration = Number.MIN_VALUE;
            _fxFadeIn = FadeIn;
            _fxFadeDuration = Duration;
            _fxFadeComplete = OnComplete;

            if (_fxFadeIn)
                _fxFadeAlpha = .999999;
            else
                _fxFadeAlpha = Number.MIN_VALUE;
        }

Suggested fix for Issue #206

Issue #212 by: IQAndreas

Using the following function names results in Migration Issue warning
from Flash Professional:
onKeyUp, onKeyPress, onKeyDown, onMouseDown, onMouseUp, onMouseMove
See Issue #206 AdamAtomic#206

Replaced all occurances of those names with:
handleKeyUp, handleKeyPress, etc.
(I hope I got them all!)

FlxG.as line 738,743 undefined property bitmapData

Issue #217 by: kreso22

My editor caught it (Access of undefined property bitmapData)

        _cache[Key] = (new Graphic).bitmapData;
            if(Reverse)
                needReverse = true;
        }
        var pixels:BitmapData = _cache[Key];
        if(!needReverse && Reverse && (pixels.width == (new Graphic).bitmapData.width))

FlxCamera and FlxGroup - Make FlxGroup pass its cameras array to its members

Issue #201 by: mouseas

I was having a hard time figuring out how to only show object groups on specific cameras. Finally I found out the FlxBasic does not grab its cameras array from the FlxGroup it's in, nor does a FlxGroup apply its cameras to its members. This means I have to tell each object to use a specific array of cameras.

May I suggest adding a feature to FlxGroup where if it has an array of cameras, you can tell it to apply that array to all its members when they're added and/or updated? If it's done that way, it's much easier to put all the objects going in my map in one FlxGroup, the radar in another FlxGroup, and the main play area in a third FlxGroup, for example.

FlxG.collide with a tilemap doesn't return tiles coordinate

Issue #188 by: sakurati

The callback assigned to Flxg.collide gives back a FlxOject with coordinates x = 0 and y = 0 all the time

I used the following code:

override public function update():void 
{
      FlxG.collide(_bullets,collisionMap,bulletMap);
      super.update();
}

private function bulletMap(b:FlxObject,cmp:FlxObject):void 
{
     FlxG.log(String(cmp.x) + "," + String(cmp.y) + "; " + String(b.x) + "," + String(b.y));
}

I get the following output for multiple bullets shot:

51.199999999999704,440; 0,0
410.07500000000067,312; 0,0
461.2250000000009,312; 0,0

Note: the tile resolution used is 8 x 8

FlxTilemap.ray() Result value always null

Issue #224 by: cr0ybot

Supposedly AS3 passes all objects as reference, but this does not appear to be the case with the "Result" FlxPoint in FlxTilemap.ray(). Checking the Result value always results in null.

See this stackoverflow question for a very similar situation:
http://stackoverflow.com/questions/3708371/actionscript-pass-by-reference

Why is it necessary to do the raycast in this manner? Why return a boolean at all if you can just return the FlxPoint (if the ray hits anything) and check for null?

FlxText and problem with camera zoom

Issue #181 by: xraven13

When zoom of FlxCamera and FlxGame are not the same, FlxText objects are not placed on the correct position. It took me some time to figure out why FlxText doesn't display, and at end it was because he was out the screen. I tested many things so that I am sure it's not problem in the scroll...

FlxU.formatArray() includes first element twice

Issue #214 by: axcho

FlxU.formatArray() first adds AnyArray[0].toString() to the result string, then iterates through the array starting from var i:uint = 0; which duplicates the first element. It should iterate from var i:uint = 1; instead.

Added extra functions to "Input"

Issue #215 by: IQAndreas

Added:

  • getKeyName - Returns the key's name based on the passed in KeyCode
  • justPressedAny - Was any key just pressed?
  • justReleasedAny - Was any key just released? (duh!)

Nested FlxGroups call update() functions in the wrong order

Issue #195 by: KWarp

In an ideal world, Flixel should call preUpdate() on all game objects, then update(), then postUpdate().

When FlxGroups are nested, this is not the case. The inner FlxGroup will call preUpdate()/update()/postUpdate() during the outer FlxGroup's update() function.

For me, this behavior causes subtle off-by-one-frame errors where objects seem to lag one frame behind.

Solution: Explicitly call preUpdate() and postUpdate() at the FlxGame level, and have those calls trickle down the FlxGroups.

// in FlxGame.as
protected function update():void
        {           
            var mark:uint = getTimer();

            //FlxG.elapsed = FlxG.timeScale*(_step/1000);
            FlxG.updateSounds();
            FlxG.updatePlugins();
            _state.preUpdate();
            _state.update();
            _state.postUpdate();
            FlxG.updateCameras();

            if(_debuggerUp)
                _debugger.perf.flixelUpdate(getTimer()-mark);
        }

// in FlxGroup.as
override public function update():void
        {
            var basic:FlxBasic;
            var i:uint = 0;
            while(i < length)
            {
                basic = members[i++] as FlxBasic;
                if((basic != null) && basic.exists && basic.active)
                {
                    basic.update();
                }
            }
        }
override public function preUpdate():void
        {
            var basic:FlxBasic;
            var i:uint = 0;
            while(i < length)
            {
                basic = members[i++] as FlxBasic;
                if((basic != null) && basic.exists && basic.active)
                {
                    basic.preUpdate();
                }
            }
        }
override public function postUpdate():void
        {
            var basic:FlxBasic;
            var i:uint = 0;
            while(i < length)
            {
                basic = members[i++] as FlxBasic;
                if((basic != null) && basic.exists && basic.active)
                {
                    basic.postUpdate();
                }
            }
        }

Crash when Streaming MP3s with no ID3 info for Artist or Song Name

Issue #198 by: snotwadd20

In dev, whenever I try to stream an ID3 that doesn't have info for Artist or Song Name I get a crash. I fixed it with this, in case that helps:

In FlxSound:

protected function gotID3(event:Event=null):void
{
FlxG.log("got ID3 info!");
if(_sound.id3.songName != null && _sound.id3.songName.length > 0)
name = _sound.id3.songName;
if(_sound.id3.artist != null && _sound.id3.artist.length > 0)
artist = _sound.id3.artist;
_sound.removeEventListener(Event.ID3, gotID3);
}

Suggested fix for issue #158

Issue #213 by: IQAndreas

The FlxObject following a path will continue to move even if they run
out of path. ( see Issue #158 )
AdamAtomic#158

This fix adds a "StopWhenFinished" option to "FlxObject::followPath",
as well as some minor changes to avoid repetitious code.

FlxEmitter problems with non-square sprites

Issue #222 by: cyberpro4

I've got some problems with FlxEmitter rotation: I've used some non-square image as particles but during rotation happen two things:

First, the particles was cutted: this was caused by loadRotatedGraphic in makeParticles function: the default AutoBuffer parameter is set to false and there's no way to force it to true via makeParticles() func.

Second, since my bitmap is trasparent I've notice an white solid fill in final rotation bitmap: in FlxSprite::loadRotatedGraphic() the brush variable is constructed with default fill color 0xFFFFFFFF ( solid white ).

At now, I've force these values, but I think this "bug" needs to be fixed.

Error with Quad Tree when making shotgun.

Issue #196 by: test84

Hi,

If you want to create something like a shotgun where multiple small bullets move together, if any of them collides, the adjacent ones will get collided. In order to fix it I temporarily increased world divisions to 64: FlxG.worldDivisions = 64; but that doesn't help when you stand next to a tile and shoot, it will have bullets go through them.

Let me know if you need an example and I'll mail you my game.

-test84

FlxTilemap.loadMap() doesn't initialize widthInTiles

Issue #197 by: GregoryWeir

FlxTilemap.loadMap() doesn't initialize widthInTiles, but expects it to be zero. It only updates widthInTiles based on the provided map if widthInTiles is 0, which means that loading a new map into an already-initialized FlxTilemap does not change the width of the map.

I suggest that loadMap() set widthInTiles to 0 near where it sets the value of heightInTiles, which will allow the later while loop to properly set the tilemap's new width.

makeGraphic, scaling and origin problem

Issue #182 by: xraven13

I noticed that scaling doesn't work good when graphic is created with makeGraphic method. I was changing origin as well ( to 0 ) so if it works with normal origin, test it with other origin then...

FlxPreloader.myURL should take a proper URL

Issue #193 by: sabren

Right now, FlxPreloader.myURL doesn't really take a URL, and if you use one (with the full http:// prefix), it gets corrupted.
It also prevents https:// URLs.

The fix is pretty simple:

    private function goToMyURL(event:MouseEvent=null):void
    {
        var prefix:String = myURL.match(/^https?:/) ? "" : "http://"; 
        navigateToURL(new URLRequest(prefix+myURL));
    }

... Which keeps the current behavior, but also supports full URLs.

Mouse.as doesn't like negative cursor offsets mixed with native Flash

Issue #207 by: ChainedLupine

This is a bit of an edge case, but it's something that will be a rather unfun "gotcha" if you happen to be mixing native Flash display objects with Flixel.

If you want to center a mouse cursor, and use something like this:

FlxG.mouse.show (ImgMouseRecticle, 1, -12, -12) ;

Then mouse events will stop firing for any Flash objects which happen to be above the FlxCamera Sprites but below the Mouse sprite. The reason for this is because the _cursor sprite will always be on top of whatever is below, and will receive all of the mouse events and not pass them on (as is default). (With a positive offset, you would never notice this because the _cursor sprite wouldn't be on top of the mouse location.)

A solution to this is to add

_cursorContainer.mouseEnabled = false ;

To the Mouse constructor.

Hover over button cursor graphic request

Issue #183 by: wgr

It would be nice if Flixel had an easy way of changing the cursor when hovering over a button (typically made to look like a hand) built into it.

For now I hacked it in to my project with these changes, but it would be nice if it was supported out of the box:

In FlxButton:
while(i < l)
{
camera = cameras[i++] as FlxCamera;
FlxG.mouse.getWorldPosition(camera,_point);
if(overlapsPoint(_point,true,camera))
{
offAll = false;
if(FlxG.mouse.justPressed())
{
status = PRESSED;
if(onDown != null)
onDown();
if(soundDown != null)
soundDown.play(true);
}
if(status == NORMAL)
{
status = HIGHLIGHT;
FlxG.mouse.load(Assets_Ui.cursor_hand, 1, -9); // added this
if(onOver != null)
onOver();
if(soundOver != null)
soundOver.play(true);
}
}
}
if(offAll)
{
if(status != NORMAL)
{
FlxG.mouse.load(Assets_Ui.cursor_point, 1, -9); // added this
if(onOut != null)
onOut();
if(soundOut != null)
soundOut.play(true);
}
status = NORMAL;
}

In FlxState:
public function create():void
{
FlxG.mouse.load(Assets_Ui.cursor_point, 1, -9);
}

In all of my states that extend FlxState:
override public function create():void
{
super.create();

flixel 2.54 chokes on empty FlxTileMaps

Issue #185 by: KWarp

in flxtilemap's draw function:

if(_buffers[i] == null)
_buffers[i] = new FlxTilemapBuffer(_tileWidth,_tileHeight,widthInTiles,heightInTiles,camera);

If a flxtilemap is empty, then _tileWidth, _tileHeight, widthInTiles, heightInTiles all have a value of zero. Later, an exception is thrown in the BitmapData class, since it is invalid

debugger overlay should display number of active sounds

Issue #208 by: AdamAtomic

assuming all sounds are played through flixel, i SHOULD be able to count the number of active sounds and display that as part of the performance window. would be nice for tracking down Flash sound thread issues (even though it's not guaranteed to reflect the state of the sound thread)

Flixel should warn programmers when FlxCamera fills are transparent

Issue #187 by: KWarp

I was writing a FlxCamera subclass when I noticed that moving objects on my screen were leaving a paintbrush trail of themselves as they moved. After HOURS of debugging, I found the problem in my FlxCamera subclass constructor:

this.bgColor = 0xFFFFFF; // no alpha

When it should have been:

this.bgColor = 0xFFFFFFFF; // 100% alpha

Flixel should throw an exception, or at least log a warning, when transparent fills are passed in to bgColor or FlxCamera.fill()

FlxCamera follow jitters

Issue #227 by: volvis

I noticed an ever slight jitter around my playable character when the camera was tracking it. Imagine the sprite jumping a pixel in advance and back the second frame and you get a good idea of the effect I'm talking about.

Poking around the update call in FlxCamera, rounding the coordinates of the game character seemed to fix the issue.

var targetX:Number = int(target.x) + ((target.x > 0)?0.001:-0.001);
var targetY:Number = int(target.y) + ((target.y > 0)?0.001: -0.001);

Can't really tell if it's a bug or not, but I figured I'd toss it out in the open.

drawTilemap() called infinitely when FlxG.width and FlxG.height is over 1000

Issue #186 by: accidentalrebel

Is it normal for drawTilemap() of FlxTilemap.as to be called all the time when FlxG.width and FlxG.height is over 1000? The reason why I am asking is because it is affecting the frame rate of my game.

In order for me to check, I placed a trace under drawTilemap function. Then I used the code: super(1000, 1000, PlayState, 1) to create a flxGame object. After running the program, the trace is called over and over again non-stop. But, if I reduce the width and height to 900 or lower, the trace is only called once.

To investigate further, I opened up one my other peojects, did the check, and the results were the same.

I temporarily fixed the problem by modifying FlxTilemap.as. I'm not really sure about this one but it did the trick.

What I did is that I've added a "buffer.dirty = false" on the first if statement.

if(_buffers[i] == null)
    _buffers[i] = new FlxTilemapBuffer(_tileWidth,_tileHeight,widthInTiles,heightInTiles,camera);
buffer = _buffers[i++] as FlxTilemapBuffer;
if(!buffer.dirty)
{
    _point.x = x - int(camera.scroll.x*scrollFactor.x) + buffer.x; //copied from getScreenXY()
    _point.y = y - int(camera.scroll.y*scrollFactor.y) + buffer.y;
    buffer.dirty = (_point.x > 0) || (_point.y > 0) || (_point.x + buffer.width < camera.width) || (_point.y + buffer.height < camera.height);

    // This is a temporary fix for the performance problem for drawTilemap function
    buffer.dirty = false;
}
if (buffer.dirty)
{
    drawTilemap(buffer,camera);
    buffer.dirty = false;
}

FlxQuadTrees.as - overlapProcessed isn't properly cleared (2.55 Master)

Issue #203 by: ChainedLupine

In FlxQuadTrees.as, around line 568, the overlapProcessed flag isn't be cleared every cycle through the iterator. This will cause problems if you are using processingCallback to prevent overlap detection in certain circumstances.

Example: Using FlxQuadTrees as a broad-phase detector and doing more detailed collision detection in the processingCallback.

This leads to notifyCallbacks being called where they shouldn't be, so false positives in the example above.

Corrected version below:

            //check for intersection of the two hulls
            if( (_objectHullX + _objectHullWidth > _checkObjectHullX) &&
                (_objectHullX < _checkObjectHullX + _checkObjectHullWidth) &&
                (_objectHullY + _objectHullHeight > _checkObjectHullY) &&
                (_objectHullY < _checkObjectHullY + _checkObjectHullHeight) )
            {
                overlapProcessed = false ; // bugfix, this should be set to false on every iterative check

                //Execute callback functions if they exist
                if((_processingCallback == null) || _processingCallback(_object,checkObject))
                    overlapProcessed = true;
                if(overlapProcessed && (_notifyCallback != null))
                    _notifyCallback(_object,checkObject);
            }
            _iterator = _iterator.next;

focusLost auto-pause toggle

Issue #205 by: SeiferTim

Would be nice to have a variable in FlxGame that sets whether or not the game pauses on focusLost.
if it's easy to set/clear, you could make it so the game does not pause on the menu screen or on cutscenes or something.

Hi, There are some migration issue if publish by Flash IDE

Issue #206 by: cjboy1984

Following are the issue function name:
onKeyUp, onKeyPress, onKeyDown, onMouseDown, onMouseUp, onMouseMove

If you publish by Flash IDE, it will show lots of warnning like:
"Migration issue: The onRelease event handler is not triggered automatically by Flash Player at run time in ActionScript 3.0. You must first register this handler for the event using addEventListener ( 'click', callback_handler)."

Updates to flx.py.

Issue #189 by: ivangonekrazy

Change to flx.py to make it more cross-platform compatible:

  • The script now generates proper file and directory paths
    for Windows, Mac, Linux.

Usability changes:

  • Print usage message if no project name is provided.
  • The project directory is created if it doesn't yet exist.
  • The comment generated in Default.css is now commented out.

Changes to make the script more "Pythonic":

  • String literals for the file templates are now just one string
    instead of a list of strings.
  • Variables in the templates are interpolated into the strings
    rather than concatenated.

Alpha changing incorrectly

Issue #219 by: mouseas

I have the following code in a FlxSprite:

override public function update():void {
    // Here is my +1 error, the last time this branch is true, it sets the frame one past the end of the spritesheet.
    if (frame < frames) {  
        frame = frame + 1;
        trace(frame);
    }

    lifespan += FlxG.elapsed;

    if (lifespan > 3) { // 3 seconds before starting fade
        alpha = (1 - ((lifespan - 3) / 15)); // <--- this line...fade slowly over 15 seconds
    }

    if (alpha < 0.01) {
        State.s.remove(this, true);
    }
    super.update();  
}

Instead of taking 15 seconds to fade out, the sprite fades out in less than a second. I took a quick poke into the alpha-related code in FlxSprite, and it looks like alpha is adjusted in discrete increments. Problem is, if the amount the alpha is supposed to change is too small, it still drops it one increment. The end result? The FlxSprite is invisible when its alpha value is actually at around 0.95 - 95% opaque, i.e. ever-so-slightly see-through.

Edit: I was able to isolate the problem quite a bit. It was trying to fade on a non-existant frame (thanks to a +1 error on my part), ie the frame it was currently on was a copy of the last frame. I tried using makeGraphic() and the same bug happened. Basically, this bug occurs when the graphic is unique and there's no sprite/spritesheet to reference back to. If the frame is a valid image on a spritesheet, this bug does not occur.

Expected behavior: Sprite fades slowly, based on alpha value.

Actual behavior: If sprite graphic is unique, it fades quickly. The change in actual transparency is not in line with the alpha value.

To reproduce:

  1. Create a sprite and either (a) use makeGraphic() and possibly some draw methods to create a unique graphic, or (b) load an animated spritesheet and set the frame outside the range of existing frames.
  2. Adjust the alpha of the sprite slowly over many frames. Display the numeric alpha value somewhere for comparison; the alpha value should be much higher than the sprite's visibility.
  3. For comparison, use an existing frame or the default image, and adjust the alpha slowly as before. This time the alpha value matches the sprite's visibility.

FlxGroup.kill() and Flxgroup.revive()

Issue #202 by: dreadknought

I've noticed that FlxGroup.kill() kills all members of the group, as well as the group object itself, but that FlxGroup.revive() only revives the group object itself, and not its members. Perhaps there could be a fix such that FlxGroup.killmembers() and FlxGroup.revivemembers() would only kill and revive its members, whereas FlxGroup.kill() and FlxGroup.revive() would only kill and revive the group object itself.

Animation looping problem

Issue #216 by: camasthecat

FlxSprite's looping Boolean is currently doing nothing because this in FlxSprite::play()

if(!Force && (_curAnim != null) && (AnimName == _curAnim.name) && (_curAnim.looped || !finished)) return;

Should be this:

if(!Force && (_curAnim != null) && (AnimName == _curAnim.name) && (!_curAnim.looped || !finished)) return;

With this fix a non-looping animation will actually not loop. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.