From 00fff01e0438be57f10f7f2db09113f5eb8b6b76 Mon Sep 17 00:00:00 2001 From: YoshiCrafter29 Date: Tue, 11 Oct 2022 09:29:58 +0200 Subject: [PATCH] character scripts --- assets/charts/{guns => tutorial}/test.hx | 0 assets/data/characters/bf.hx | 23 + buildnumber.txt | 2 +- docs/doc.xml | 10324 ++++++++-------- source/funkin/game/Character.hx | 43 +- source/funkin/game/PlayState.hx | 19 +- source/funkin/game/Stage.hx | 1 + source/funkin/scripting/events/DanceEvent.hx | 9 + .../scripting/events/DirectionAnimEvent.hx | 38 + source/funkin/scripting/events/PointEvent.hx | 17 + source/funkin/system/Paths.hx | 8 +- source/scripting/CharacterScript.hx | 58 + 12 files changed, 5431 insertions(+), 5111 deletions(-) rename assets/charts/{guns => tutorial}/test.hx (100%) create mode 100644 assets/data/characters/bf.hx create mode 100644 source/funkin/scripting/events/DanceEvent.hx create mode 100644 source/funkin/scripting/events/DirectionAnimEvent.hx create mode 100644 source/funkin/scripting/events/PointEvent.hx create mode 100644 source/scripting/CharacterScript.hx diff --git a/assets/charts/guns/test.hx b/assets/charts/tutorial/test.hx similarity index 100% rename from assets/charts/guns/test.hx rename to assets/charts/tutorial/test.hx diff --git a/assets/data/characters/bf.hx b/assets/data/characters/bf.hx new file mode 100644 index 00000000..61a5dd74 --- /dev/null +++ b/assets/data/characters/bf.hx @@ -0,0 +1,23 @@ +trace("Hello, World!"); + +function createPost() { + // globalOffset.y -= 150; +} + +function update(elapsed:Float) { + // y = y + Math.sin(Conductor.songPosition / 1000 * Math.PI) * 125 * elapsed; +} + +function onGetCamPos(deezNuts:Dynamic) { + if (animation.curAnim == null) return; + switch(animation.curAnim.name) { + case "singUP": + deezNuts.y -= 25; + case "singDOWN": + deezNuts.y += 25; + case "singLEFT": + deezNuts.x -= 25; + case "singRIGHT": + deezNuts.x += 25; + } +} \ No newline at end of file diff --git a/buildnumber.txt b/buildnumber.txt index e0da8ae0..059361f2 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -309 \ No newline at end of file +317 \ No newline at end of file diff --git a/docs/doc.xml b/docs/doc.xml index 90953c8f..32c6c3ff 100644 --- a/docs/doc.xml +++ b/docs/doc.xml @@ -1,3571 +1,5 @@ - - - - - - - - - - 0 - - - - - - idEnumerator++ - * A unique ID starting from 0 and increasing by 1 for each subsequent `FlxBasic` that is created. - - - - true - * Controls whether `update()` is automatically called by `FlxState`/`FlxGroup`. - - - - true - * Controls whether `draw()` is automatically called by `FlxState`/`FlxGroup`. - - - - true - * Useful state for many game objects - "dead" (`!alive`) vs `alive`. `kill()` and - * `revive()` both flip this switch (along with `exists`, but you can override that). - - - - true - * Controls whether `update()` and `draw()` are automatically called by `FlxState`/`FlxGroup`. - - - - * Gets or sets the first camera of this object. - - - - * This determines on which `FlxCamera`s this object will be drawn. If it is `null` / has not been - * set, it uses the list of default draw targets, which is controlled via `FlxG.camera.setDefaultDrawTarget` - * as well as the `DefaultDrawTarget` argument of `FlxG.camera.add`. - - - - - NONE - - - * Enum that informs the collision system which type of object this is (to avoid expensive type casting). - - <_cameras> - - - - - - * **WARNING:** A destroyed `FlxBasic` can't be used anymore. - * It may even cause crashes if it is still part of a group or state. - * You may want to use `kill()` instead if you want to disable the object temporarily only and `revive()` it later. - * - * This function is usually not called manually (Flixel calls it automatically during state switches for all `add()`ed objects). - * - * Override this function to `null` out variables manually or call `destroy()` on class members if necessary. - * Don't forget to call `super.destroy()`! - - - - * Handy function for "killing" game objects. Use `reset()` to revive them. - * Default behavior is to flag them as nonexistent AND dead. - * However, if you want the "corpse" to remain in the game, like to animate an effect or whatever, - * you should `override` this, setting only `alive` to `false`, and leaving `exists` `true`. - - - - * Handy function for bringing game objects "back to life". Just sets `alive` and `exists` back to `true`. - * In practice, this function is most often called by `FlxObject#reset()`. - - - - - - - * Override this function to update your class's position and appearance. - * This is where most of your game rules and behavioral code will go. - - - - * Override this function to control how the object is drawn. - * Doing so is rarely necessary, but can be very useful. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * This is a useful "generic" Flixel object. Both `FlxObject` and - * `FlxGroup` extend this class. Has no size, position or graphical data. - - - - - - <_inPool> - - - - - - - - - - - - <_pool expr="new FlxPool<FlxRect>(FlxRect)" line="15" static="1"> - - (FlxRect)]]> - - - - - - - - - - { Height : 0, Width : 0, Y : 0, X : 0 } - * Recycle or create new FlxRect. - * Be sure to put() them back into the pool after you're done with them! - - - - - - - - - - { Height : 0, Width : 0, Y : 0, X : 0 } - * Recycle or create a new FlxRect which will automatically be released - * to the pool when passed into a flixel function. - - - - - - - - - * The x coordinate of the left side of the rectangle. - - - - * The x coordinate of the right side of the rectangle. - - - - * The y coordinate of the top of the rectangle. - - - - * The y coordinate of the bottom of the rectangle. - - - - * Whether width or height of this rectangle is equal to zero or not. - - <_weak expr="false"> - - false - - <_inPool expr="false"> - - false - - - - * Add this FlxRect to the recycling pool. - - - - * Add this FlxPoint to the recycling pool if it's a weak reference (allocated via weak()). - - - - - - - - * Shortcut for setting both width and Height. - * - * @param Width The new sprite width. - * @param Height The new sprite height. - - - - - - - - * Shortcut for setting both x and y. - - - - - - - - - - { Height : 0, Width : 0, Y : 0, X : 0 } - * Fill this rectangle with the data provided. - * - * @param X The X-coordinate of the point in space. - * @param Y The Y-coordinate of the point in space. - * @param Width Desired width of the rectangle. - * @param Height Desired height of the rectangle. - * @return A reference to itself. - - - - - - - * Helper function, just copies the values from the specified rectangle. - * - * @param Rect Any FlxRect. - * @return A reference to itself. - - - - - - - * Helper function, just copies the values from this rectangle to the specified rectangle. - * - * @param Point Any FlxRect. - * @return A reference to the altered rectangle parameter. - - - - - - - * Helper function, just copies the values from the specified Flash rectangle. - * - * @param FlashRect Any Rectangle. - * @return A reference to itself. - - - - - - - * Helper function, just copies the values from this rectangle to the specified Flash rectangle. - * - * @param Point Any Rectangle. - * @return A reference to the altered rectangle parameter. - - - - - - - * Checks to see if some FlxRect object overlaps this FlxRect object. - * - * @param Rect The rectangle being tested. - * @return Whether or not the two rectangles overlap. - - - - - - - * Returns true if this FlxRect contains the FlxPoint - * - * @param Point The FlxPoint to check - * @return True if the FlxPoint is within this FlxRect, otherwise false - - - - - - - * Add another rectangle to this one by filling in the - * horizontal and vertical space between the two rectangles. - * - * @param Rect The second FlxRect to add to this one - * @return The changed FlxRect - - - - * Rounds x, y, width and height using Math.floor() - - - - * Rounds x, y, width and height using Math.ceil() - - - - * Rounds x, y, width and height using Math.round() - - - - - - - - * Calculation of bounding box for two points - * - * @param point1 first point to calculate bounding box - * @param point2 second point to calculate bounding box - * @return this rectangle filled with the position and size of bounding box for two specified points - - - - - - - * Add another point to this rectangle one by filling in the - * horizontal and vertical space between the point and this rectangle. - * - * @param Point point to add to this one - * @return The changed FlxRect - - - - - - - - - - - - - - * Calculates the globally aligned bounding box of a `FlxRect` with the given angle and origin. - * @param degrees The rotation, in degrees of the rect. - * @param origin The relative pivot point, or the point that the rectangle rotates around. - * if `null` , the top-left (or 0,0) is used. - * @param newRect Optional output `FlxRect`, if `null`, a new one is created. Note: If you like, you can - * pass in the input rect to manipulate it. ex: `rect.calcRotatedBounds(angle, null, rect)` - * @return A globally aligned `FlxRect` that fully contains the input rectangle. - * @since 4.11.0 - - - - * Necessary for IFlxDestroyable. - - - - - - - * Checks if this rectangle's properties are equal to properties of provided rect. - * - * @param rect Rectangle to check equality to. - * @return Whether both rectangles are equal. - - - - - - - - * Returns the area of intersection with specified rectangle. - * If the rectangles do not intersect, this method returns an empty rectangle. - * - * @param rect Rectangle to check intersection against. - * @return The area of intersection of two rectangles. - - - - * Convert object to readable string name. Useful for debugging, save games, etc. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { Height : 0, Width : 0, Y : 0, X : 0 } - - - - * Stores a rectangle. - - - - - - - false - * Default value for `FlxObject`'s `pixelPerfectPosition` var. - - - - 4 - * This value dictates the maximum number of pixels two objects have to intersect - * before collision stops trying to separate them. - * Don't modify this unless your objects are passing through each other. - - - - FlxDirectionFlags.LEFT - * Generic value for "left". Used by `facing`, `allowCollisions`, and `touching`. - * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.LEFT` directly. - - - - FlxDirectionFlags.RIGHT - * Generic value for "right". Used by `facing`, `allowCollisions`, and `touching`. - * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.RIGHT` directly. - - - - FlxDirectionFlags.UP - * Generic value for "up". Used by `facing`, `allowCollisions`, and `touching`. - * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.UP` directly. - - - - FlxDirectionFlags.DOWN - * Generic value for "down". Used by `facing`, `allowCollisions`, and `touching`. - * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.DOWN` directly. - - - - FlxDirectionFlags.NONE - * Special-case constant meaning no collisions, used mainly by `allowCollisions` and `touching`. - * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.NONE` directly. - - - - FlxDirectionFlags.CEILING - * Special-case constant meaning up, used mainly by `allowCollisions` and `touching`. - * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.CEILING` directly. - - - - FlxDirectionFlags.FLOOR - * Special-case constant meaning down, used mainly by `allowCollisions` and `touching`. - * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.FLOOR` directly. - - - - FlxDirectionFlags.WALL - * Special-case constant meaning only the left and right sides, used mainly by `allowCollisions` and `touching`. - * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.WALL` directly. - - - - FlxDirectionFlags.ANY - * Special-case constant meaning any direction, used mainly by `allowCollisions` and `touching`. - * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.ANY` directly. - - <_firstSeparateFlxRect expr="FlxRect.get()" line="91" static="1"> - - - FlxRect.get() - - - - <_secondSeparateFlxRect expr="FlxRect.get()" line="93" static="1"> - - - FlxRect.get() - - - - - - - - - - * The main collision resolution function in Flixel. - * - * @param Object1 Any `FlxObject`. - * @param Object2 Any other `FlxObject`. - * @return Whether the objects in fact touched and were separated. - - - - - - - - * Similar to `separate()`, but only checks whether any overlap is found and updates - * the `touching` flags of the input objects, but no separation is performed. - * - * @param Object1 Any `FlxObject`. - * @param Object2 Any other `FlxObject`. - * @return Whether the objects in fact touched. - - - - - - - - - - { checkMaxOverlap : true } - - - * Internal function that computes overlap among two objects on the X axis. It also updates the `touching` variable. - * `checkMaxOverlap` is used to determine whether we want to exclude (therefore check) overlaps which are - * greater than a certain maximum (linked to `SEPARATE_BIAS`). Default is `true`, handy for `separateX` code. - - - - - - - - * The X-axis component of the object separation process. - * - * @param Object1 Any `FlxObject`. - * @param Object2 Any other `FlxObject`. - * @return Whether the objects in fact touched and were separated along the X axis. - - - - - - - - * Checking overlap and updating `touching` variables, X-axis part used by `updateTouchingFlags`. - * - * @param Object1 Any `FlxObject`. - * @param Object2 Any other `FlxObject`. - * @return Whether the objects in fact touched along the X axis. - - - - - - - - - - { checkMaxOverlap : true } - - - * Internal function that computes overlap among two objects on the Y axis. It also updates the `touching` variable. - * `checkMaxOverlap` is used to determine whether we want to exclude (therefore check) overlaps which are - * greater than a certain maximum (linked to `SEPARATE_BIAS`). Default is `true`, handy for `separateY` code. - - - - - - - - * The Y-axis component of the object separation process. - * - * @param Object1 Any `FlxObject`. - * @param Object2 Any other `FlxObject`. - * @return Whether the objects in fact touched and were separated along the Y axis. - - - - - - - - * Checking overlap and updating touching variables, Y-axis part used by `updateTouchingFlags`. - * - * @param Object1 Any `FlxObject`. - * @param Object2 Any other `FlxObject`. - * @return Whether the objects in fact touched along the Y axis. - - - - 0 - * X position of the upper left corner of this object in world space. - - - - 0 - * Y position of the upper left corner of this object in world space. - - - - - * The width of this object's hitbox. For sprites, use `offset` to control the hitbox position. - - - - - * The height of this object's hitbox. For sprites, use `offset` to control the hitbox position. - - - - * Whether or not the coordinates should be rounded during rendering. - * Does not affect `copyPixels()`, which can only render on whole pixels. - * Defaults to the camera's global `pixelPerfectRender` value, - * but overrides that value if not equal to `null`. - - - - true - * Whether or not the position of this object should be rounded before any `draw()` or collision checking. - - - - 0 - * Set the angle (in degrees) of a sprite to rotate it. WARNING: rotating sprites - * decreases their rendering performance by a factor of ~10x when using blitting! - - - - true - * Set this to `false` if you want to skip the automatic motion/movement stuff (see `updateMotion()`). - * `FlxObject` and `FlxSprite` default to `true`. `FlxText`, `FlxTileblock` and `FlxTilemap` default to `false`. - - - - false - * Whether an object will move/alter position after a collision. - - - - * Whether the object collides or not. For more control over what directions the object will collide from, - * use collision constants (like `LEFT`, `FLOOR`, etc) to set the value of `allowCollisions` directly. - - - - * Controls how much this object is affected by camera scrolling. `0` = no movement (e.g. a background layer), - * `1` = same movement speed as the foreground. Default value is `(1,1)`, - * except for UI elements like `FlxButton` where it's `(0,0)`. - - - - * The basic speed of this object (in pixels per second). - - - - * How fast the speed of this object is changing (in pixels per second). - * Useful for smooth movement and gravity. - - - - * This isn't drag exactly, more like deceleration that is only applied - * when `acceleration` is not affecting the sprite. - - - - * If you are using `acceleration`, you can use `maxVelocity` with it - * to cap the speed automatically (very useful!). - - - - * Important variable for collision processing. - * By default this value is set automatically during at the start of `update()`. - - - - 1 - * The virtual mass of the object. Default value is 1. Currently only used with elasticity - * during collision resolution. Change at your own risk; effects seem crazy unpredictable so far! - - - - 0 - * The bounciness of this object. Only affects collisions. Default value is 0, or "not bouncy at all." - - - - 0 - * This is how fast you want this sprite to spin (in degrees per second). - - - - 0 - * How fast the spin speed should change (in degrees per second). - - - - 0 - * Like drag but for spinning. - - - - 10000 - * Use in conjunction with angularAcceleration for fluid spin speed control. - - - - 1 - * Handy for storing health percentage or armor points or whatever. - - - - NONE - * Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating surface contacts. Use bitwise operators to check the values - * stored here, or use isTouching(), justTouched(), etc. You can even use them broadly as boolean values if you're feeling saucy! - - - - NONE - * Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating surface contacts from the previous game loop step. Use bitwise operators to check the values - * stored here, or use isTouching(), justTouched(), etc. You can even use them broadly as boolean values if you're feeling saucy! - - - - ANY - * Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating collision directions. Use bitwise operators to check the values stored here. - * Useful for things like one-way platforms (e.g. allowCollisions = UP;). The accessor "solid" just flips this variable between NONE and ANY. - - - - true - * Whether this sprite is dragged along with the horizontal movement of objects it collides with - * (makes sense for horizontally-moving platforms in platformers for example). - - - - null - * The path this object follows. Not initialized by default. - * Assign a `new FlxPath()` object and `start()` it if you want to this object to follow a path. - * Set `path` to `null` again to stop following the path. - * See `flixel.util.FlxPath` for more info and usage examples. - - <_point expr="FlxPoint.get()"> - - - FlxPoint.get() - - - - <_rect expr="FlxRect.get()"> - - - FlxRect.get() - - - - - - - * Internal function for initialization of some object's variables. - - - - - * Internal function for initialization of some variables that are used in `updateMotion()`. - - - - * **WARNING:** A destroyed `FlxBasic` can't be used anymore. - * It may even cause crashes if it is still part of a group or state. - * You may want to use `kill()` instead if you want to disable the object temporarily only and `revive()` it later. - * - * This function is usually not called manually (Flixel calls it automatically during state switches for all `add()`ed objects). - * - * Override this function to `null` out variables manually or call `destroy()` on class members if necessary. - * Don't forget to call `super.destroy()`! - - - - - - - * Override this function to update your class's position and appearance. - * This is where most of your game rules and behavioral code will go. - - - - - - - - * Internal function for updating the position and speed of this object. - * Useful for cases when you need to update this but are buried down in too many supers. - * Does a slightly fancier-than-normal integration to help with higher fidelity framerate-independent motion. - - - - * Rarely called, and in this case just increments the visible objects count and calls `drawDebug()` if necessary. - - - - - - - - - - { InScreenSpace : false } - flixel.group.FlxTypedGroup - - * Checks to see if some `FlxObject` overlaps this `FlxObject` or `FlxGroup`. - * If the group has a LOT of things in it, it might be faster to use `FlxG.overlap()`. - * WARNING: Currently tilemaps do NOT support screen space overlap checks! - * - * @param ObjectOrGroup The object or group being tested. - * @param InScreenSpace Whether to take scroll factors into account when checking for overlap. - * Default is `false`, or "only compare in world space." - * @param Camera Specify which game camera you want. - * If `null`, it will just grab the first global camera. - * @return Whether or not the two objects overlap. - - - - - - - - - - - - - - - - - - - - - - - { InScreenSpace : false } - flixel.group.FlxTypedGroup - - * Checks to see if this `FlxObject` were located at the given position, - * would it overlap the `FlxObject` or `FlxGroup`? - * This is distinct from `overlapsPoint()`, which just checks that point, - * rather than taking the object's size into account. - * WARNING: Currently tilemaps do NOT support screen space overlap checks! - * - * @param X The X position you want to check. - * Pretends this object (the caller, not the parameter) is located here. - * @param Y The Y position you want to check. - * Pretends this object (the caller, not the parameter) is located here. - * @param ObjectOrGroup The object or group being tested. - * @param InScreenSpace Whether to take scroll factors into account when checking for overlap. - * Default is `false`, or "only compare in world space." - * @param Camera Specify which game camera you want. - * If `null`, it will just grab the first global camera. - * @return Whether or not the two objects overlap. - - - - - - - - - - - - - - - - - - - - { InScreenSpace : false } - * Checks to see if a point in 2D world space overlaps this `FlxObject`. - * - * @param Point The point in world space you want to check. - * @param InScreenSpace Whether to take scroll factors into account when checking for overlap. - * @param Camera Specify which game camera you want. - * If `null`, it will just grab the first global camera. - * @return Whether or not the point overlaps this object. - - - - * Check and see if this object is currently within the world bounds - - * useful for killing objects that get too far away. - * - * @return Whether the object is within the world bounds or not. - - - - - - - - * Call this function to figure out the on-screen position of the object. - * - * @param Point Takes a `FlxPoint` object and assigns the post-scrolled X and Y values of this object to it. - * @param Camera Specify which game camera you want. - * If `null`, it will just grab the first global camera. - * @return The Point you passed in, or a new Point if you didn't pass one, - * containing the screen X and Y position of this object. - - - - - - - - - - - * Retrieve the midpoint of this object in world coordinates. - * - * @param point Allows you to pass in an existing `FlxPoint` object if you're so inclined. - * Otherwise a new one is created. - * @return A `FlxPoint` object containing the midpoint of this object in world coordinates. - - - - - - - - - - - - * Handy function for reviving game objects. - * Resets their existence flags and position. - * - * @param X The new X position of this object. - * @param Y The new Y position of this object. - - - - - - - * Check and see if this object is currently on screen. - * - * @param Camera Specify which game camera you want. - * If `null`, it will just grab the first global camera. - * @return Whether the object is on screen or not. - - - - - - - * Check if object is rendered pixel perfect on a specific camera. - - - - - - - * Handy function for checking if this object is touching a particular surface. - * Be sure to check it before calling `super.update()`, as that will reset the flags. - * - * @param Direction Any of the collision flags (e.g. `LEFT`, `FLOOR`, etc). - * @return Whether the object is touching an object in (any of) the specified direction(s) this frame. - - - - - - - * Handy function for checking if this object is just landed on a particular surface. - * Be sure to check it before calling `super.update()`, as that will reset the flags. - * - * @param Direction Any of the collision flags (e.g. `LEFT`, `FLOOR`, etc). - * @return Whether the object just landed on (any of) the specified surface(s) this frame. - - - - - - - * Reduces the `health` variable of this object by the amount specified in `Damage`. - * Calls `kill()` if health drops to or below zero. - * - * @param Damage How much health to take away (use a negative number to give a health bonus). - - - - - - - { axes : XY } - * Centers this `FlxObject` on the screen, either by the x axis, y axis, or both. - * - * @param axes On what axes to center the object (e.g. `X`, `Y`, `XY`) - default is both. - * @return This FlxObject for chaining - - - - - - - - { Y : 0, X : 0 } - * Helper function to set the coordinates of this object. - * Handy since it only requires one line of code. - * - * @param X The new x position - * @param Y The new y position - - - - - - - - * Shortcut for setting both width and Height. - * - * @param Width The new hitbox width. - * @param Height The new hitbox height. - - - - - - - flixel.FlxCamera - - - - - - - * Calculates the smallest globally aligned bounding box that encompasses this - * object's width and height, at its current rotation. - * Note, if called on a `FlxSprite`, the origin is used, but scale and offset are ignored. - * Use `getScreenBounds` to use these properties. - * @param newRect The optional output `FlxRect` to be returned, if `null`, a new one is created. - * @return A globally aligned `FlxRect` that fully contains the input object's width and height. - * @since 4.11.0 - - - - * Convert object to readable string name. Useful for debugging, save games, etc. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { Height : 0, Width : 0, Y : 0, X : 0 } - * @param X The X-coordinate of the point in space. - * @param Y The Y-coordinate of the point in space. - * @param Width Desired width of the rectangle. - * @param Height Desired height of the rectangle. - - * This is the base class for most of the display objects (`FlxSprite`, `FlxText`, etc). - * It includes some basic attributes about game objects, basic state information, - * sizes, scrolling, and basic physics and motion. - - - - - - - * Class that handles adding and playing animations on this sprite. - - - - * The current display state of the sprite including current animation frame, - * tint, flip etc... may be `null` unless `useFramePixels` is `true`. - - - - true - * Always `true` on `FlxG.renderBlit`. On `FlxG.renderTile` it determines whether - * `framePixels` is used and defaults to `false` for performance reasons. - - - - false - * Controls whether the object is smoothed when rotated, affects performance. - - - - true - * Set this flag to true to force the sprite to update during the `draw()` call. - * NOTE: Rarely if ever necessary, most sprite operations will flip this flag automatically. - - - - * This sprite's graphic / `BitmapData` object. - * Automatically adjusts graphic size and render helpers if changed. - - - - * Link to current `FlxFrame` from loaded atlas - - - - 0 - * The width of the actual graphic or image being displayed (not necessarily the game object/bounding box). - - - - 0 - * The height of the actual graphic or image being displayed (not necessarily the game object/bounding box). - - - - 0 - * The total number of frames in this image. - * WARNING: assumes each row in the sprite sheet is full! - - - - * Rendering variables. - - - - - 0 - * The minimum angle (out of 360°) for which a new baked rotation exists. Example: `90` means there - * are 4 baked rotations in the spritesheet. `0` if this sprite does not have any baked rotations. - - - - 1.0 - * Set alpha to a number between `0` and `1` to change the opacity of the sprite. - - - - RIGHT - * Can be set to `LEFT`, `RIGHT`, `UP`, and `DOWN` to take advantage - * of flipped sprites and/or just track player orientation more easily. - - - - false - * Whether this sprite is flipped on the X axis. - - - - false - * Whether this sprite is flipped on the Y axis. - - - - * WARNING: The `origin` of the sprite will default to its center. If you change this, - * the visuals and the collisions will likely be pretty out-of-sync if you do any rotation. - - - - * Controls the position of the sprite's hitbox. Likely needs to be adjusted after - * changing a sprite's `width`, `height` or `scale`. - - - - * Change the size of your sprite's graphic. - * NOTE: The hitbox is not automatically adjusted, use `updateHitbox()` for that (or `setGraphicSize()`). - * WARNING: With `FlxG.renderBlit`, scaling sprites decreases rendering performance by a factor of about x10! - - - - * Blending modes, just like Photoshop or whatever, e.g. "multiply", "screen", etc. - - - - 0xffffff - * Tints the whole sprite to a color (`0xRRGGBB` format) - similar to OpenGL vertex colors. You can use - * `0xAARRGGBB` colors, but the alpha value will simply be ignored. To change the opacity use `alpha`. - - - - - false - * Whether or not to use a `ColorTransform` set via `setColorTransform()`. - - - - * Clipping rectangle for this sprite. - * Changing the rect's properties directly doesn't have any effect, - * reassign the property to update it (`sprite.clipRect = sprite.clipRect;`). - * Set to `null` to discard graphic frame clipping. - - - - * GLSL shader for this sprite. Only works with OpenFL Next or WebGL. - * Avoid changing it frequently as this is a costly operation. - * @since 4.1.0 - - <_frame> - - - * The actual frame used for sprite rendering - - <_frameGraphic> - - - * Graphic of `_frame`. Used in tile render mode, when `useFramePixels` is `true`. - - <_facingHorizontalMult expr="1"> - - - 1 - - - - <_facingVerticalMult expr="1"> - - - 1 - - - - <_flashPoint> - - - * Internal, reused frequently during drawing and animating. - - <_flashRect> - - - * Internal, reused frequently during drawing and animating. - - <_flashRect2> - - - * Internal, reused frequently during drawing and animating. - - <_flashPointZero> - - - * Internal, reused frequently during drawing and animating. Always contains `(0,0)`. - - <_matrix> - - - * Internal, helps with animation, caching and drawing. - - <_halfSize> - - - * Rendering helper variable - - <_sinAngle expr="0"> - - - 0 - - - * These vars are being used for rendering in some of `FlxSprite` subclasses (`FlxTileblock`, `FlxBar`, - * and `FlxBitmapText`) and for checks if the sprite is in camera's view. - - <_cosAngle expr="1"> - - - 1 - - - - <_angleChanged expr="true"> - - - true - - - - <_facingFlip expr="new Map<FlxDirectionFlags,{ var x : Bool; var y : Bool}>()"> - - - - - - - - - ()]]> - - - * Maps `FlxDirectionFlags` values to axis flips - - - - - - - - * **WARNING:** A destroyed `FlxBasic` can't be used anymore. - * It may even cause crashes if it is still part of a group or state. - * You may want to use `kill()` instead if you want to disable the object temporarily only and `revive()` it later. - * - * This function is usually not called manually (Flixel calls it automatically during state switches for all `add()`ed objects). - * - * Override this function to `null` out variables manually or call `destroy()` on class members if necessary. - * Don't forget to call `super.destroy()`! - - - - - - - - * Load graphic from another `FlxSprite` and copy its tile sheet data. - * This method can useful for non-flash targets. - * - * @param Sprite The `FlxSprite` from which you want to load graphic data. - * @return This `FlxSprite` instance (nice for chaining stuff together, if you're into that). - - - - - - - - - - - - { Unique : false, Height : 0, Width : 0, Animated : false } - * Load an image from an embedded graphic file. - * - * HaxeFlixel's graphic caching system keeps track of loaded image data. - * When you load an identical copy of a previously used image, by default - * HaxeFlixel copies the previous reference onto the `pixels` field instead - * of creating another copy of the image data, to save memory. - * - * @param Graphic The image you want to use. - * @param Animated Whether the `Graphic` parameter is a single sprite or a row / grid of sprites. - * @param Width Specify the width of your sprite - * (helps figure out what to do with non-square sprites or sprite sheets). - * @param Height Specify the height of your sprite - * (helps figure out what to do with non-square sprites or sprite sheets). - * @param Unique Whether the graphic should be a unique instance in the graphics cache. - * Set this to `true` if you want to modify the `pixels` field without changing - * the `pixels` of other sprites with the same `BitmapData`. - * @param Key Set this parameter if you're loading `BitmapData`. - * @return This `FlxSprite` instance (nice for chaining stuff together, if you're into that). - - - - - - - - - - - - { AutoBuffer : false, AntiAliasing : false, Frame : -1, Rotations : 16 } - * Create a pre-rotated sprite sheet from a simple sprite. - * This can make a huge difference in graphical performance on blitting targets! - * - * @param Graphic The image you want to rotate and stamp. - * @param Rotations The number of rotation frames the final sprite should have. - * For small sprites this can be quite a large number (`360` even) without any problems. - * @param Frame If the `Graphic` has a single row of square animation frames on it, - * you can specify which of the frames you want to use here. - * Default is `-1`, or "use whole graphic." - * @param AntiAliasing Whether to use high quality rotations when creating the graphic. Default is `false`. - * @param AutoBuffer Whether to automatically increase the image size to accommodate rotated corners. - * Will create frames that are 150% larger on each axis than the original frame or graphic. - * @param Key Optional, set this parameter if you're loading `BitmapData`. - * @return This `FlxSprite` instance (nice for chaining stuff together, if you're into that). - - - - - - - - - - { AutoBuffer : false, AntiAliasing : false, Rotations : 16 } - * Helper method which allows using `FlxFrame` as graphic source for sprite's `loadRotatedGraphic()` method. - * - * @param frame Frame to load into this sprite. - * @param rotations The number of rotation frames the final sprite should have. - * For small sprites this can be quite a large number (`360` even) without any problems. - * @param antiAliasing Whether to use high quality rotations when creating the graphic. Default is `false`. - * @param autoBuffer Whether to automatically increase the image size to accommodate rotated corners. - * Will create frames that are 150% larger on each axis than the original frame or graphic. - * @return this FlxSprite with loaded rotated graphic in it. - - - - - - - - - - - { Unique : false, Color : FlxColor.WHITE } - * This function creates a flat colored rectangular image dynamically. - * - * HaxeFlixel's graphic caching system keeps track of loaded image data. - * When you make an identical copy of a previously used image, by default - * HaxeFlixel copies the previous reference onto the pixels field instead - * of creating another copy of the image data, to save memory. - * - * @param Width The width of the sprite you want to generate. - * @param Height The height of the sprite you want to generate. - * @param Color Specifies the color of the generated block (ARGB format). - * @param Unique Whether the graphic should be a unique instance in the graphics cache. Default is `false`. - * Set this to `true` if you want to modify the `pixels` field without changing the - * `pixels` of other sprites with the same `BitmapData`. - * @param Key An optional `String` key to identify this graphic in the cache. - * If `null`, the key is determined by `Width`, `Height` and `Color`. - * If `Unique` is `true` and a graphic with this `Key` already exists, - * it is used as a prefix to find a new unique name like `"Key3"`. - * @return This `FlxSprite` instance (nice for chaining stuff together, if you're into that). - - - - * Called whenever a new graphic is loaded for this sprite (after `loadGraphic()`, `makeGraphic()` etc). - - - - * Resets some internal variables used for frame `BitmapData` calculation. - - - - * Resets frame size to frame dimensions. - - - - * Resets sprite's size back to frame size. - - - - * Helper method just for convenience, so you don't need to type - * `sprite.frame = sprite.frame;` - * You may need this method in tile render mode, - * when you want sprite to use its original graphic, not the graphic generated from its `framePixels`. - - - - - - - - { Height : 0, Width : 0 } - - - - - * Updates the sprite's hitbox (`width`, `height`, `offset`) according to the current `scale`. - * Also calls `centerOrigin()`. - - - - - * Resets some important variables for sprite optimization and rendering. - - - - - - - - - - - * This is separated out so it can be easily overridden. - - - - - - - - * Called by game loop, updates then blits or renders current frame of animation to the screen. - - - - - - - - - - - - - - - - - - - - - - - { Y : 0, X : 0 } - * Stamps / draws another `FlxSprite` onto this `FlxSprite`. - * This function is NOT intended to replace `draw()`! - * - * @param Brush The sprite you want to use as a brush or stamp or pen or whatever. - * @param X The X coordinate of the brush's top left corner on this sprite. - * @param Y They Y coordinate of the brush's top left corner on this sprite. - - - - - - - { Force : false } - * Request (or force) that the sprite update the frame before rendering. - * Useful if you are doing procedural generation or other weirdness! - * - * @param Force Force the frame to redraw, even if its not flagged as necessary. - - - - - - - { AdjustPosition : false } - * Helper function that adjusts the offset automatically to center the bounding box within the graphic. - * - * @param AdjustPosition Adjusts the actual X and Y position just once to match the offset change. - - - - * Sets the sprite's origin to its center - useful after adjusting - * `scale` to make sure rotations work as expected. - - - - - - - - - { FetchPositions : false } - * Replaces all pixels with specified `Color` with `NewColor` pixels. - * WARNING: very expensive (especially on big graphics) as it iterates over every single pixel. - * - * @param Color Color to replace - * @param NewColor New color - * @param FetchPositions Whether we need to store positions of pixels which colors were replaced. - * @return `Array` with replaced pixels positions - - - - - - - - - - - - - - { alphaOffset : 0, blueOffset : 0, greenOffset : 0, redOffset : 0, alphaMultiplier : 1.0, blueMultiplier : 1.0, greenMultiplier : 1.0, redMultiplier : 1.0 } - * Sets the sprite's color transformation with control over color offsets. - * With `FlxG.renderTile`, offsets are only supported on OpenFL Next version 3.6.0 or higher. - * - * @param redMultiplier The value for the red multiplier, in the range from `0` to `1`. - * @param greenMultiplier The value for the green multiplier, in the range from `0` to `1`. - * @param blueMultiplier The value for the blue multiplier, in the range from `0` to `1`. - * @param alphaMultiplier The value for the alpha transparency multiplier, in the range from `0` to `1`. - * @param redOffset The offset value for the red color channel, in the range from `-255` to `255`. - * @param greenOffset The offset value for the green color channel, in the range from `-255` to `255`. - * @param blueOffset The offset for the blue color channel value, in the range from `-255` to `255`. - * @param alphaOffset The offset for alpha transparency channel value, in the range from `-255` to `255`. - - - - - - - - - - { Mask : 0xFF } - * Checks to see if a point in 2D world space overlaps this `FlxSprite` object's current displayed pixels. - * This check is ALWAYS made in screen space, and always takes `scrollFactor` into account. - * - * @param Point The point in world space you want to check. - * @param Mask Used in the pixel hit test to determine what counts as solid. - * @param Camera Specify which game camera you want. If `null`, it will just grab the first global camera. - * @return Whether or not the point overlaps this object. - - - - - - - - { RunOnCpp : false } - - - * Internal function to update the current animation frame. - * - * @param RunOnCpp Whether the frame should also be recalculated if we're on a non-flash target - - - - * Retrieves the `BitmapData` of the current `FlxFrame`. Updates `framePixels`. - - - - - - - * Retrieve the midpoint of this sprite's graphic in world coordinates. - * - * @param point Allows you to pass in an existing `FlxPoint` if you're so inclined. - * Otherwise a new one is created. - * @return A `FlxPoint` containing the midpoint of this sprite's graphic in world coordinates. - - - - - - - * Check and see if this object is currently on screen. Differs from `FlxObject`'s implementation - * in that it takes the actual graphic into account, not just the hitbox or bounding box or whatever. - * - * @param Camera Specify which game camera you want. If `null`, it will just grab the first global camera. - * @return Whether the object is on screen or not. - - - - - - - * Returns the result of `isSimpleRenderBlit()` if `FlxG.renderBlit` is - * `true`, or `false` if `FlxG.renderTile` is `true`. - - - - - - - * Determines the function used for rendering in blitting: - * `copyPixels()` for simple sprites, `draw()` for complex ones. - * Sprites are considered simple when they have an `angle` of `0`, a `scale` of `1`, - * don't use `blend` and `pixelPerfectRender` is `true`. - * - * @param camera If a camera is passed its `pixelPerfectRender` flag is taken into account - - - - - - - * Calculates the smallest globally aligned bounding box that encompasses this - * sprite's width and height, at its current rotation. - * Note, if called on a `FlxSprite`, the origin is used, but scale and offset are ignored. - * Use `getScreenBounds` to use these properties. - * @param newRect The optional output `FlxRect` to be returned, if `null`, a new one is created. - * @return A globally aligned `FlxRect` that fully contains the input object's width and height. - * @since 4.11.0 - - - - - - - - * Calculates the smallest globally aligned bounding box that encompasses this sprite's graphic as it - * would be displayed. Honors scrollFactor, rotation, scale, offset and origin. - * @param newRect Optional output `FlxRect`, if `null`, a new one is created. - * @param camera Optional camera used for scrollFactor, if null `FlxG.camera` is used. - * @return A globally aligned `FlxRect` that fully contains the input sprite. - * @since 4.11.0 - - - - - - - - - * Set how a sprite flips when facing in a particular direction. - * - * @param Direction Use constants `LEFT`, `RIGHT`, `UP`, and `DOWN`. - * These may be combined with the bitwise OR operator. - * E.g. To make a sprite flip horizontally when it is facing both `UP` and `LEFT`, - * use `setFacingFlip(LEFT | UP, true, false);` - * @param FlipX Whether to flip the sprite on the X axis. - * @param FlipY Whether to flip the sprite on the Y axis. - - - - - - - - - { saveAnimations : true } - flixel.animation.FlxAnimationController - - * Sets frames and allows you to save animations in sprite's animation controller - * - * @param Frames Frames collection to set for this sprite. - * @param saveAnimations Whether to save animations in animation controller or not. - * @return This sprite with loaded frames - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Internal function for setting graphic property for this object. - * It changes graphics' `useCount` also for better memory tracking. - - - - - - - - - - - - - - - * Frames setter. Used by `loadGraphic` methods, but you can load generated frames yourself - * (this should be even faster since engine doesn't need to do bunch of additional stuff). - * - * @param Frames frames to load into this sprite. - * @return loaded frames. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { Y : 0, X : 0 } - * Creates a `FlxSprite` at a specified position with a specified one-frame graphic. - * If none is provided, a 16x16 image of the HaxeFlixel logo is used. - * - * @param X The initial X position of the sprite. - * @param Y The initial Y position of the sprite. - * @param SimpleGraphic The graphic you want to display - * (OPTIONAL - for simple stuff only, do NOT use for animated images!). - - * The main "game object" class, the sprite is a `FlxObject` - * with a bunch of graphics options and abilities, like animation and stamping. - * - * Load an image onto a sprite using the `loadGraphic*()` functions, - * or create a base monochromatic rectangle using `makeGraphic()`. - * The image `BitmapData` is stored in the `pixels` field. - - - - - - - * The actual group which holds all sprites. - - - - * The link to a group's `members` array. - - - - * The number of entries in the members array. For performance and safety you should check this - * variable instead of `members.length` unless you really know what you're doing! - - - - false - * Whether to attempt to preserve the ratio of alpha values of group members, or set them directly through - * the alpha property. Defaults to `false` (preservation). - * @since 4.5.0 - - - - * The maximum capacity of this group. Default is `0`, meaning no max capacity, and the group can just grow. - - <_skipTransformChildren expr="false"> - - false - * Optimization to allow setting position of group without transforming children twice. - - <_sprites> - - * Array of all the `FlxSprite`s that exist in this group for - * optimization purposes / static typing on cpp targets. - - - - * This method is used for initialization of variables of complex types. - * Don't forget to call `super.initVars()` if you'll override this method, - * or you'll get `null` object error and app will crash. - - - - * **WARNING:** A destroyed `FlxBasic` can't be used anymore. - * It may even cause crashes if it is still part of a group or state. - * You may want to use `kill()` instead if you want to disable the object temporarily only and `revive()` it later. - * - * This function is usually not called manually (Flixel calls it automatically during state switches for all `add()`ed objects). - * - * Override this function to `null` out variables manually or call `destroy()` on class members if necessary. - * Don't forget to call `super.destroy()`! - - - - * Recursive cloning method: it will create a copy of this group which will hold copies of all sprites - * - * @return copy of this sprite group - - - - - - - * Check and see if any sprite in this group is currently on screen. - * - * @param Camera Specify which game camera you want. If `null`, it will just grab the first global camera. - * @return Whether the object is on screen or not. - - - - - - - - - { InScreenSpace : false } - * Checks to see if a point in 2D world space overlaps any `FlxSprite` object from this group. - * - * @param Point The point in world space you want to check. - * @param InScreenSpace Whether to take scroll factors into account when checking for overlap. - * @param Camera Specify which game camera you want. If `null`, it will just grab the first global camera. - * @return Whether or not the point overlaps this group. - - - - - - - - - { Mask : 0xFF } - * Checks to see if a point in 2D world space overlaps any of FlxSprite object's current displayed pixels. - * This check is ALWAYS made in screen space, and always takes scroll factors into account. - * - * @param Point The point in world space you want to check. - * @param Mask Used in the pixel hit test to determine what counts as solid. - * @param Camera Specify which game camera you want. If `null`, it will just grab the first global camera. - * @return Whether or not the point overlaps this object. - - - - - - - - - - - - - - { FetchPositions : false } - * Replaces all pixels with specified `Color` with `NewColor` pixels. - * WARNING: very expensive (especially on big graphics) as it iterates over every single pixel. - * - * @param Color Color to replace - * @param NewColor New color - * @param FetchPositions Whether we need to store positions of pixels which colors were replaced. - * @return `Array` with replaced pixels positions - - - - - - - * Adds a new `FlxSprite` subclass to the group. - * - * @param Sprite The sprite or sprite group you want to add to the group. - * @return The same object that was passed in. - - - - - - - - * Inserts a new `FlxSprite` subclass to the group at the specified position. - * - * @param Position The position that the new sprite or sprite group should be inserted at. - * @param Sprite The sprite or sprite group you want to insert into the group. - * @return The same object that was passed in. - * - * @since 4.3.0 - - - - - - - * Adjusts the position and other properties of the soon-to-be child of this sprite group. - * Private helper to avoid duplicate code in `add()` and `insert()`. - * - * @param Sprite The sprite or sprite group that is about to be added or inserted into the group. - - - - - - - - - - { Revive : true, Force : false } - 0` / "rotating-recycling" (used by `FlxEmitter`): - * - at capacity: returns the next object in line, no matter its properties like `alive`, `exists` etc. - * - otherwise: returns a new object. - * - * `maxSize == 0` / "grow-style-recycling" - * - tries to find the first object with `exists == false` - * - otherwise: adds a new object to the `members` array - * - * WARNING: If this function needs to create a new object, and no object class was provided, - * it will return `null` instead of a valid object! - * - * @param ObjectClass The class type you want to recycle (e.g. `FlxSprite`, `EvilRobot`, etc). - * @param ObjectFactory Optional factory function to create a new object - * if there aren't any dead members to recycle. - * If `null`, `Type.createInstance()` is used, - * which requires the class to have no constructor parameters. - * @param Force Force the object to be an `ObjectClass` and not a super class of `ObjectClass`. - * @param Revive Whether recycled members should automatically be revived - * (by calling `revive()` on them). - * @return A reference to the object that was created.]]> - - - - - - - - { Splice : false } - * Removes the specified sprite from the group. - * - * @param Sprite The `FlxSprite` you want to remove. - * @param Splice Whether the object should be cut from the array entirely or not. - * @return The removed sprite. - - - - - - - - * Replaces an existing `FlxSprite` with a new one. - * - * @param OldObject The sprite you want to replace. - * @param NewObject The new object you want to use instead. - * @return The new sprite. - - - - - - - - - - - - - { Order : FlxSort.ASCENDING } - * Call this function to sort the group according to a particular value and order. - * For example, to sort game objects for Zelda-style overlaps you might call - * `group.sort(FlxSort.byY, FlxSort.ASCENDING)` at the bottom of your `FlxState#update()` override. - * - * @param Function The sorting function to use - you can use one of the premade ones in - * `FlxSort` or write your own using `FlxSort.byValues()` as a "backend". - * @param Order A constant that defines the sort order. - * Possible values are `FlxSort.ASCENDING` (default) and `FlxSort.DESCENDING`. - - - - - - - - { Force : false } - * Call this function to retrieve the first object with `exists == false` in the group. - * This is handy for recycling in general, e.g. respawning enemies. - * - * @param ObjectClass An optional parameter that lets you narrow the - * results to instances of this particular class. - * @param Force Force the object to be an `ObjectClass` and not a super class of `ObjectClass`. - * @return A `FlxSprite` currently flagged as not existing. - - - - * Call this function to retrieve the first index set to `null`. - * Returns `-1` if no index stores a `null` object. - * - * @return An `Int` indicating the first `null` slot in the group. - - - - * Call this function to retrieve the first object with `exists == true` in the group. - * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. - * - * @return A `FlxSprite` currently flagged as existing. - - - - * Call this function to retrieve the first object with `dead == false` in the group. - * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. - * - * @return A `FlxSprite` currently flagged as not dead. - - - - * Call this function to retrieve the first object with `dead == true` in the group. - * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. - * - * @return A `FlxSprite` currently flagged as dead. - - - - * Call this function to find out how many members of the group are not dead. - * - * @return The number of `FlxSprite`s flagged as not dead. Returns `-1` if group is empty. - - - - * Call this function to find out how many members of the group are dead. - * - * @return The number of `FlxSprite`s flagged as dead. Returns `-1` if group is empty. - - - - - - - - { Length : 0, StartIndex : 0 } - * Returns a member at random from the group. - * - * @param StartIndex Optional offset off the front of the array. - * Default value is `0`, or the beginning of the array. - * @param Length Optional restriction on the number of values you want to randomly select from. - * @return A `FlxSprite` from the `members` list. - - - - - - - - - - * Iterate through every member - * - * @return An iterator - - - - - - - - - - - { Recurse : false } - * Applies a function to all members. - * - * @param Function A function that modifies one element at a time. - * @param Recurse Whether or not to apply the function to members of subgroups as well. - - - - - - - - - - - { Recurse : false } - * Applies a function to all `alive` members. - * - * @param Function A function that modifies one element at a time. - * @param Recurse Whether or not to apply the function to members of subgroups as well. - - - - - - - - - - - { Recurse : false } - * Applies a function to all dead members. - * - * @param Function A function that modifies one element at a time. - * @param Recurse Whether or not to apply the function to members of subgroups as well. - - - - - - - - - - - { Recurse : false } - * Applies a function to all existing members. - * - * @param Function A function that modifies one element at a time. - * @param Recurse Whether or not to apply the function to members of subgroups as well. - - - - - - - - - - - - { Recurse : false } - `. - * - * @param ObjectClass A class that objects will be checked against before Function is applied, ex: `FlxSprite`. - * @param Function A function that modifies one element at a time. - * @param Recurse Whether or not to apply the function to members of subgroups as well.]]> - - - - * Remove all instances of `FlxSprite` from the list. - * WARNING: does not `destroy()` or `kill()` any of these objects! - - - - * Calls `kill()` on the group's members and then on the group itself. - * You can revive this group later via `revive()` after this. - - - - * Revives the group. - - - - - - - - - - - - - { Y : 0, X : 0 } - * Helper function to set the coordinates of this object. - * Handy since it only requires one line of code. - * - * @param X The new x position - * @param Y The new y position - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * This functionality isn't supported in SpriteGroup - - - - - - - - * This functionality isn't supported in SpriteGroup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * This functionality isn't supported in SpriteGroup - * @return this sprite group - - - - - - - - - - - - { Unique : false, Height : 0, Width : 0, Animated : false } - * This functionality isn't supported in SpriteGroup - * @return this sprite group - - - - - - - - - - - - { AutoBuffer : false, AntiAliasing : false, Frame : -1, Rotations : 16 } - * This functionality isn't supported in SpriteGroup - * @return this sprite group - - - - - - - - - - - { Unique : false, Color : FlxColor.WHITE } - * This functionality isn't supported in SpriteGroup - * @return this sprite group - - - - - - - - - - - - - - - - { RunOnCpp : false } - * Internal function to update the current animation frame. - * - * @param RunOnCpp Whether the frame should also be recalculated if we're on a non-flash target - - - - * This functionality isn't supported in SpriteGroup - - - - - - - - - { Y : 0, X : 0 } - * This functionality isn't supported in SpriteGroup - - - - - - - - * This functionality isn't supported in SpriteGroup - - - - - - - - - { MaxSize : 0, Y : 0, X : 0 } - * @param X The initial X position of the group. - * @param Y The initial Y position of the group. - * @param MaxSize Maximum amount of members allowed. - - * `FlxSpriteGroup` is a special `FlxSprite` that can be treated like - * a single sprite even if it's made up of several member sprites. - * It shares the `FlxTypedGroup` API, but it doesn't inherit from it. - - - - - - - 0.05 - - - - false - - - - 0 - - - - false - - - - "" - - <_finalText expr=""""> - - "" - - <_curText expr=""""> - - "" - - - - FlxG.width - - - - 1 - - - - - false - - - - false - - - - [] - - - - false - - - - - - "gf" - - - - - - - - - - - - - - - - { typed : false, bold : false, text : "" } - - * Loosley based on FlxTypeText lolol - - - - - - - "abcdefghijklmnopqrstuvwxyz" - - - - "1234567890" - - - - @[]^_.,'!?"]]> - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Helper for overlap functions in `FlxObject` and `FlxTilemap`. - - - - - - - - - - - * `Array` of all the members in this group. - - - - * The maximum capacity of this group. Default is `0`, meaning no max capacity, and the group can just grow. - - - - 0 - * The number of entries in the members array. For performance and safety you should check this - * variable instead of `members.length` unless you really know what you're doing! - - - - - - - * A `FlxSignal` that dispatches when a child is added to this group. - * @since 4.4.0 - - - - - - - * A `FlxSignal` that dispatches when a child is removed from this group. - * @since 4.4.0 - - <_memberAdded> - - - - - - * Internal variables for lazily creating `memberAdded` and `memberRemoved` signals when needed. - - <_memberRemoved> - - - - - - - <_marker expr="0"> - - - 0 - - - * Internal helper variable for recycling objects a la `FlxEmitter`. - - - - * **WARNING:** A destroyed `FlxBasic` can't be used anymore. - * It may even cause crashes if it is still part of a group or state. - * You may want to use `kill()` instead if you want to disable the object temporarily only and `revive()` it later. - * - * This function is usually not called manually (Flixel calls it automatically during state switches for all `add()`ed objects). - * - * Override this function to `null` out variables manually or call `destroy()` on class members if necessary. - * Don't forget to call `super.destroy()`! - - - - - - - * Automatically goes through and calls update on everything you added. - - - - * Automatically goes through and calls render on everything you added. - - - - - - - * Adds a new `FlxBasic` subclass (`FlxBasic`, `FlxSprite`, `Enemy`, etc) to the group. - * `FlxGroup` will try to replace a `null` member of the array first. - * Failing that, `FlxGroup` will add it to the end of the member array. - * WARNING: If the group has a `maxSize` that has already been met, - * the object will NOT be added to the group! - * - * @param Object The object you want to add to the group. - * @return The same `FlxBasic` object that was passed in. - - - - - - - - * Inserts a new `FlxBasic` subclass (`FlxBasic`, `FlxSprite`, `Enemy`, etc) - * into the group at the specified position. - * `FlxGroup` will try to replace a `null` member at the specified position of the array first. - * Failing that, `FlxGroup` will insert it at the position of the member array. - * WARNING: If the group has a `maxSize` that has already been met, - * the object will NOT be inserted to the group! - * - * @param Position The position in the group where you want to insert the object. - * @param Object The object you want to insert into the group. - * @return The same `FlxBasic` object that was passed in. - - - - - - - - - - { Revive : true, Force : false } - 0` / "rotating-recycling" (used by `FlxEmitter`): - * - at capacity: returns the next object in line, no matter its properties like `alive`, `exists` etc. - * - otherwise: returns a new object. - * - * `maxSize == 0` / "grow-style-recycling" - * - tries to find the first object with `exists == false` - * - otherwise: adds a new object to the `members` array - * - * WARNING: If this function needs to create a new object, and no object class was provided, - * it will return `null` instead of a valid object! - * - * @param ObjectClass The class type you want to recycle (e.g. `FlxSprite`, `EvilRobot`, etc). - * @param ObjectFactory Optional factory function to create a new object - * if there aren't any dead members to recycle. - * If `null`, `Type.createInstance()` is used, - * which requires the class to have no constructor parameters. - * @param Force Force the object to be an `ObjectClass` and not a super class of `ObjectClass`. - * @param Revive Whether recycled members should automatically be revived - * (by calling `revive()` on them). - * @return A reference to the object that was created.]]> - - - - - - - - - - - - - - - - { Splice : false } - * Removes an object from the group. - * - * @param Object The `FlxBasic` you want to remove. - * @param Splice Whether the object should be cut from the array entirely or not. - * @return The removed object. - - - - - - - - * Replaces an existing `FlxBasic` with a new one. - * Does not do anything and returns `null` if the old object is not part of the group. - * - * @param OldObject The object you want to replace. - * @param NewObject The new object you want to use instead. - * @return The new object. - - - - - - - - - - - - - { Order : FlxSort.ASCENDING } - * Call this function to sort the group according to a particular value and order. - * For example, to sort game objects for Zelda-style overlaps you might call - * `group.sort(FlxSort.byY, FlxSort.ASCENDING)` at the bottom of your `FlxState#update()` override. - * - * @param Function The sorting function to use - you can use one of the premade ones in - * `FlxSort` or write your own using `FlxSort.byValues()` as a "backend". - * @param Order A constant that defines the sort order. - * Possible values are `FlxSort.ASCENDING` (default) and `FlxSort.DESCENDING`. - - - - - - - - { Force : false } - * Call this function to retrieve the first object with `exists == false` in the group. - * This is handy for recycling in general, e.g. respawning enemies. - * - * @param ObjectClass An optional parameter that lets you narrow the - * results to instances of this particular class. - * @param Force Force the object to be an `ObjectClass` and not a super class of `ObjectClass`. - * @return A `FlxBasic` currently flagged as not existing. - - - - * Call this function to retrieve the first index set to `null`. - * Returns `-1` if no index stores a `null` object. - * - * @return An `Int` indicating the first `null` slot in the group. - - - - * Call this function to retrieve the first object with `exists == true` in the group. - * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. - * - * @return A `FlxBasic` currently flagged as existing. - - - - * Call this function to retrieve the first object with `dead == false` in the group. - * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. - * - * @return A `FlxBasic` currently flagged as not dead. - - - - * Call this function to retrieve the first object with `dead == true` in the group. - * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. - * - * @return A `FlxBasic` currently flagged as dead. - - - - * Call this function to find out how many members of the group are not dead. - * - * @return The number of `FlxBasic`s flagged as not dead. Returns `-1` if group is empty. - - - - * Call this function to find out how many members of the group are dead. - * - * @return The number of `FlxBasic`s flagged as dead. Returns `-1` if group is empty. - - - - - - - - { Length : 0, StartIndex : 0 } - * Returns a member at random from the group. - * - * @param StartIndex Optional offset off the front of the array. - * Default value is `0`, or the beginning of the array. - * @param Length Optional restriction on the number of values you want to randomly select from. - * @return A `FlxBasic` from the `members` list. - - - - * Remove all instances of `FlxBasic` subclasses (`FlxSprite`, `FlxTileblock`, etc) from the list. - * WARNING: does not `destroy()` or `kill()` any of these objects! - - - - * Calls `kill()` on the group's `members` and then on the group itself. - * You can revive this group later via `revive()` after this. - - - - * Calls `revive()` on the group's members and then on the group itself. - - - - - - - - - - * Iterates through every member. - - - - - - - - - - - { Recurse : false } - * Applies a function to all members. - * - * @param Function A function that modifies one element at a time. - * @param Recurse Whether or not to apply the function to members of subgroups as well. - - - - - - - - - - - { Recurse : false } - * Applies a function to all `alive` members. - * - * @param Function A function that modifies one element at a time. - * @param Recurse Whether or not to apply the function to members of subgroups as well. - - - - - - - - - - - { Recurse : false } - * Applies a function to all dead members. - * - * @param Function A function that modifies one element at a time. - * @param Recurse Whether or not to apply the function to members of subgroups as well. - - - - - - - - - - - { Recurse : false } - * Applies a function to all existing members. - * - * @param Function A function that modifies one element at a time. - * @param Recurse Whether or not to apply the function to members of subgroups as well. - - - - - - - - - - - - { Recurse : false } - `. - * - * @param ObjectClass A class that objects will be checked against before Function is applied, ex: `FlxSprite`. - * @param Function A function that modifies one element at a time. - * @param Recurse Whether or not to apply the function to members of subgroups as well.]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - { MaxSize : 0 } - * @param MaxSize Maximum amount of members allowed. - - * This is an organizational class that can update and render a bunch of `FlxBasic`s. - * NOTE: Although `FlxGroup` extends `FlxBasic`, it will not automatically - * add itself to the global collisions quad tree, it will only add its members. - - - - - - - false - * Whenever the state already has been created. When create is called, this is set to true to prevent the state from being created twice when switching back to it. - - - - false - - - - false - * Determines whether or not this state is updated even when it is not the active state. - * For example, if you have your game state first, and then you push a menu state on top of it, - * if this is set to `true`, the game state would continue to update in the background. - * By default this is `false`, so background states will be "paused" when they are not active. - - - - true - * Determines whether or not this state is updated even when it is not the active state. - * For example, if you have your game state first, and then you push a menu state on top of it, - * if this is set to `true`, the game state would continue to be drawn behind the pause state. - * By default this is `true`, so background states will continue to be drawn behind the current state. - * - * If background states are not `visible` when you have a different state on top, - * you should set this to `false` for improved performance. - - - - true - * If substates get destroyed when they are closed, setting this to - * `false` might reduce state creation time, at greater memory cost. - - - - * The natural background color the cameras default to. In `AARRGGBB` format. - - - - * Current substate. Substates also can be nested. - - <_requestedSubState> - - - * If a state change was requested, the new state object is stored here until we switch to it. - - <_requestSubStateReset expr="false"> - - - false - - - * Whether to reset the substate (when it changes, or when it's closed). - - - - - - - * A `FlxSignal` that dispatches when a sub state is opened from this state. - * @since 4.9.0 - - - - - - - * A `FlxSignal` that dispatches when a sub state is closed from this state. - * @since 4.9.0 - - <_subStateOpened> - - - - - - * Internal variables for lazily creating `subStateOpened` and `subStateClosed` signals when needed. - - <_subStateClosed> - - - - - - - - - * This function is called after the game engine successfully switches states. - * Override this function, NOT the constructor, to initialize or set up your game state. - * We do NOT recommend initializing any flixel objects or utilizing flixel features in - * the constructor, unless you want some crazy unpredictable things to happen! - - - - - - - - - - * Closes the substate of this state, if one exists. - - - - * Load substate for this state - - - - - - - - * Called from `FlxG.switchState()`. If `false` is returned, the state - * switch is cancelled - the default implementation returns `true`. - * - * Useful for customizing state switches, e.g. for transition effects. - - - - * This method is called after the game loses focus. - * Can be useful for third party libraries, such as tweening engines. - - - - * This method is called after the game receives focus. - * Can be useful for third party libraries, such as tweening engines. - - - - - - - - * This function is called whenever the window size has been changed. - * - * @param Width The new window width - * @param Height The new window Height - - - - - - - flixel.FlxGame - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * This is the basic game "state" object - e.g. in a simple game you might have a menu state and a play state. - * It is for all intents and purpose a fancy `FlxGroup`. And really, it's not even that fancy. - - - - - - - - - - - - - - - [] - - - - 0 - - - - true - - - - "spooky" - - - - - - - - - { pushList : true } - - - - - - - - - - - - { daAnim : "spooky" } - - *DEBUG MODE - - @@ -15902,7 +12336,7 @@ -
+
@@ -15955,22 +12389,22 @@ - + - + - + - + @@ -16319,544 +12753,6 @@ - - - - - null - - - - null - - - - false - - - - false - - - - - - - - - - - - - - - - - - - * Starts the in-transition. Can be called manually at any time. - - - - - - - * Starts the out-transition. Can be called manually at any time. - - - - false - - <_exiting expr="false"> - - false - - <_onExit> - - - - - - - - - - - - - - - * Create a state with the ability to do visual transitions - * @param TransIn Plays when the state begins - * @param TransOut Plays when the state ends - - * A `FlxState` which can perform visual transitions - * - * Usage: - * - * First, extend `FlxTransitionableState` as ie, `FooState`. - * - * Method 1: - * - * ```haxe - * var in:TransitionData = new TransitionData(...); // add your data where "..." is - * var out:TransitionData = new TransitionData(...); - * - * FlxG.switchState(new FooState(in,out)); - * ``` - * - * Method 2: - * - * ```haxe - * FlxTransitionableState.defaultTransIn = new TransitionData(...); - * FlxTransitionableState.defaultTransOut = new TransitionData(...); - * - * FlxG.switchState(new FooState()); - * ``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_tongue> - - - - - - - - - null - - - - - null - - - - false - - <_cursorHidden expr="false"> - - false - - - - * frontend for adding tooltips to things - - <_xml_id expr=""""> - - "" - - <_makeCursor> - <_ui_vars> - - - - <_ui> - <_tongue> - - - false - - <_reload expr="false"> - - false - - <_reload_countdown expr="0"> - - 0 - - - - - - - - - null - - - - - - - - - flixel.addons.ui.FlxUI - - <_cleanupUIVars set="method" line="238"> - - - - - - - - - - - - { height : 600, width : 800 } - - - - - - - - - - - - - - - - - @since 2.1.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { Safe : true, Context : "ui" } - - - - * Creates a cursor. Makes it easy to override this function in your own FlxUIState. - * @return - - - - - - - - - - - { liveFilePath_ : "", tongue_ : null, superIndex_ : null, ptr : null, data : null } - - - - - - - - - - - - - - - * This is a simple extension of FlxState that does two things: - * 1) It implements the IFlxUIState interface - * 2) Automatically creates a FlxUI objects from a single string id - * - * Usage: - * Create a class that extends FlxUIState, override create, and - * before you call super.create(), set _xml_id to the string id - * of the corresponding UI xml file (leave off the extension). - * - * @author Lars Doucet - - - - - - - 0 - - - - 0 - - - - 0 - * Current step - - - - 0 - * Current beat - - - - 0 - * Current step, as a `Float` (ex: 4.94, instead of 4) - - - - 0 - * Current beat, as a `Float` (ex: 1.24, instead of 1) - - - - * Game Controls. - - - - - - - - - - - - hide - - - - hide - - - - - - - - - - { fpsSensitive : false } - * Shortcut to `FlxMath.lerp` or `CoolUtil.lerp`, depending on `fpsSensitive` - * @param v1 Value 1 - * @param v2 Value 2 - * @param ratio Ratio - * @param fpsSensitive Whenever the ratio should not be adjusted to run at the same speed independant of framerate. - - - - - - - - - - - - 0 - - <_file> - - - - 0 - * Array of notes showing when each section STARTS in STEPS - * Usually rounded up?? - - - - - - "Dadbattle" - - - - 0 - - - - - - 40 - - - - - - <_song> - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - - - - - - - - - - - - - - - - { songBeginning : false } - - - - - - - - { updateMusic : true, sec : 0 } - - - - - - - { sectionNum : 1 } - - - - - - - - - - - { lengthInSteps : 16 } - - - - - - - - - - - - - - - - - - - - - - - 0.3 - - - - - - - - - - - - - - - - - - - - * Called when the save file dialog is cancelled. - - - - - - - * Called if there is an error while saving the gameplay recording. - - - - - - - - An abstract type that represents a Class. @@ -16870,717 +12766,6 @@ - - - - - - - - - - cast "up" - - - - - - - - cast "left" - - - - - - - - cast "right" - - - - - - - - cast "down" - - - - - - - - cast "up-press" - - - - - - - - cast "left-press" - - - - - - - - cast "right-press" - - - - - - - - cast "down-press" - - - - - - - - cast "up-release" - - - - - - - - cast "left-release" - - - - - - - - cast "right-release" - - - - - - - - cast "down-release" - - - - - - - - cast "accept" - - - - - - - - cast "back" - - - - - - - - cast "pause" - - - - - - - - cast "reset" - - - - - - - - cast "cheat" - - - - - - - - - - - - cast "up" - - - - - - - - cast "left" - - - - - - - - cast "right" - - - - - - - - cast "down" - - - - - - - - cast "up-press" - - - - - - - - cast "left-press" - - - - - - - - cast "right-press" - - - - - - - - cast "down-press" - - - - - - - - cast "up-release" - - - - - - - - cast "left-release" - - - - - - - - cast "right-release" - - - - - - - - cast "down-release" - - - - - - - - cast "accept" - - - - - - - - cast "back" - - - - - - - - cast "pause" - - - - - - - - cast "reset" - - - - - - - - cast "cheat" - - - - - - - - - - - - - - - - - - - - - * Since, in many cases multiple actions should use similar keys, we don't want the - * rebinding UI to list every action. ActionBinders are what the user percieves as - * an input so, for instance, they can't set jump-press and jump-release to different keys. - - - - - - - - - - - - - - - - - - - - - - - - - - - - flixel.input.actions.FlxActionManager - * Create an action set from a parsed Json object - * - * @param Data A parsed Json object - * @param CallbackDigital A function to call when digital actions fire - * @param CallbackAnalog A function to call when analog actions fire - * @return An action set - - - - "" - * Name of the action set - - - - * Digital actions in this set - - - - * Analog actions in this set - - - - true - * Whether this action set runs when update() is called - - - - - - - - - { Attach : true } - * Automatically adds or removes inputs for a steam controller - * to any steam-affiliated actions - * @param Handle steam controller handle from FlxSteam.getConnectedControllers(), or FlxInputDeviceID.FIRST_ACTIVE / ALL - * @param Attach true: adds inputs, false: removes inputs - - - - - - - - - - - - - { Destroy : true } - * Remove an action from this set - * @param Action a FlxAction - * @param Destroy whether to destroy it as well - * @return whether it was found and removed - - - - - - - - - - - - - - - - - - - - * @since 4.6.0 - - - flixel.input.actions.FlxActionManager - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_up expr="new FlxActionDigital(Action.UP)"> - - new FlxActionDigital(Action.UP) - - <_left expr="new FlxActionDigital(Action.LEFT)"> - - new FlxActionDigital(Action.LEFT) - - <_right expr="new FlxActionDigital(Action.RIGHT)"> - - new FlxActionDigital(Action.RIGHT) - - <_down expr="new FlxActionDigital(Action.DOWN)"> - - new FlxActionDigital(Action.DOWN) - - <_upP expr="new FlxActionDigital(Action.UP_P)"> - - new FlxActionDigital(Action.UP_P) - - <_leftP expr="new FlxActionDigital(Action.LEFT_P)"> - - new FlxActionDigital(Action.LEFT_P) - - <_rightP expr="new FlxActionDigital(Action.RIGHT_P)"> - - new FlxActionDigital(Action.RIGHT_P) - - <_downP expr="new FlxActionDigital(Action.DOWN_P)"> - - new FlxActionDigital(Action.DOWN_P) - - <_upR expr="new FlxActionDigital(Action.UP_R)"> - - new FlxActionDigital(Action.UP_R) - - <_leftR expr="new FlxActionDigital(Action.LEFT_R)"> - - new FlxActionDigital(Action.LEFT_R) - - <_rightR expr="new FlxActionDigital(Action.RIGHT_R)"> - - new FlxActionDigital(Action.RIGHT_R) - - <_downR expr="new FlxActionDigital(Action.DOWN_R)"> - - new FlxActionDigital(Action.DOWN_R) - - <_accept expr="new FlxActionDigital(Action.ACCEPT)"> - - new FlxActionDigital(Action.ACCEPT) - - <_back expr="new FlxActionDigital(Action.BACK)"> - - new FlxActionDigital(Action.BACK) - - <_pause expr="new FlxActionDigital(Action.PAUSE)"> - - new FlxActionDigital(Action.PAUSE) - - <_reset expr="new FlxActionDigital(Action.RESET)"> - - new FlxActionDigital(Action.RESET) - - <_cheat expr="new FlxActionDigital(Action.CHEAT)"> - - new FlxActionDigital(Action.CHEAT) - - - - - - - [] - - - - [] - - - - KeyboardScheme.None - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Void)]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * Sets all actions that pertain to the binder to trigger when the supplied keys are used. - * If binder is a literal you can inline this - - - - - - - - * Sets all actions that pertain to the binder to trigger when the supplied keys are used. - * If binder is a literal you can inline this - - - - - - - - { reset : true } - - - - - - - - - - - - - - - - - - - - - - - - { deviceID : FlxInputDeviceID.ALL } - - - - - - - - - - - - - * Sets all actions that pertain to the binder to trigger when the supplied keys are used. - * If binder is a literal you can inline this - - - - - - - - - * Sets all actions that pertain to the binder to trigger when the supplied keys are used. - * If binder is a literal you can inline this - - - - - - - - - - - - - - - - - - { scheme : None } - - * A list of actions that a player would invoke via some input device. - * Uses FlxActions to funnel various inputs to a single action. - - @@ -17675,31 +12860,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - @@ -17883,95 +13043,6 @@ - - - - - * Used for FreeplayState! If you use it elsewhere, prob gonna annoying - - - - - - - 1, 20 => 0]]]> - Frame Index]]> - - - - - - - * Helper for HScript who can't make maps - * @param steps Something like this: `[[0, 1], [20, 0]]` - - - - - - - - - - - - { isPlayer : false, char : "bf" } - - - - - - - - - - new Map() - - - - - - - - - { diff : 0, score : 0 } - - - - - - - - - { diff : 0, score : 0, week : 1 } - - - - - - - - * YOU SHOULD FORMAT SONG WITH formatSong() BEFORE TOSSING IN SONG VARIABLE - - - - - - - - - - - - - - - - - - - @@ -18282,7 +13353,7 @@ - + "__ASSET__:file___ASSET__assets_fonts_fonts_go_here_txt1" @@ -18431,7 +13502,7 @@ - + "LIME_font___ASSET__assets_fonts_pixel_otf1" @@ -18447,7 +13518,7 @@ - + "LIME_font___ASSET__assets_fonts_vcr_ttf1" @@ -18463,7 +13534,7 @@ - + "__ASSET__:file___ASSET__flixel_sounds_beep_ogg" @@ -18482,7 +13553,7 @@ - + "__ASSET__:file___ASSET__flixel_sounds_flixel_ogg" @@ -18501,7 +13572,7 @@ - + "__ASSET__:file___ASSET__flixel_sounds_type_ogg" @@ -18520,7 +13591,7 @@ - + "LIME_font___ASSET__flixel_fonts_nokiafc22_ttf" @@ -18536,7 +13607,7 @@ - + "LIME_font___ASSET__flixel_fonts_monsterrat_ttf" @@ -19205,7 +14276,7 @@ - + "__ASSET__:image___ASSET__flixel_images_ui_button_png" @@ -19229,7 +14300,7 @@ - + "__ASSET__:image___ASSET__flixel_images_logo_default_png" @@ -19253,7 +14324,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_box_png" @@ -19277,7 +14348,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_button_png" @@ -19301,7 +14372,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_button_arrow_down_png" @@ -19325,7 +14396,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_button_arrow_left_png" @@ -19349,7 +14420,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_button_arrow_right_png" @@ -19373,7 +14444,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_button_arrow_up_png" @@ -19397,7 +14468,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_button_thin_png" @@ -19421,7 +14492,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_button_toggle_png" @@ -19445,7 +14516,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_check_box_png" @@ -19469,7 +14540,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_check_mark_png" @@ -19493,7 +14564,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_chrome_png" @@ -19517,7 +14588,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_chrome_flat_png" @@ -19541,7 +14612,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_chrome_inset_png" @@ -19565,7 +14636,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_chrome_light_png" @@ -19589,7 +14660,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_dropdown_mark_png" @@ -19613,7 +14684,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_finger_big_png" @@ -19637,7 +14708,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_finger_small_png" @@ -19661,7 +14732,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_hilight_png" @@ -19685,7 +14756,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_invis_png" @@ -19709,7 +14780,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_minus_mark_png" @@ -19733,7 +14804,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_plus_mark_png" @@ -19757,7 +14828,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_radio_png" @@ -19781,7 +14852,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_radio_dot_png" @@ -19805,7 +14876,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_swatch_png" @@ -19829,7 +14900,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_tab_png" @@ -19853,7 +14924,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_tab_back_png" @@ -19877,7 +14948,7 @@ - + "__ASSET__:image___ASSET__flixel_flixel_ui_img_tooltip_arrow_png" @@ -19901,7 +14972,7 @@ - + "__ASSET__:file___ASSET__flixel_flixel_ui_xml_defaults_xml" @@ -19920,7 +14991,7 @@ - + "__ASSET__:file___ASSET__flixel_flixel_ui_xml_default_loading_screen_xml" @@ -19939,7 +15010,7 @@ - + "__ASSET__:file___ASSET__flixel_flixel_ui_xml_default_popup_xml" @@ -19958,7 +15029,7 @@ - + "__ASSET__:file___ASSET__manifest_assets_json" @@ -19977,7 +15048,7 @@ - + lime._internal.macros.AssetsMacro.embedFont() lime._internal.macros.AssetsMacro.embedFont() @@ -19987,7 +15058,7 @@ - + lime._internal.macros.AssetsMacro.embedFont() lime._internal.macros.AssetsMacro.embedFont() @@ -20166,7 +15237,7 @@ - + lime._internal.macros.AssetsMacro.embedFont() @@ -20178,7 +15249,7 @@ - + lime._internal.macros.AssetsMacro.embedFont() @@ -20190,7 +15261,7 @@ - + lime._internal.macros.AssetsMacro.embedFont() @@ -20202,7 +15273,7 @@ - + lime._internal.macros.AssetsMacro.embedFont() @@ -20214,7 +15285,7 @@ - + lime._internal.macros.AssetsMacro.embedFont() @@ -20226,7 +15297,7 @@ - + lime._internal.macros.AssetsMacro.embedFont() @@ -20542,6 +15613,2018 @@ "hxMath.h" + + + + + + + + + + 0 + + + + + + idEnumerator++ + * A unique ID starting from 0 and increasing by 1 for each subsequent `FlxBasic` that is created. + + + + true + * Controls whether `update()` is automatically called by `FlxState`/`FlxGroup`. + + + + true + * Controls whether `draw()` is automatically called by `FlxState`/`FlxGroup`. + + + + true + * Useful state for many game objects - "dead" (`!alive`) vs `alive`. `kill()` and + * `revive()` both flip this switch (along with `exists`, but you can override that). + + + + true + * Controls whether `update()` and `draw()` are automatically called by `FlxState`/`FlxGroup`. + + + + * Gets or sets the first camera of this object. + + + + * This determines on which `FlxCamera`s this object will be drawn. If it is `null` / has not been + * set, it uses the list of default draw targets, which is controlled via `FlxG.camera.setDefaultDrawTarget` + * as well as the `DefaultDrawTarget` argument of `FlxG.camera.add`. + + + + + NONE + + + * Enum that informs the collision system which type of object this is (to avoid expensive type casting). + + <_cameras> + + + + + + * **WARNING:** A destroyed `FlxBasic` can't be used anymore. + * It may even cause crashes if it is still part of a group or state. + * You may want to use `kill()` instead if you want to disable the object temporarily only and `revive()` it later. + * + * This function is usually not called manually (Flixel calls it automatically during state switches for all `add()`ed objects). + * + * Override this function to `null` out variables manually or call `destroy()` on class members if necessary. + * Don't forget to call `super.destroy()`! + + + + * Handy function for "killing" game objects. Use `reset()` to revive them. + * Default behavior is to flag them as nonexistent AND dead. + * However, if you want the "corpse" to remain in the game, like to animate an effect or whatever, + * you should `override` this, setting only `alive` to `false`, and leaving `exists` `true`. + + + + * Handy function for bringing game objects "back to life". Just sets `alive` and `exists` back to `true`. + * In practice, this function is most often called by `FlxObject#reset()`. + + + + + + + * Override this function to update your class's position and appearance. + * This is where most of your game rules and behavioral code will go. + + + + * Override this function to control how the object is drawn. + * Doing so is rarely necessary, but can be very useful. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * This is a useful "generic" Flixel object. Both `FlxObject` and + * `FlxGroup` extend this class. Has no size, position or graphical data. + + + + + + <_inPool> + + + + + + + + + + + + <_pool expr="new FlxPool<FlxRect>(FlxRect)" line="15" static="1"> + + (FlxRect)]]> + + + + + + + + + + { Height : 0, Width : 0, Y : 0, X : 0 } + * Recycle or create new FlxRect. + * Be sure to put() them back into the pool after you're done with them! + + + + + + + + + + { Height : 0, Width : 0, Y : 0, X : 0 } + * Recycle or create a new FlxRect which will automatically be released + * to the pool when passed into a flixel function. + + + + + + + + + * The x coordinate of the left side of the rectangle. + + + + * The x coordinate of the right side of the rectangle. + + + + * The y coordinate of the top of the rectangle. + + + + * The y coordinate of the bottom of the rectangle. + + + + * Whether width or height of this rectangle is equal to zero or not. + + <_weak expr="false"> + + false + + <_inPool expr="false"> + + false + + + + * Add this FlxRect to the recycling pool. + + + + * Add this FlxPoint to the recycling pool if it's a weak reference (allocated via weak()). + + + + + + + + * Shortcut for setting both width and Height. + * + * @param Width The new sprite width. + * @param Height The new sprite height. + + + + + + + + * Shortcut for setting both x and y. + + + + + + + + + + { Height : 0, Width : 0, Y : 0, X : 0 } + * Fill this rectangle with the data provided. + * + * @param X The X-coordinate of the point in space. + * @param Y The Y-coordinate of the point in space. + * @param Width Desired width of the rectangle. + * @param Height Desired height of the rectangle. + * @return A reference to itself. + + + + + + + * Helper function, just copies the values from the specified rectangle. + * + * @param Rect Any FlxRect. + * @return A reference to itself. + + + + + + + * Helper function, just copies the values from this rectangle to the specified rectangle. + * + * @param Point Any FlxRect. + * @return A reference to the altered rectangle parameter. + + + + + + + * Helper function, just copies the values from the specified Flash rectangle. + * + * @param FlashRect Any Rectangle. + * @return A reference to itself. + + + + + + + * Helper function, just copies the values from this rectangle to the specified Flash rectangle. + * + * @param Point Any Rectangle. + * @return A reference to the altered rectangle parameter. + + + + + + + * Checks to see if some FlxRect object overlaps this FlxRect object. + * + * @param Rect The rectangle being tested. + * @return Whether or not the two rectangles overlap. + + + + + + + * Returns true if this FlxRect contains the FlxPoint + * + * @param Point The FlxPoint to check + * @return True if the FlxPoint is within this FlxRect, otherwise false + + + + + + + * Add another rectangle to this one by filling in the + * horizontal and vertical space between the two rectangles. + * + * @param Rect The second FlxRect to add to this one + * @return The changed FlxRect + + + + * Rounds x, y, width and height using Math.floor() + + + + * Rounds x, y, width and height using Math.ceil() + + + + * Rounds x, y, width and height using Math.round() + + + + + + + + * Calculation of bounding box for two points + * + * @param point1 first point to calculate bounding box + * @param point2 second point to calculate bounding box + * @return this rectangle filled with the position and size of bounding box for two specified points + + + + + + + * Add another point to this rectangle one by filling in the + * horizontal and vertical space between the point and this rectangle. + * + * @param Point point to add to this one + * @return The changed FlxRect + + + + + + + + + + + + + + * Calculates the globally aligned bounding box of a `FlxRect` with the given angle and origin. + * @param degrees The rotation, in degrees of the rect. + * @param origin The relative pivot point, or the point that the rectangle rotates around. + * if `null` , the top-left (or 0,0) is used. + * @param newRect Optional output `FlxRect`, if `null`, a new one is created. Note: If you like, you can + * pass in the input rect to manipulate it. ex: `rect.calcRotatedBounds(angle, null, rect)` + * @return A globally aligned `FlxRect` that fully contains the input rectangle. + * @since 4.11.0 + + + + * Necessary for IFlxDestroyable. + + + + + + + * Checks if this rectangle's properties are equal to properties of provided rect. + * + * @param rect Rectangle to check equality to. + * @return Whether both rectangles are equal. + + + + + + + + * Returns the area of intersection with specified rectangle. + * If the rectangles do not intersect, this method returns an empty rectangle. + * + * @param rect Rectangle to check intersection against. + * @return The area of intersection of two rectangles. + + + + * Convert object to readable string name. Useful for debugging, save games, etc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { Height : 0, Width : 0, Y : 0, X : 0 } + + + + * Stores a rectangle. + + + + + + + false + * Default value for `FlxObject`'s `pixelPerfectPosition` var. + + + + 4 + * This value dictates the maximum number of pixels two objects have to intersect + * before collision stops trying to separate them. + * Don't modify this unless your objects are passing through each other. + + + + FlxDirectionFlags.LEFT + * Generic value for "left". Used by `facing`, `allowCollisions`, and `touching`. + * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.LEFT` directly. + + + + FlxDirectionFlags.RIGHT + * Generic value for "right". Used by `facing`, `allowCollisions`, and `touching`. + * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.RIGHT` directly. + + + + FlxDirectionFlags.UP + * Generic value for "up". Used by `facing`, `allowCollisions`, and `touching`. + * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.UP` directly. + + + + FlxDirectionFlags.DOWN + * Generic value for "down". Used by `facing`, `allowCollisions`, and `touching`. + * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.DOWN` directly. + + + + FlxDirectionFlags.NONE + * Special-case constant meaning no collisions, used mainly by `allowCollisions` and `touching`. + * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.NONE` directly. + + + + FlxDirectionFlags.CEILING + * Special-case constant meaning up, used mainly by `allowCollisions` and `touching`. + * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.CEILING` directly. + + + + FlxDirectionFlags.FLOOR + * Special-case constant meaning down, used mainly by `allowCollisions` and `touching`. + * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.FLOOR` directly. + + + + FlxDirectionFlags.WALL + * Special-case constant meaning only the left and right sides, used mainly by `allowCollisions` and `touching`. + * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.WALL` directly. + + + + FlxDirectionFlags.ANY + * Special-case constant meaning any direction, used mainly by `allowCollisions` and `touching`. + * Note: This exists for backwards compatibility, prefer using `FlxDirectionFlags.ANY` directly. + + <_firstSeparateFlxRect expr="FlxRect.get()" line="91" static="1"> + + + FlxRect.get() + + + + <_secondSeparateFlxRect expr="FlxRect.get()" line="93" static="1"> + + + FlxRect.get() + + + + + + + + + + * The main collision resolution function in Flixel. + * + * @param Object1 Any `FlxObject`. + * @param Object2 Any other `FlxObject`. + * @return Whether the objects in fact touched and were separated. + + + + + + + + * Similar to `separate()`, but only checks whether any overlap is found and updates + * the `touching` flags of the input objects, but no separation is performed. + * + * @param Object1 Any `FlxObject`. + * @param Object2 Any other `FlxObject`. + * @return Whether the objects in fact touched. + + + + + + + + + + { checkMaxOverlap : true } + + + * Internal function that computes overlap among two objects on the X axis. It also updates the `touching` variable. + * `checkMaxOverlap` is used to determine whether we want to exclude (therefore check) overlaps which are + * greater than a certain maximum (linked to `SEPARATE_BIAS`). Default is `true`, handy for `separateX` code. + + + + + + + + * The X-axis component of the object separation process. + * + * @param Object1 Any `FlxObject`. + * @param Object2 Any other `FlxObject`. + * @return Whether the objects in fact touched and were separated along the X axis. + + + + + + + + * Checking overlap and updating `touching` variables, X-axis part used by `updateTouchingFlags`. + * + * @param Object1 Any `FlxObject`. + * @param Object2 Any other `FlxObject`. + * @return Whether the objects in fact touched along the X axis. + + + + + + + + + + { checkMaxOverlap : true } + + + * Internal function that computes overlap among two objects on the Y axis. It also updates the `touching` variable. + * `checkMaxOverlap` is used to determine whether we want to exclude (therefore check) overlaps which are + * greater than a certain maximum (linked to `SEPARATE_BIAS`). Default is `true`, handy for `separateY` code. + + + + + + + + * The Y-axis component of the object separation process. + * + * @param Object1 Any `FlxObject`. + * @param Object2 Any other `FlxObject`. + * @return Whether the objects in fact touched and were separated along the Y axis. + + + + + + + + * Checking overlap and updating touching variables, Y-axis part used by `updateTouchingFlags`. + * + * @param Object1 Any `FlxObject`. + * @param Object2 Any other `FlxObject`. + * @return Whether the objects in fact touched along the Y axis. + + + + 0 + * X position of the upper left corner of this object in world space. + + + + 0 + * Y position of the upper left corner of this object in world space. + + + + + * The width of this object's hitbox. For sprites, use `offset` to control the hitbox position. + + + + + * The height of this object's hitbox. For sprites, use `offset` to control the hitbox position. + + + + * Whether or not the coordinates should be rounded during rendering. + * Does not affect `copyPixels()`, which can only render on whole pixels. + * Defaults to the camera's global `pixelPerfectRender` value, + * but overrides that value if not equal to `null`. + + + + true + * Whether or not the position of this object should be rounded before any `draw()` or collision checking. + + + + 0 + * Set the angle (in degrees) of a sprite to rotate it. WARNING: rotating sprites + * decreases their rendering performance by a factor of ~10x when using blitting! + + + + true + * Set this to `false` if you want to skip the automatic motion/movement stuff (see `updateMotion()`). + * `FlxObject` and `FlxSprite` default to `true`. `FlxText`, `FlxTileblock` and `FlxTilemap` default to `false`. + + + + false + * Whether an object will move/alter position after a collision. + + + + * Whether the object collides or not. For more control over what directions the object will collide from, + * use collision constants (like `LEFT`, `FLOOR`, etc) to set the value of `allowCollisions` directly. + + + + * Controls how much this object is affected by camera scrolling. `0` = no movement (e.g. a background layer), + * `1` = same movement speed as the foreground. Default value is `(1,1)`, + * except for UI elements like `FlxButton` where it's `(0,0)`. + + + + * The basic speed of this object (in pixels per second). + + + + * How fast the speed of this object is changing (in pixels per second). + * Useful for smooth movement and gravity. + + + + * This isn't drag exactly, more like deceleration that is only applied + * when `acceleration` is not affecting the sprite. + + + + * If you are using `acceleration`, you can use `maxVelocity` with it + * to cap the speed automatically (very useful!). + + + + * Important variable for collision processing. + * By default this value is set automatically during at the start of `update()`. + + + + 1 + * The virtual mass of the object. Default value is 1. Currently only used with elasticity + * during collision resolution. Change at your own risk; effects seem crazy unpredictable so far! + + + + 0 + * The bounciness of this object. Only affects collisions. Default value is 0, or "not bouncy at all." + + + + 0 + * This is how fast you want this sprite to spin (in degrees per second). + + + + 0 + * How fast the spin speed should change (in degrees per second). + + + + 0 + * Like drag but for spinning. + + + + 10000 + * Use in conjunction with angularAcceleration for fluid spin speed control. + + + + 1 + * Handy for storing health percentage or armor points or whatever. + + + + NONE + * Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating surface contacts. Use bitwise operators to check the values + * stored here, or use isTouching(), justTouched(), etc. You can even use them broadly as boolean values if you're feeling saucy! + + + + NONE + * Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating surface contacts from the previous game loop step. Use bitwise operators to check the values + * stored here, or use isTouching(), justTouched(), etc. You can even use them broadly as boolean values if you're feeling saucy! + + + + ANY + * Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating collision directions. Use bitwise operators to check the values stored here. + * Useful for things like one-way platforms (e.g. allowCollisions = UP;). The accessor "solid" just flips this variable between NONE and ANY. + + + + true + * Whether this sprite is dragged along with the horizontal movement of objects it collides with + * (makes sense for horizontally-moving platforms in platformers for example). + + + + null + * The path this object follows. Not initialized by default. + * Assign a `new FlxPath()` object and `start()` it if you want to this object to follow a path. + * Set `path` to `null` again to stop following the path. + * See `flixel.util.FlxPath` for more info and usage examples. + + <_point expr="FlxPoint.get()"> + + + FlxPoint.get() + + + + <_rect expr="FlxRect.get()"> + + + FlxRect.get() + + + + + + + * Internal function for initialization of some object's variables. + + + + + * Internal function for initialization of some variables that are used in `updateMotion()`. + + + + * **WARNING:** A destroyed `FlxBasic` can't be used anymore. + * It may even cause crashes if it is still part of a group or state. + * You may want to use `kill()` instead if you want to disable the object temporarily only and `revive()` it later. + * + * This function is usually not called manually (Flixel calls it automatically during state switches for all `add()`ed objects). + * + * Override this function to `null` out variables manually or call `destroy()` on class members if necessary. + * Don't forget to call `super.destroy()`! + + + + + + + * Override this function to update your class's position and appearance. + * This is where most of your game rules and behavioral code will go. + + + + + + + + * Internal function for updating the position and speed of this object. + * Useful for cases when you need to update this but are buried down in too many supers. + * Does a slightly fancier-than-normal integration to help with higher fidelity framerate-independent motion. + + + + * Rarely called, and in this case just increments the visible objects count and calls `drawDebug()` if necessary. + + + + + + + + + + { InScreenSpace : false } + flixel.group.FlxTypedGroup + + * Checks to see if some `FlxObject` overlaps this `FlxObject` or `FlxGroup`. + * If the group has a LOT of things in it, it might be faster to use `FlxG.overlap()`. + * WARNING: Currently tilemaps do NOT support screen space overlap checks! + * + * @param ObjectOrGroup The object or group being tested. + * @param InScreenSpace Whether to take scroll factors into account when checking for overlap. + * Default is `false`, or "only compare in world space." + * @param Camera Specify which game camera you want. + * If `null`, it will just grab the first global camera. + * @return Whether or not the two objects overlap. + + + + + + + + + + + + + + + + + + + + + + + { InScreenSpace : false } + flixel.group.FlxTypedGroup + + * Checks to see if this `FlxObject` were located at the given position, + * would it overlap the `FlxObject` or `FlxGroup`? + * This is distinct from `overlapsPoint()`, which just checks that point, + * rather than taking the object's size into account. + * WARNING: Currently tilemaps do NOT support screen space overlap checks! + * + * @param X The X position you want to check. + * Pretends this object (the caller, not the parameter) is located here. + * @param Y The Y position you want to check. + * Pretends this object (the caller, not the parameter) is located here. + * @param ObjectOrGroup The object or group being tested. + * @param InScreenSpace Whether to take scroll factors into account when checking for overlap. + * Default is `false`, or "only compare in world space." + * @param Camera Specify which game camera you want. + * If `null`, it will just grab the first global camera. + * @return Whether or not the two objects overlap. + + + + + + + + + + + + + + + + + + + + { InScreenSpace : false } + * Checks to see if a point in 2D world space overlaps this `FlxObject`. + * + * @param Point The point in world space you want to check. + * @param InScreenSpace Whether to take scroll factors into account when checking for overlap. + * @param Camera Specify which game camera you want. + * If `null`, it will just grab the first global camera. + * @return Whether or not the point overlaps this object. + + + + * Check and see if this object is currently within the world bounds - + * useful for killing objects that get too far away. + * + * @return Whether the object is within the world bounds or not. + + + + + + + + * Call this function to figure out the on-screen position of the object. + * + * @param Point Takes a `FlxPoint` object and assigns the post-scrolled X and Y values of this object to it. + * @param Camera Specify which game camera you want. + * If `null`, it will just grab the first global camera. + * @return The Point you passed in, or a new Point if you didn't pass one, + * containing the screen X and Y position of this object. + + + + + + + + + + + * Retrieve the midpoint of this object in world coordinates. + * + * @param point Allows you to pass in an existing `FlxPoint` object if you're so inclined. + * Otherwise a new one is created. + * @return A `FlxPoint` object containing the midpoint of this object in world coordinates. + + + + + + + + + + + + * Handy function for reviving game objects. + * Resets their existence flags and position. + * + * @param X The new X position of this object. + * @param Y The new Y position of this object. + + + + + + + * Check and see if this object is currently on screen. + * + * @param Camera Specify which game camera you want. + * If `null`, it will just grab the first global camera. + * @return Whether the object is on screen or not. + + + + + + + * Check if object is rendered pixel perfect on a specific camera. + + + + + + + * Handy function for checking if this object is touching a particular surface. + * Be sure to check it before calling `super.update()`, as that will reset the flags. + * + * @param Direction Any of the collision flags (e.g. `LEFT`, `FLOOR`, etc). + * @return Whether the object is touching an object in (any of) the specified direction(s) this frame. + + + + + + + * Handy function for checking if this object is just landed on a particular surface. + * Be sure to check it before calling `super.update()`, as that will reset the flags. + * + * @param Direction Any of the collision flags (e.g. `LEFT`, `FLOOR`, etc). + * @return Whether the object just landed on (any of) the specified surface(s) this frame. + + + + + + + * Reduces the `health` variable of this object by the amount specified in `Damage`. + * Calls `kill()` if health drops to or below zero. + * + * @param Damage How much health to take away (use a negative number to give a health bonus). + + + + + + + { axes : XY } + * Centers this `FlxObject` on the screen, either by the x axis, y axis, or both. + * + * @param axes On what axes to center the object (e.g. `X`, `Y`, `XY`) - default is both. + * @return This FlxObject for chaining + + + + + + + + { Y : 0, X : 0 } + * Helper function to set the coordinates of this object. + * Handy since it only requires one line of code. + * + * @param X The new x position + * @param Y The new y position + + + + + + + + * Shortcut for setting both width and Height. + * + * @param Width The new hitbox width. + * @param Height The new hitbox height. + + + + + + + flixel.FlxCamera + + + + + + + * Calculates the smallest globally aligned bounding box that encompasses this + * object's width and height, at its current rotation. + * Note, if called on a `FlxSprite`, the origin is used, but scale and offset are ignored. + * Use `getScreenBounds` to use these properties. + * @param newRect The optional output `FlxRect` to be returned, if `null`, a new one is created. + * @return A globally aligned `FlxRect` that fully contains the input object's width and height. + * @since 4.11.0 + + + + * Convert object to readable string name. Useful for debugging, save games, etc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { Height : 0, Width : 0, Y : 0, X : 0 } + * @param X The X-coordinate of the point in space. + * @param Y The Y-coordinate of the point in space. + * @param Width Desired width of the rectangle. + * @param Height Desired height of the rectangle. + + * This is the base class for most of the display objects (`FlxSprite`, `FlxText`, etc). + * It includes some basic attributes about game objects, basic state information, + * sizes, scrolling, and basic physics and motion. + + + + + + + * Class that handles adding and playing animations on this sprite. + + + + * The current display state of the sprite including current animation frame, + * tint, flip etc... may be `null` unless `useFramePixels` is `true`. + + + + true + * Always `true` on `FlxG.renderBlit`. On `FlxG.renderTile` it determines whether + * `framePixels` is used and defaults to `false` for performance reasons. + + + + false + * Controls whether the object is smoothed when rotated, affects performance. + + + + true + * Set this flag to true to force the sprite to update during the `draw()` call. + * NOTE: Rarely if ever necessary, most sprite operations will flip this flag automatically. + + + + * This sprite's graphic / `BitmapData` object. + * Automatically adjusts graphic size and render helpers if changed. + + + + * Link to current `FlxFrame` from loaded atlas + + + + 0 + * The width of the actual graphic or image being displayed (not necessarily the game object/bounding box). + + + + 0 + * The height of the actual graphic or image being displayed (not necessarily the game object/bounding box). + + + + 0 + * The total number of frames in this image. + * WARNING: assumes each row in the sprite sheet is full! + + + + * Rendering variables. + + + + + 0 + * The minimum angle (out of 360°) for which a new baked rotation exists. Example: `90` means there + * are 4 baked rotations in the spritesheet. `0` if this sprite does not have any baked rotations. + + + + 1.0 + * Set alpha to a number between `0` and `1` to change the opacity of the sprite. + + + + RIGHT + * Can be set to `LEFT`, `RIGHT`, `UP`, and `DOWN` to take advantage + * of flipped sprites and/or just track player orientation more easily. + + + + false + * Whether this sprite is flipped on the X axis. + + + + false + * Whether this sprite is flipped on the Y axis. + + + + * WARNING: The `origin` of the sprite will default to its center. If you change this, + * the visuals and the collisions will likely be pretty out-of-sync if you do any rotation. + + + + * Controls the position of the sprite's hitbox. Likely needs to be adjusted after + * changing a sprite's `width`, `height` or `scale`. + + + + * Change the size of your sprite's graphic. + * NOTE: The hitbox is not automatically adjusted, use `updateHitbox()` for that (or `setGraphicSize()`). + * WARNING: With `FlxG.renderBlit`, scaling sprites decreases rendering performance by a factor of about x10! + + + + * Blending modes, just like Photoshop or whatever, e.g. "multiply", "screen", etc. + + + + 0xffffff + * Tints the whole sprite to a color (`0xRRGGBB` format) - similar to OpenGL vertex colors. You can use + * `0xAARRGGBB` colors, but the alpha value will simply be ignored. To change the opacity use `alpha`. + + + + + false + * Whether or not to use a `ColorTransform` set via `setColorTransform()`. + + + + * Clipping rectangle for this sprite. + * Changing the rect's properties directly doesn't have any effect, + * reassign the property to update it (`sprite.clipRect = sprite.clipRect;`). + * Set to `null` to discard graphic frame clipping. + + + + * GLSL shader for this sprite. Only works with OpenFL Next or WebGL. + * Avoid changing it frequently as this is a costly operation. + * @since 4.1.0 + + <_frame> + + + * The actual frame used for sprite rendering + + <_frameGraphic> + + + * Graphic of `_frame`. Used in tile render mode, when `useFramePixels` is `true`. + + <_facingHorizontalMult expr="1"> + + + 1 + + + + <_facingVerticalMult expr="1"> + + + 1 + + + + <_flashPoint> + + + * Internal, reused frequently during drawing and animating. + + <_flashRect> + + + * Internal, reused frequently during drawing and animating. + + <_flashRect2> + + + * Internal, reused frequently during drawing and animating. + + <_flashPointZero> + + + * Internal, reused frequently during drawing and animating. Always contains `(0,0)`. + + <_matrix> + + + * Internal, helps with animation, caching and drawing. + + <_halfSize> + + + * Rendering helper variable + + <_sinAngle expr="0"> + + + 0 + + + * These vars are being used for rendering in some of `FlxSprite` subclasses (`FlxTileblock`, `FlxBar`, + * and `FlxBitmapText`) and for checks if the sprite is in camera's view. + + <_cosAngle expr="1"> + + + 1 + + + + <_angleChanged expr="true"> + + + true + + + + <_facingFlip expr="new Map<FlxDirectionFlags,{ var x : Bool; var y : Bool}>()"> + + + + + + + + + ()]]> + + + * Maps `FlxDirectionFlags` values to axis flips + + + + + + + + * **WARNING:** A destroyed `FlxBasic` can't be used anymore. + * It may even cause crashes if it is still part of a group or state. + * You may want to use `kill()` instead if you want to disable the object temporarily only and `revive()` it later. + * + * This function is usually not called manually (Flixel calls it automatically during state switches for all `add()`ed objects). + * + * Override this function to `null` out variables manually or call `destroy()` on class members if necessary. + * Don't forget to call `super.destroy()`! + + + + + + + + * Load graphic from another `FlxSprite` and copy its tile sheet data. + * This method can useful for non-flash targets. + * + * @param Sprite The `FlxSprite` from which you want to load graphic data. + * @return This `FlxSprite` instance (nice for chaining stuff together, if you're into that). + + + + + + + + + + + + { Unique : false, Height : 0, Width : 0, Animated : false } + * Load an image from an embedded graphic file. + * + * HaxeFlixel's graphic caching system keeps track of loaded image data. + * When you load an identical copy of a previously used image, by default + * HaxeFlixel copies the previous reference onto the `pixels` field instead + * of creating another copy of the image data, to save memory. + * + * @param Graphic The image you want to use. + * @param Animated Whether the `Graphic` parameter is a single sprite or a row / grid of sprites. + * @param Width Specify the width of your sprite + * (helps figure out what to do with non-square sprites or sprite sheets). + * @param Height Specify the height of your sprite + * (helps figure out what to do with non-square sprites or sprite sheets). + * @param Unique Whether the graphic should be a unique instance in the graphics cache. + * Set this to `true` if you want to modify the `pixels` field without changing + * the `pixels` of other sprites with the same `BitmapData`. + * @param Key Set this parameter if you're loading `BitmapData`. + * @return This `FlxSprite` instance (nice for chaining stuff together, if you're into that). + + + + + + + + + + + + { AutoBuffer : false, AntiAliasing : false, Frame : -1, Rotations : 16 } + * Create a pre-rotated sprite sheet from a simple sprite. + * This can make a huge difference in graphical performance on blitting targets! + * + * @param Graphic The image you want to rotate and stamp. + * @param Rotations The number of rotation frames the final sprite should have. + * For small sprites this can be quite a large number (`360` even) without any problems. + * @param Frame If the `Graphic` has a single row of square animation frames on it, + * you can specify which of the frames you want to use here. + * Default is `-1`, or "use whole graphic." + * @param AntiAliasing Whether to use high quality rotations when creating the graphic. Default is `false`. + * @param AutoBuffer Whether to automatically increase the image size to accommodate rotated corners. + * Will create frames that are 150% larger on each axis than the original frame or graphic. + * @param Key Optional, set this parameter if you're loading `BitmapData`. + * @return This `FlxSprite` instance (nice for chaining stuff together, if you're into that). + + + + + + + + + + { AutoBuffer : false, AntiAliasing : false, Rotations : 16 } + * Helper method which allows using `FlxFrame` as graphic source for sprite's `loadRotatedGraphic()` method. + * + * @param frame Frame to load into this sprite. + * @param rotations The number of rotation frames the final sprite should have. + * For small sprites this can be quite a large number (`360` even) without any problems. + * @param antiAliasing Whether to use high quality rotations when creating the graphic. Default is `false`. + * @param autoBuffer Whether to automatically increase the image size to accommodate rotated corners. + * Will create frames that are 150% larger on each axis than the original frame or graphic. + * @return this FlxSprite with loaded rotated graphic in it. + + + + + + + + + + + { Unique : false, Color : FlxColor.WHITE } + * This function creates a flat colored rectangular image dynamically. + * + * HaxeFlixel's graphic caching system keeps track of loaded image data. + * When you make an identical copy of a previously used image, by default + * HaxeFlixel copies the previous reference onto the pixels field instead + * of creating another copy of the image data, to save memory. + * + * @param Width The width of the sprite you want to generate. + * @param Height The height of the sprite you want to generate. + * @param Color Specifies the color of the generated block (ARGB format). + * @param Unique Whether the graphic should be a unique instance in the graphics cache. Default is `false`. + * Set this to `true` if you want to modify the `pixels` field without changing the + * `pixels` of other sprites with the same `BitmapData`. + * @param Key An optional `String` key to identify this graphic in the cache. + * If `null`, the key is determined by `Width`, `Height` and `Color`. + * If `Unique` is `true` and a graphic with this `Key` already exists, + * it is used as a prefix to find a new unique name like `"Key3"`. + * @return This `FlxSprite` instance (nice for chaining stuff together, if you're into that). + + + + * Called whenever a new graphic is loaded for this sprite (after `loadGraphic()`, `makeGraphic()` etc). + + + + * Resets some internal variables used for frame `BitmapData` calculation. + + + + * Resets frame size to frame dimensions. + + + + * Resets sprite's size back to frame size. + + + + * Helper method just for convenience, so you don't need to type + * `sprite.frame = sprite.frame;` + * You may need this method in tile render mode, + * when you want sprite to use its original graphic, not the graphic generated from its `framePixels`. + + + + + + + + { Height : 0, Width : 0 } + + + + + * Updates the sprite's hitbox (`width`, `height`, `offset`) according to the current `scale`. + * Also calls `centerOrigin()`. + + + + + * Resets some important variables for sprite optimization and rendering. + + + + + + + + + + + * This is separated out so it can be easily overridden. + + + + + + + + * Called by game loop, updates then blits or renders current frame of animation to the screen. + + + + + + + + + + + + + + + + + + + + + + + { Y : 0, X : 0 } + * Stamps / draws another `FlxSprite` onto this `FlxSprite`. + * This function is NOT intended to replace `draw()`! + * + * @param Brush The sprite you want to use as a brush or stamp or pen or whatever. + * @param X The X coordinate of the brush's top left corner on this sprite. + * @param Y They Y coordinate of the brush's top left corner on this sprite. + + + + + + + { Force : false } + * Request (or force) that the sprite update the frame before rendering. + * Useful if you are doing procedural generation or other weirdness! + * + * @param Force Force the frame to redraw, even if its not flagged as necessary. + + + + + + + { AdjustPosition : false } + * Helper function that adjusts the offset automatically to center the bounding box within the graphic. + * + * @param AdjustPosition Adjusts the actual X and Y position just once to match the offset change. + + + + * Sets the sprite's origin to its center - useful after adjusting + * `scale` to make sure rotations work as expected. + + + + + + + + + { FetchPositions : false } + * Replaces all pixels with specified `Color` with `NewColor` pixels. + * WARNING: very expensive (especially on big graphics) as it iterates over every single pixel. + * + * @param Color Color to replace + * @param NewColor New color + * @param FetchPositions Whether we need to store positions of pixels which colors were replaced. + * @return `Array` with replaced pixels positions + + + + + + + + + + + + + + { alphaOffset : 0, blueOffset : 0, greenOffset : 0, redOffset : 0, alphaMultiplier : 1.0, blueMultiplier : 1.0, greenMultiplier : 1.0, redMultiplier : 1.0 } + * Sets the sprite's color transformation with control over color offsets. + * With `FlxG.renderTile`, offsets are only supported on OpenFL Next version 3.6.0 or higher. + * + * @param redMultiplier The value for the red multiplier, in the range from `0` to `1`. + * @param greenMultiplier The value for the green multiplier, in the range from `0` to `1`. + * @param blueMultiplier The value for the blue multiplier, in the range from `0` to `1`. + * @param alphaMultiplier The value for the alpha transparency multiplier, in the range from `0` to `1`. + * @param redOffset The offset value for the red color channel, in the range from `-255` to `255`. + * @param greenOffset The offset value for the green color channel, in the range from `-255` to `255`. + * @param blueOffset The offset for the blue color channel value, in the range from `-255` to `255`. + * @param alphaOffset The offset for alpha transparency channel value, in the range from `-255` to `255`. + + + + + + + + + + { Mask : 0xFF } + * Checks to see if a point in 2D world space overlaps this `FlxSprite` object's current displayed pixels. + * This check is ALWAYS made in screen space, and always takes `scrollFactor` into account. + * + * @param Point The point in world space you want to check. + * @param Mask Used in the pixel hit test to determine what counts as solid. + * @param Camera Specify which game camera you want. If `null`, it will just grab the first global camera. + * @return Whether or not the point overlaps this object. + + + + + + + + { RunOnCpp : false } + + + * Internal function to update the current animation frame. + * + * @param RunOnCpp Whether the frame should also be recalculated if we're on a non-flash target + + + + * Retrieves the `BitmapData` of the current `FlxFrame`. Updates `framePixels`. + + + + + + + * Retrieve the midpoint of this sprite's graphic in world coordinates. + * + * @param point Allows you to pass in an existing `FlxPoint` if you're so inclined. + * Otherwise a new one is created. + * @return A `FlxPoint` containing the midpoint of this sprite's graphic in world coordinates. + + + + + + + * Check and see if this object is currently on screen. Differs from `FlxObject`'s implementation + * in that it takes the actual graphic into account, not just the hitbox or bounding box or whatever. + * + * @param Camera Specify which game camera you want. If `null`, it will just grab the first global camera. + * @return Whether the object is on screen or not. + + + + + + + * Returns the result of `isSimpleRenderBlit()` if `FlxG.renderBlit` is + * `true`, or `false` if `FlxG.renderTile` is `true`. + + + + + + + * Determines the function used for rendering in blitting: + * `copyPixels()` for simple sprites, `draw()` for complex ones. + * Sprites are considered simple when they have an `angle` of `0`, a `scale` of `1`, + * don't use `blend` and `pixelPerfectRender` is `true`. + * + * @param camera If a camera is passed its `pixelPerfectRender` flag is taken into account + + + + + + + * Calculates the smallest globally aligned bounding box that encompasses this + * sprite's width and height, at its current rotation. + * Note, if called on a `FlxSprite`, the origin is used, but scale and offset are ignored. + * Use `getScreenBounds` to use these properties. + * @param newRect The optional output `FlxRect` to be returned, if `null`, a new one is created. + * @return A globally aligned `FlxRect` that fully contains the input object's width and height. + * @since 4.11.0 + + + + + + + + * Calculates the smallest globally aligned bounding box that encompasses this sprite's graphic as it + * would be displayed. Honors scrollFactor, rotation, scale, offset and origin. + * @param newRect Optional output `FlxRect`, if `null`, a new one is created. + * @param camera Optional camera used for scrollFactor, if null `FlxG.camera` is used. + * @return A globally aligned `FlxRect` that fully contains the input sprite. + * @since 4.11.0 + + + + + + + + + * Set how a sprite flips when facing in a particular direction. + * + * @param Direction Use constants `LEFT`, `RIGHT`, `UP`, and `DOWN`. + * These may be combined with the bitwise OR operator. + * E.g. To make a sprite flip horizontally when it is facing both `UP` and `LEFT`, + * use `setFacingFlip(LEFT | UP, true, false);` + * @param FlipX Whether to flip the sprite on the X axis. + * @param FlipY Whether to flip the sprite on the Y axis. + + + + + + + + + { saveAnimations : true } + flixel.animation.FlxAnimationController + + * Sets frames and allows you to save animations in sprite's animation controller + * + * @param Frames Frames collection to set for this sprite. + * @param saveAnimations Whether to save animations in animation controller or not. + * @return This sprite with loaded frames + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Internal function for setting graphic property for this object. + * It changes graphics' `useCount` also for better memory tracking. + + + + + + + + + + + + + + + * Frames setter. Used by `loadGraphic` methods, but you can load generated frames yourself + * (this should be even faster since engine doesn't need to do bunch of additional stuff). + * + * @param Frames frames to load into this sprite. + * @return loaded frames. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { Y : 0, X : 0 } + * Creates a `FlxSprite` at a specified position with a specified one-frame graphic. + * If none is provided, a 16x16 image of the HaxeFlixel logo is used. + * + * @param X The initial X position of the sprite. + * @param Y The initial Y position of the sprite. + * @param SimpleGraphic The graphic you want to display + * (OPTIONAL - for simple stuff only, do NOT use for animated images!). + + * The main "game object" class, the sprite is a `FlxObject` + * with a bunch of graphics options and abilities, like animation and stamping. + * + * Load an image onto a sprite using the `loadGraphic*()` functions, + * or create a base monochromatic rectangle using `makeGraphic()`. + * The image `BitmapData` is stored in the `pixels` field. + + @@ -20555,6 +17638,781 @@ + + + + + * The actual group which holds all sprites. + + + + * The link to a group's `members` array. + + + + * The number of entries in the members array. For performance and safety you should check this + * variable instead of `members.length` unless you really know what you're doing! + + + + false + * Whether to attempt to preserve the ratio of alpha values of group members, or set them directly through + * the alpha property. Defaults to `false` (preservation). + * @since 4.5.0 + + + + * The maximum capacity of this group. Default is `0`, meaning no max capacity, and the group can just grow. + + <_skipTransformChildren expr="false"> + + false + * Optimization to allow setting position of group without transforming children twice. + + <_sprites> + + * Array of all the `FlxSprite`s that exist in this group for + * optimization purposes / static typing on cpp targets. + + + + * This method is used for initialization of variables of complex types. + * Don't forget to call `super.initVars()` if you'll override this method, + * or you'll get `null` object error and app will crash. + + + + * **WARNING:** A destroyed `FlxBasic` can't be used anymore. + * It may even cause crashes if it is still part of a group or state. + * You may want to use `kill()` instead if you want to disable the object temporarily only and `revive()` it later. + * + * This function is usually not called manually (Flixel calls it automatically during state switches for all `add()`ed objects). + * + * Override this function to `null` out variables manually or call `destroy()` on class members if necessary. + * Don't forget to call `super.destroy()`! + + + + * Recursive cloning method: it will create a copy of this group which will hold copies of all sprites + * + * @return copy of this sprite group + + + + + + + * Check and see if any sprite in this group is currently on screen. + * + * @param Camera Specify which game camera you want. If `null`, it will just grab the first global camera. + * @return Whether the object is on screen or not. + + + + + + + + + { InScreenSpace : false } + * Checks to see if a point in 2D world space overlaps any `FlxSprite` object from this group. + * + * @param Point The point in world space you want to check. + * @param InScreenSpace Whether to take scroll factors into account when checking for overlap. + * @param Camera Specify which game camera you want. If `null`, it will just grab the first global camera. + * @return Whether or not the point overlaps this group. + + + + + + + + + { Mask : 0xFF } + * Checks to see if a point in 2D world space overlaps any of FlxSprite object's current displayed pixels. + * This check is ALWAYS made in screen space, and always takes scroll factors into account. + * + * @param Point The point in world space you want to check. + * @param Mask Used in the pixel hit test to determine what counts as solid. + * @param Camera Specify which game camera you want. If `null`, it will just grab the first global camera. + * @return Whether or not the point overlaps this object. + + + + + + + + + + + + + + { FetchPositions : false } + * Replaces all pixels with specified `Color` with `NewColor` pixels. + * WARNING: very expensive (especially on big graphics) as it iterates over every single pixel. + * + * @param Color Color to replace + * @param NewColor New color + * @param FetchPositions Whether we need to store positions of pixels which colors were replaced. + * @return `Array` with replaced pixels positions + + + + + + + * Adds a new `FlxSprite` subclass to the group. + * + * @param Sprite The sprite or sprite group you want to add to the group. + * @return The same object that was passed in. + + + + + + + + * Inserts a new `FlxSprite` subclass to the group at the specified position. + * + * @param Position The position that the new sprite or sprite group should be inserted at. + * @param Sprite The sprite or sprite group you want to insert into the group. + * @return The same object that was passed in. + * + * @since 4.3.0 + + + + + + + * Adjusts the position and other properties of the soon-to-be child of this sprite group. + * Private helper to avoid duplicate code in `add()` and `insert()`. + * + * @param Sprite The sprite or sprite group that is about to be added or inserted into the group. + + + + + + + + + + { Revive : true, Force : false } + 0` / "rotating-recycling" (used by `FlxEmitter`): + * - at capacity: returns the next object in line, no matter its properties like `alive`, `exists` etc. + * - otherwise: returns a new object. + * + * `maxSize == 0` / "grow-style-recycling" + * - tries to find the first object with `exists == false` + * - otherwise: adds a new object to the `members` array + * + * WARNING: If this function needs to create a new object, and no object class was provided, + * it will return `null` instead of a valid object! + * + * @param ObjectClass The class type you want to recycle (e.g. `FlxSprite`, `EvilRobot`, etc). + * @param ObjectFactory Optional factory function to create a new object + * if there aren't any dead members to recycle. + * If `null`, `Type.createInstance()` is used, + * which requires the class to have no constructor parameters. + * @param Force Force the object to be an `ObjectClass` and not a super class of `ObjectClass`. + * @param Revive Whether recycled members should automatically be revived + * (by calling `revive()` on them). + * @return A reference to the object that was created.]]> + + + + + + + + { Splice : false } + * Removes the specified sprite from the group. + * + * @param Sprite The `FlxSprite` you want to remove. + * @param Splice Whether the object should be cut from the array entirely or not. + * @return The removed sprite. + + + + + + + + * Replaces an existing `FlxSprite` with a new one. + * + * @param OldObject The sprite you want to replace. + * @param NewObject The new object you want to use instead. + * @return The new sprite. + + + + + + + + + + + + + { Order : FlxSort.ASCENDING } + * Call this function to sort the group according to a particular value and order. + * For example, to sort game objects for Zelda-style overlaps you might call + * `group.sort(FlxSort.byY, FlxSort.ASCENDING)` at the bottom of your `FlxState#update()` override. + * + * @param Function The sorting function to use - you can use one of the premade ones in + * `FlxSort` or write your own using `FlxSort.byValues()` as a "backend". + * @param Order A constant that defines the sort order. + * Possible values are `FlxSort.ASCENDING` (default) and `FlxSort.DESCENDING`. + + + + + + + + { Force : false } + * Call this function to retrieve the first object with `exists == false` in the group. + * This is handy for recycling in general, e.g. respawning enemies. + * + * @param ObjectClass An optional parameter that lets you narrow the + * results to instances of this particular class. + * @param Force Force the object to be an `ObjectClass` and not a super class of `ObjectClass`. + * @return A `FlxSprite` currently flagged as not existing. + + + + * Call this function to retrieve the first index set to `null`. + * Returns `-1` if no index stores a `null` object. + * + * @return An `Int` indicating the first `null` slot in the group. + + + + * Call this function to retrieve the first object with `exists == true` in the group. + * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. + * + * @return A `FlxSprite` currently flagged as existing. + + + + * Call this function to retrieve the first object with `dead == false` in the group. + * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. + * + * @return A `FlxSprite` currently flagged as not dead. + + + + * Call this function to retrieve the first object with `dead == true` in the group. + * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. + * + * @return A `FlxSprite` currently flagged as dead. + + + + * Call this function to find out how many members of the group are not dead. + * + * @return The number of `FlxSprite`s flagged as not dead. Returns `-1` if group is empty. + + + + * Call this function to find out how many members of the group are dead. + * + * @return The number of `FlxSprite`s flagged as dead. Returns `-1` if group is empty. + + + + + + + + { Length : 0, StartIndex : 0 } + * Returns a member at random from the group. + * + * @param StartIndex Optional offset off the front of the array. + * Default value is `0`, or the beginning of the array. + * @param Length Optional restriction on the number of values you want to randomly select from. + * @return A `FlxSprite` from the `members` list. + + + + + + + + + + * Iterate through every member + * + * @return An iterator + + + + + + + + + + + { Recurse : false } + * Applies a function to all members. + * + * @param Function A function that modifies one element at a time. + * @param Recurse Whether or not to apply the function to members of subgroups as well. + + + + + + + + + + + { Recurse : false } + * Applies a function to all `alive` members. + * + * @param Function A function that modifies one element at a time. + * @param Recurse Whether or not to apply the function to members of subgroups as well. + + + + + + + + + + + { Recurse : false } + * Applies a function to all dead members. + * + * @param Function A function that modifies one element at a time. + * @param Recurse Whether or not to apply the function to members of subgroups as well. + + + + + + + + + + + { Recurse : false } + * Applies a function to all existing members. + * + * @param Function A function that modifies one element at a time. + * @param Recurse Whether or not to apply the function to members of subgroups as well. + + + + + + + + + + + + { Recurse : false } + `. + * + * @param ObjectClass A class that objects will be checked against before Function is applied, ex: `FlxSprite`. + * @param Function A function that modifies one element at a time. + * @param Recurse Whether or not to apply the function to members of subgroups as well.]]> + + + + * Remove all instances of `FlxSprite` from the list. + * WARNING: does not `destroy()` or `kill()` any of these objects! + + + + * Calls `kill()` on the group's members and then on the group itself. + * You can revive this group later via `revive()` after this. + + + + * Revives the group. + + + + + + + + + + + + + { Y : 0, X : 0 } + * Helper function to set the coordinates of this object. + * Handy since it only requires one line of code. + * + * @param X The new x position + * @param Y The new y position + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * This functionality isn't supported in SpriteGroup + + + + + + + + * This functionality isn't supported in SpriteGroup + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * This functionality isn't supported in SpriteGroup + * @return this sprite group + + + + + + + + + + + + { Unique : false, Height : 0, Width : 0, Animated : false } + * This functionality isn't supported in SpriteGroup + * @return this sprite group + + + + + + + + + + + + { AutoBuffer : false, AntiAliasing : false, Frame : -1, Rotations : 16 } + * This functionality isn't supported in SpriteGroup + * @return this sprite group + + + + + + + + + + + { Unique : false, Color : FlxColor.WHITE } + * This functionality isn't supported in SpriteGroup + * @return this sprite group + + + + + + + + + + + + + + + + { RunOnCpp : false } + * Internal function to update the current animation frame. + * + * @param RunOnCpp Whether the frame should also be recalculated if we're on a non-flash target + + + + * This functionality isn't supported in SpriteGroup + + + + + + + + + { Y : 0, X : 0 } + * This functionality isn't supported in SpriteGroup + + + + + + + + * This functionality isn't supported in SpriteGroup + + + + + + + + + { MaxSize : 0, Y : 0, X : 0 } + * @param X The initial X position of the group. + * @param Y The initial Y position of the group. + * @param MaxSize Maximum amount of members allowed. + + * `FlxSpriteGroup` is a special `FlxSprite` that can be treated like + * a single sprite even if it's made up of several member sprites. + * It shares the `FlxTypedGroup` API, but it doesn't inherit from it. + + @@ -20729,14 +18587,14 @@ - + - + - + @@ -25021,9 +22879,9 @@ - <__touch get="inline" set="null" expr=""1.665409631e+012"" line="22" static="1"> + <__touch get="inline" set="null" expr=""1.665473362e+012"" line="22" static="1"> - "1.665409631e+012" + "1.665473362e+012" @@ -30096,6 +27954,617 @@ { Y : 0, X : 0 } + + + + + + + + + + + + + + + + + + + + + * Helper for overlap functions in `FlxObject` and `FlxTilemap`. + + + + + + + + + + + * `Array` of all the members in this group. + + + + * The maximum capacity of this group. Default is `0`, meaning no max capacity, and the group can just grow. + + + + 0 + * The number of entries in the members array. For performance and safety you should check this + * variable instead of `members.length` unless you really know what you're doing! + + + + + + + * A `FlxSignal` that dispatches when a child is added to this group. + * @since 4.4.0 + + + + + + + * A `FlxSignal` that dispatches when a child is removed from this group. + * @since 4.4.0 + + <_memberAdded> + + + + + + * Internal variables for lazily creating `memberAdded` and `memberRemoved` signals when needed. + + <_memberRemoved> + + + + + + + <_marker expr="0"> + + + 0 + + + * Internal helper variable for recycling objects a la `FlxEmitter`. + + + + * **WARNING:** A destroyed `FlxBasic` can't be used anymore. + * It may even cause crashes if it is still part of a group or state. + * You may want to use `kill()` instead if you want to disable the object temporarily only and `revive()` it later. + * + * This function is usually not called manually (Flixel calls it automatically during state switches for all `add()`ed objects). + * + * Override this function to `null` out variables manually or call `destroy()` on class members if necessary. + * Don't forget to call `super.destroy()`! + + + + + + + * Automatically goes through and calls update on everything you added. + + + + * Automatically goes through and calls render on everything you added. + + + + + + + * Adds a new `FlxBasic` subclass (`FlxBasic`, `FlxSprite`, `Enemy`, etc) to the group. + * `FlxGroup` will try to replace a `null` member of the array first. + * Failing that, `FlxGroup` will add it to the end of the member array. + * WARNING: If the group has a `maxSize` that has already been met, + * the object will NOT be added to the group! + * + * @param Object The object you want to add to the group. + * @return The same `FlxBasic` object that was passed in. + + + + + + + + * Inserts a new `FlxBasic` subclass (`FlxBasic`, `FlxSprite`, `Enemy`, etc) + * into the group at the specified position. + * `FlxGroup` will try to replace a `null` member at the specified position of the array first. + * Failing that, `FlxGroup` will insert it at the position of the member array. + * WARNING: If the group has a `maxSize` that has already been met, + * the object will NOT be inserted to the group! + * + * @param Position The position in the group where you want to insert the object. + * @param Object The object you want to insert into the group. + * @return The same `FlxBasic` object that was passed in. + + + + + + + + + + { Revive : true, Force : false } + 0` / "rotating-recycling" (used by `FlxEmitter`): + * - at capacity: returns the next object in line, no matter its properties like `alive`, `exists` etc. + * - otherwise: returns a new object. + * + * `maxSize == 0` / "grow-style-recycling" + * - tries to find the first object with `exists == false` + * - otherwise: adds a new object to the `members` array + * + * WARNING: If this function needs to create a new object, and no object class was provided, + * it will return `null` instead of a valid object! + * + * @param ObjectClass The class type you want to recycle (e.g. `FlxSprite`, `EvilRobot`, etc). + * @param ObjectFactory Optional factory function to create a new object + * if there aren't any dead members to recycle. + * If `null`, `Type.createInstance()` is used, + * which requires the class to have no constructor parameters. + * @param Force Force the object to be an `ObjectClass` and not a super class of `ObjectClass`. + * @param Revive Whether recycled members should automatically be revived + * (by calling `revive()` on them). + * @return A reference to the object that was created.]]> + + + + + + + + + + + + + + + + { Splice : false } + * Removes an object from the group. + * + * @param Object The `FlxBasic` you want to remove. + * @param Splice Whether the object should be cut from the array entirely or not. + * @return The removed object. + + + + + + + + * Replaces an existing `FlxBasic` with a new one. + * Does not do anything and returns `null` if the old object is not part of the group. + * + * @param OldObject The object you want to replace. + * @param NewObject The new object you want to use instead. + * @return The new object. + + + + + + + + + + + + + { Order : FlxSort.ASCENDING } + * Call this function to sort the group according to a particular value and order. + * For example, to sort game objects for Zelda-style overlaps you might call + * `group.sort(FlxSort.byY, FlxSort.ASCENDING)` at the bottom of your `FlxState#update()` override. + * + * @param Function The sorting function to use - you can use one of the premade ones in + * `FlxSort` or write your own using `FlxSort.byValues()` as a "backend". + * @param Order A constant that defines the sort order. + * Possible values are `FlxSort.ASCENDING` (default) and `FlxSort.DESCENDING`. + + + + + + + + { Force : false } + * Call this function to retrieve the first object with `exists == false` in the group. + * This is handy for recycling in general, e.g. respawning enemies. + * + * @param ObjectClass An optional parameter that lets you narrow the + * results to instances of this particular class. + * @param Force Force the object to be an `ObjectClass` and not a super class of `ObjectClass`. + * @return A `FlxBasic` currently flagged as not existing. + + + + * Call this function to retrieve the first index set to `null`. + * Returns `-1` if no index stores a `null` object. + * + * @return An `Int` indicating the first `null` slot in the group. + + + + * Call this function to retrieve the first object with `exists == true` in the group. + * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. + * + * @return A `FlxBasic` currently flagged as existing. + + + + * Call this function to retrieve the first object with `dead == false` in the group. + * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. + * + * @return A `FlxBasic` currently flagged as not dead. + + + + * Call this function to retrieve the first object with `dead == true` in the group. + * This is handy for checking if everything's wiped out, or choosing a squad leader, etc. + * + * @return A `FlxBasic` currently flagged as dead. + + + + * Call this function to find out how many members of the group are not dead. + * + * @return The number of `FlxBasic`s flagged as not dead. Returns `-1` if group is empty. + + + + * Call this function to find out how many members of the group are dead. + * + * @return The number of `FlxBasic`s flagged as dead. Returns `-1` if group is empty. + + + + + + + + { Length : 0, StartIndex : 0 } + * Returns a member at random from the group. + * + * @param StartIndex Optional offset off the front of the array. + * Default value is `0`, or the beginning of the array. + * @param Length Optional restriction on the number of values you want to randomly select from. + * @return A `FlxBasic` from the `members` list. + + + + * Remove all instances of `FlxBasic` subclasses (`FlxSprite`, `FlxTileblock`, etc) from the list. + * WARNING: does not `destroy()` or `kill()` any of these objects! + + + + * Calls `kill()` on the group's `members` and then on the group itself. + * You can revive this group later via `revive()` after this. + + + + * Calls `revive()` on the group's members and then on the group itself. + + + + + + + + + + * Iterates through every member. + + + + + + + + + + + { Recurse : false } + * Applies a function to all members. + * + * @param Function A function that modifies one element at a time. + * @param Recurse Whether or not to apply the function to members of subgroups as well. + + + + + + + + + + + { Recurse : false } + * Applies a function to all `alive` members. + * + * @param Function A function that modifies one element at a time. + * @param Recurse Whether or not to apply the function to members of subgroups as well. + + + + + + + + + + + { Recurse : false } + * Applies a function to all dead members. + * + * @param Function A function that modifies one element at a time. + * @param Recurse Whether or not to apply the function to members of subgroups as well. + + + + + + + + + + + { Recurse : false } + * Applies a function to all existing members. + * + * @param Function A function that modifies one element at a time. + * @param Recurse Whether or not to apply the function to members of subgroups as well. + + + + + + + + + + + + { Recurse : false } + `. + * + * @param ObjectClass A class that objects will be checked against before Function is applied, ex: `FlxSprite`. + * @param Function A function that modifies one element at a time. + * @param Recurse Whether or not to apply the function to members of subgroups as well.]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + { MaxSize : 0 } + * @param MaxSize Maximum amount of members allowed. + + * This is an organizational class that can update and render a bunch of `FlxBasic`s. + * NOTE: Although `FlxGroup` extends `FlxBasic`, it will not automatically + * add itself to the global collisions quad tree, it will only add its members. + + + + + + + false + * Whenever the state already has been created. When create is called, this is set to true to prevent the state from being created twice when switching back to it. + + + + false + + + + false + * Determines whether or not this state is updated even when it is not the active state. + * For example, if you have your game state first, and then you push a menu state on top of it, + * if this is set to `true`, the game state would continue to update in the background. + * By default this is `false`, so background states will be "paused" when they are not active. + + + + true + * Determines whether or not this state is updated even when it is not the active state. + * For example, if you have your game state first, and then you push a menu state on top of it, + * if this is set to `true`, the game state would continue to be drawn behind the pause state. + * By default this is `true`, so background states will continue to be drawn behind the current state. + * + * If background states are not `visible` when you have a different state on top, + * you should set this to `false` for improved performance. + + + + true + * If substates get destroyed when they are closed, setting this to + * `false` might reduce state creation time, at greater memory cost. + + + + * The natural background color the cameras default to. In `AARRGGBB` format. + + + + * Current substate. Substates also can be nested. + + <_requestedSubState> + + + * If a state change was requested, the new state object is stored here until we switch to it. + + <_requestSubStateReset expr="false"> + + + false + + + * Whether to reset the substate (when it changes, or when it's closed). + + + + + + + * A `FlxSignal` that dispatches when a sub state is opened from this state. + * @since 4.9.0 + + + + + + + * A `FlxSignal` that dispatches when a sub state is closed from this state. + * @since 4.9.0 + + <_subStateOpened> + + + + + + * Internal variables for lazily creating `subStateOpened` and `subStateClosed` signals when needed. + + <_subStateClosed> + + + + + + + + + * This function is called after the game engine successfully switches states. + * Override this function, NOT the constructor, to initialize or set up your game state. + * We do NOT recommend initializing any flixel objects or utilizing flixel features in + * the constructor, unless you want some crazy unpredictable things to happen! + + + + + + + + + + * Closes the substate of this state, if one exists. + + + + * Load substate for this state + + + + + + + + * Called from `FlxG.switchState()`. If `false` is returned, the state + * switch is cancelled - the default implementation returns `true`. + * + * Useful for customizing state switches, e.g. for transition effects. + + + + * This method is called after the game loses focus. + * Can be useful for third party libraries, such as tweening engines. + + + + * This method is called after the game receives focus. + * Can be useful for third party libraries, such as tweening engines. + + + + + + + + * This function is called whenever the window size has been changed. + * + * @param Width The new window width + * @param Height The new window Height + + + + + + + flixel.FlxGame + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * This is the basic game "state" object - e.g. in a simple game you might have a menu state and a play state. + * It is for all intents and purpose a fancy `FlxGroup`. And really, it's not even that fancy. + + + + + @@ -39139,6 +37608,102 @@ + + + + + null + + + + null + + + + false + + + + false + + + + + + + + + + + + + + + + + + + * Starts the in-transition. Can be called manually at any time. + + + + + + + * Starts the out-transition. Can be called manually at any time. + + + + false + + <_exiting expr="false"> + + false + + <_onExit> + + + + + + + + + + + + + + + * Create a state with the ability to do visual transitions + * @param TransIn Plays when the state begins + * @param TransOut Plays when the state ends + + * A `FlxState` which can perform visual transitions + * + * Usage: + * + * First, extend `FlxTransitionableState` as ie, `FooState`. + * + * Method 1: + * + * ```haxe + * var in:TransitionData = new TransitionData(...); // add your data where "..." is + * var out:TransitionData = new TransitionData(...); + * + * FlxG.switchState(new FooState(in,out)); + * ``` + * + * Method 2: + * + * ```haxe + * FlxTransitionableState.defaultTransIn = new TransitionData(...); + * FlxTransitionableState.defaultTransOut = new TransitionData(...); + * + * FlxG.switchState(new FooState()); + * ``` + + @@ -40625,6 +39190,22 @@ * @author Lars Doucet + + + + + + + + + + + + + + + + @@ -45273,6 +43854,18 @@ + + + + + + + + + + <_tongue> + + @@ -46565,6 +45158,178 @@ * accordingly. + + + + + + + null + + + + + null + + + + false + + <_cursorHidden expr="false"> + + false + + + + * frontend for adding tooltips to things + + <_xml_id expr=""""> + + "" + + <_makeCursor> + <_ui_vars> + + + + <_ui> + <_tongue> + + + false + + <_reload expr="false"> + + false + + <_reload_countdown expr="0"> + + 0 + + + + + + + + + null + + + + + + + + + flixel.addons.ui.FlxUI + + <_cleanupUIVars set="method" line="238"> + + + + + + + + + + + + { height : 600, width : 800 } + + + + + + + + + + + + + + + + + @since 2.1.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { Safe : true, Context : "ui" } + + + + * Creates a cursor. Makes it easy to override this function in your own FlxUIState. + * @return + + + + + + + + + + + { liveFilePath_ : "", tongue_ : null, superIndex_ : null, ptr : null, data : null } + + + + + + + + + + + + + + + * This is a simple extension of FlxState that does two things: + * 1) It implements the IFlxUIState interface + * 2) Automatically creates a FlxUI objects from a single string id + * + * Usage: + * Create a class that extends FlxUIState, override create, and + * before you call super.create(), set _xml_id to the string id + * of the corresponding UI xml file (leave off the extension). + * + * @author Lars Doucet + + @@ -54630,6 +53395,101 @@ + + + + + + + + + + + + + + + + flixel.input.actions.FlxActionManager + * Create an action set from a parsed Json object + * + * @param Data A parsed Json object + * @param CallbackDigital A function to call when digital actions fire + * @param CallbackAnalog A function to call when analog actions fire + * @return An action set + + + + "" + * Name of the action set + + + + * Digital actions in this set + + + + * Analog actions in this set + + + + true + * Whether this action set runs when update() is called + + + + + + + + + { Attach : true } + * Automatically adds or removes inputs for a steam controller + * to any steam-affiliated actions + * @param Handle steam controller handle from FlxSteam.getConnectedControllers(), or FlxInputDeviceID.FIRST_ACTIVE / ALL + * @param Attach true: adds inputs, false: removes inputs + + + + + + + + + + + + + { Destroy : true } + * Remove an action from this set + * @param Action a FlxAction + * @param Destroy whether to destroy it as well + * @return whether it was found and removed + + + + + + + + + + + + + + + + + + + + * @since 4.6.0 + + + flixel.input.actions.FlxActionManager + + @@ -78864,6 +77724,295 @@ + + + + + + + + + + + + + [] + + + + 0 + + + + true + + + + "spooky" + + + + + + + + + { pushList : true } + + + + + + + + + + + + { daAnim : "spooky" } + + *DEBUG MODE + + + + + + + 0 + + + + 0 + + + + 0 + * Current step + + + + 0 + * Current beat + + + + 0 + * Current step, as a `Float` (ex: 4.94, instead of 4) + + + + 0 + * Current beat, as a `Float` (ex: 1.24, instead of 1) + + + + * Game Controls. + + + + + + + + + + + + hide + + + + hide + + + + + + + + + + { fpsSensitive : false } + * Shortcut to `FlxMath.lerp` or `CoolUtil.lerp`, depending on `fpsSensitive` + * @param v1 Value 1 + * @param v2 Value 2 + * @param ratio Ratio + * @param fpsSensitive Whenever the ratio should not be adjusted to run at the same speed independant of framerate. + + + + + + + + + + + + 0 + + <_file> + + + + 0 + * Array of notes showing when each section STARTS in STEPS + * Usually rounded up?? + + + + + + "Dadbattle" + + + + 0 + + + + + + 40 + + + + + + <_song> + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + { songBeginning : false } + + + + + + + + { updateMusic : true, sec : 0 } + + + + + + + { sectionNum : 1 } + + + + + + + + + + + { lengthInSteps : 16 } + + + + + + + + + + + + + + + + + + + + + + + 0.3 + + + + + + + + + + + + + + + + + + + + * Called when the save file dialog is cancelled. + + + + + + + * Called if there is an error while saving the gameplay recording. + + + + + @@ -78902,7 +78051,7 @@ false - + @@ -78950,25 +78099,28 @@ new FlxPoint(0, 0) - - - + + + + + + - { suffix : "" } + { Frame : 0, Reversed : false, suffix : "" } false - + - + @@ -78976,15 +78128,15 @@ false - + * FOR GF DANCING SHIT - + - + @@ -78992,13 +78144,13 @@ false - + - - + + @@ -79009,9 +78161,9 @@ { Context : NONE, Frame : 0, Reversed : false, Force : false } - - - + + + @@ -79020,7 +78172,7 @@ { y : 0, x : 0 } - + @@ -79063,10 +78215,10 @@ * Current beat, as a `Float` (ex: 1.24, instead of 1) - + * Game Controls. - + @@ -79131,6 +78283,95 @@ + + + + + * Used for FreeplayState! If you use it elsewhere, prob gonna annoying + + + + + + + 1, 20 => 0]]]> + Frame Index]]> + + + + + + + * Helper for HScript who can't make maps + * @param steps Something like this: `[[0, 1], [20, 0]]` + + + + + + + + + + + + { isPlayer : false, char : "bf" } + + + + + + + + + + new Map() + + + + + + + + + { diff : 0, score : 0 } + + + + + + + + + { diff : 0, score : 0, week : 1 } + + + + + + + + * YOU SHOULD FORMAT SONG WITH formatSong() BEFORE TOSSING IN SONG VARIABLE + + + + + + + + + + + + + + + + + + + @@ -79208,7 +78449,7 @@ - + null @@ -79216,32 +78457,32 @@ * SONG METADATA - + false - + 0 - + [] - + 1 - + false - + 0 - + 6 @@ -79315,8 +78556,8 @@ false - - + + @@ -79352,8 +78593,8 @@ "" - - + + @@ -79363,7 +78604,7 @@ 5 - + 0 @@ -79376,34 +78617,34 @@ 0 - - + + 0 - + - + - + - - + + - - - - + + + + false @@ -79416,39 +78657,39 @@ true - - - + + + - + false - + - - + + - + - + - + - + 0 @@ -79457,12 +78698,12 @@ 8 - + 0 - + @@ -79472,7 +78713,7 @@ - + @@ -79491,11 +78732,11 @@ - + - + @@ -79512,19 +78753,19 @@ [] - + - + - + - + @@ -79589,12 +78830,12 @@ - + 0xFF9271FD * Default background colors for songs without bg color - + 1 * How much time a song stays selected until it autoplays. @@ -79625,16 +78866,16 @@ - + false - + [] - + 0 @@ -79647,26 +78888,26 @@ null - + - + { change : 0 } - + { change : 0 } - - + + @@ -79732,7 +78973,7 @@ - + ["Resume", "Restart Song", "Exit to menu"] @@ -79763,7 +79004,7 @@ - + [true, true, true, true, true, true, true] @@ -79797,8 +79038,8 @@ - - + + @@ -79814,8 +79055,8 @@ false - - + + @@ -79830,15 +79071,15 @@ 0 - + { change : 0 } - - + + @@ -79847,13 +79088,13 @@ - + false - + @@ -79861,7 +79102,7 @@ [] - + @@ -79869,32 +79110,32 @@ false - - + + false - + - + - + - - + + false - - + + @@ -80335,13 +79576,13 @@ - + - - <__isCacheValid set="method" line="140"> + + <__isCacheValid set="method" line="139"> @@ -80349,7 +79590,7 @@ - <__parseAsset set="method" line="150"> + <__parseAsset set="method" line="149"> @@ -80744,6 +79985,57 @@ ScriptPack + + + + + + + + + { danced : false } + + + + + + + + Default animation that will be played + + + + In which direction the animation will be played + + + + The suffix of the animation (ex: "-alt") - Defaults to "" + + + + Whenever the animation will play reversed or not. + + + + Whenever the animation will play reversed or not. + + + + At what frame the animation will start playing + + + + + + + + + + + { frame : 0, reversed : false, suffix : "" } + + + @@ -80966,6 +80258,23 @@ + + + + + X position + + + + Y position + + + + + + + + @@ -81043,6 +80352,622 @@ + + + + + + + + + + cast "up" + + + + + + + + cast "left" + + + + + + + + cast "right" + + + + + + + + cast "down" + + + + + + + + cast "up-press" + + + + + + + + cast "left-press" + + + + + + + + cast "right-press" + + + + + + + + cast "down-press" + + + + + + + + cast "up-release" + + + + + + + + cast "left-release" + + + + + + + + cast "right-release" + + + + + + + + cast "down-release" + + + + + + + + cast "accept" + + + + + + + + cast "back" + + + + + + + + cast "pause" + + + + + + + + cast "reset" + + + + + + + + cast "cheat" + + + + + + + + + + + + cast "up" + + + + + + + + cast "left" + + + + + + + + cast "right" + + + + + + + + cast "down" + + + + + + + + cast "up-press" + + + + + + + + cast "left-press" + + + + + + + + cast "right-press" + + + + + + + + cast "down-press" + + + + + + + + cast "up-release" + + + + + + + + cast "left-release" + + + + + + + + cast "right-release" + + + + + + + + cast "down-release" + + + + + + + + cast "accept" + + + + + + + + cast "back" + + + + + + + + cast "pause" + + + + + + + + cast "reset" + + + + + + + + cast "cheat" + + + + + + + + + + + + + + + + + + + + + * Since, in many cases multiple actions should use similar keys, we don't want the + * rebinding UI to list every action. ActionBinders are what the user percieves as + * an input so, for instance, they can't set jump-press and jump-release to different keys. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_up expr="new FlxActionDigital(Action.UP)"> + + new FlxActionDigital(Action.UP) + + <_left expr="new FlxActionDigital(Action.LEFT)"> + + new FlxActionDigital(Action.LEFT) + + <_right expr="new FlxActionDigital(Action.RIGHT)"> + + new FlxActionDigital(Action.RIGHT) + + <_down expr="new FlxActionDigital(Action.DOWN)"> + + new FlxActionDigital(Action.DOWN) + + <_upP expr="new FlxActionDigital(Action.UP_P)"> + + new FlxActionDigital(Action.UP_P) + + <_leftP expr="new FlxActionDigital(Action.LEFT_P)"> + + new FlxActionDigital(Action.LEFT_P) + + <_rightP expr="new FlxActionDigital(Action.RIGHT_P)"> + + new FlxActionDigital(Action.RIGHT_P) + + <_downP expr="new FlxActionDigital(Action.DOWN_P)"> + + new FlxActionDigital(Action.DOWN_P) + + <_upR expr="new FlxActionDigital(Action.UP_R)"> + + new FlxActionDigital(Action.UP_R) + + <_leftR expr="new FlxActionDigital(Action.LEFT_R)"> + + new FlxActionDigital(Action.LEFT_R) + + <_rightR expr="new FlxActionDigital(Action.RIGHT_R)"> + + new FlxActionDigital(Action.RIGHT_R) + + <_downR expr="new FlxActionDigital(Action.DOWN_R)"> + + new FlxActionDigital(Action.DOWN_R) + + <_accept expr="new FlxActionDigital(Action.ACCEPT)"> + + new FlxActionDigital(Action.ACCEPT) + + <_back expr="new FlxActionDigital(Action.BACK)"> + + new FlxActionDigital(Action.BACK) + + <_pause expr="new FlxActionDigital(Action.PAUSE)"> + + new FlxActionDigital(Action.PAUSE) + + <_reset expr="new FlxActionDigital(Action.RESET)"> + + new FlxActionDigital(Action.RESET) + + <_cheat expr="new FlxActionDigital(Action.CHEAT)"> + + new FlxActionDigital(Action.CHEAT) + + + + + + + [] + + + + [] + + + + KeyboardScheme.None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Void)]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * Sets all actions that pertain to the binder to trigger when the supplied keys are used. + * If binder is a literal you can inline this + + + + + + + + * Sets all actions that pertain to the binder to trigger when the supplied keys are used. + * If binder is a literal you can inline this + + + + + + + + { reset : true } + + + + + + + + + + + + + + + + + + + + + + + + { deviceID : FlxInputDeviceID.ALL } + + + + + + + + + + + + + * Sets all actions that pertain to the binder to trigger when the supplied keys are used. + * If binder is a literal you can inline this + + + + + + + + + * Sets all actions that pertain to the binder to trigger when the supplied keys are used. + * If binder is a literal you can inline this + + + + + + + + + + + + + + + + + + { scheme : None } + + * A list of actions that a player would invoke via some input device. + * Uses FlxActions to funnel various inputs to a single action. + + @@ -81118,6 +81043,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -81316,11 +81266,15 @@ - + @@ -81415,6 +81369,127 @@ + + + + + 0.05 + + + + false + + + + 0 + + + + false + + + + "" + + <_finalText expr=""""> + + "" + + <_curText expr=""""> + + "" + + + + FlxG.width + + + + 1 + + + + + false + + + + false + + + + [] + + + + false + + + + + + "gf" + + + + + + + + + + + + + + + + { typed : false, bold : false, text : "" } + + * Loosley based on FlxTypeText lolol + + + + + + + "abcdefghijklmnopqrstuvwxyz" + + + + "1234567890" + + + + @[]^_.,'!?"]]> + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + @@ -212253,6 +212328,70 @@ + + + + * Triggered after the characters XML has been loaded. + + + + * Triggered after the character has been entirely loaded. + + + + + + + * Triggered every frame. + + + + + + + * Triggered everytime the character will dance (play its idle animation). + + + + + + + * Triggered every beat + + + + + + + * Triggered every step + + + + + + + * Triggered everytime the game tries to play an animation on your character. + + + + + + + * Triggered everytime the game tries to get your player's camera position. + * This event cannot be cancelled. + + + + + + + * Triggered everytime the game tries to play a sing, alt sing or miss animation. + + * Contains all callbacks you can add in a Character script. + * + * To add a Character script, create a file here: `data/characters/my-char.hx` + + @@ -212328,7 +212467,10 @@ * Contains all callbacks you can add in modcharts and stage scripts. * + * + * * NOTE: In case you're scripting a stage, all sprites of that stage are directly accessible via their name. + * * Ex: If you added a `superCoolBG` element in your stage XML, you'll be able to access it via scripts by using `superCoolBG`. diff --git a/source/funkin/game/Character.hx b/source/funkin/game/Character.hx index 69e56f6c..1d5d7b34 100644 --- a/source/funkin/game/Character.hx +++ b/source/funkin/game/Character.hx @@ -15,9 +15,12 @@ import flixel.math.FlxRect; import openfl.utils.Assets; import haxe.xml.Access; import haxe.Exception; +import haxe.io.Path; import funkin.system.Conductor; -import funkin.scripting.events.PlayAnimEvent; +import funkin.scripting.DummyScript; +import funkin.scripting.Script; +import funkin.scripting.events.*; import funkin.scripting.events.PlayAnimEvent.PlayAnimContext; using StringTools; @@ -48,17 +51,26 @@ class Character extends FlxSprite implements IBeatReceiver implements IOffsetCom public var cameraOffset:FlxPoint = new FlxPoint(0, 0); public var globalOffset:FlxPoint = new FlxPoint(0, 0); + public var script:Script; + public inline function getCameraPosition() { var midpoint = getMidpoint(); - return FlxPoint.get( + var event = new PointEvent( midpoint.x + (isPlayer ? -100 : 150) + globalOffset.x + cameraOffset.x, midpoint.y - 100 + globalOffset.y + cameraOffset.y); + script.call("onGetCamPos", [event]); + // this event cannot be cancelled + return new FlxPoint(event.x, event.y); + } - public function playSingAnim(direction:Int, suffix:String = "") { + public function playSingAnim(direction:Int, suffix:String = "", Reversed:Bool = false, Frame:Int = 0) { // TODO: Script Events var anims = ["singLEFT", "singDOWN", "singUP", "singRIGHT"]; - playAnim('${anims[direction]}$suffix', true); + + var event = new DirectionAnimEvent('${anims[direction]}$suffix', direction, suffix, Reversed, Frame); + script.call("onPlaySingAnim", [event]); + if (!event.cancelled) playAnim(event.animName, event.force, event.reversed, event.frame, SING); } public function new(x:Float, y:Float, ?character:String = "bf", ?isPlayer:Bool = false) @@ -78,12 +90,13 @@ class Character extends FlxSprite implements IBeatReceiver implements IOffsetCom // case 'your-char': // To hardcode characters default: // load xml - if (!Assets.exists(Paths.xml('characters/$curCharacter'))) { + var xmlPath = Paths.xml('characters/$curCharacter'); + if (!Assets.exists(xmlPath)) { curCharacter = "bf"; continue; } - var plainXML = Assets.getText(Paths.xml('characters/$curCharacter')); + var plainXML = Assets.getText(xmlPath); var character:Access; try { var charXML = Xml.parse(plainXML).firstElement(); @@ -109,9 +122,16 @@ class Character extends FlxSprite implements IBeatReceiver implements IOffsetCom for(anim in character.nodes.anim) { XMLUtil.addXMLAnimation(this, anim); } + + // Loads the script and calls it's "create" function + script = Script.create(Paths.script(Path.withoutExtension(xmlPath), null, true)); + script.setParent(this); + script.load(); + script.call("create"); } break; } + if (script == null) script = new DummyScript(curCharacter); /** NON CONVERTED CHARACTERS - DO NOT REMOVE @@ -244,7 +264,6 @@ class Character extends FlxSprite implements IBeatReceiver implements IOffsetCom // playAnim('idle'); // antialiasing = false; - dance(); isDanceLeftDanceRight = (animation.getByName("danceLeft") != null && animation.getByName("danceRight") != null); @@ -266,6 +285,8 @@ class Character extends FlxSprite implements IBeatReceiver implements IOffsetCom switchOffset('singLEFTmiss', 'singRIGHTmiss'); } if (isPlayer) flipX = !flipX; + dance(); + script.call("createPost"); } var isDanceLeftDanceRight:Bool = false; @@ -279,6 +300,7 @@ class Character extends FlxSprite implements IBeatReceiver implements IOffsetCom override function update(elapsed:Float) { super.update(elapsed); + script.call("update", [elapsed]); if (stunned) { __stunnedTime += elapsed; if (__stunnedTime > 5 / 60) @@ -295,6 +317,10 @@ class Character extends FlxSprite implements IBeatReceiver implements IOffsetCom { if (!debugMode) { + var event = new DanceEvent(danced); + script.call("onDance", [event]); + if (event.cancelled) return; + switch (curCharacter) { // hardcode custom dance animations here @@ -315,10 +341,12 @@ class Character extends FlxSprite implements IBeatReceiver implements IOffsetCom } public function beatHit(curBeat:Int) { + script.call("beatHit", [curBeat]); if ((lastHit + (Conductor.stepCrochet * holdTime) < Conductor.songPosition) || animation.curAnim == null || (!animation.curAnim.name.startsWith("sing") && animation.curAnim.finished)) dance(); } public function stepHit(curStep:Int) { + script.call("stepHit", [curStep]); // nothing } @@ -352,6 +380,7 @@ class Character extends FlxSprite implements IBeatReceiver implements IOffsetCom { var event = new PlayAnimEvent(AnimName, Force, Reversed, Frame); + script.call("onPlayAnim", [event]); // TODO: Character Scripts if (event.cancelled || event.animName == null) return; diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 44cd7db7..36807105 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -188,14 +188,20 @@ class PlayState extends MusicBeatState // Updating Discord Rich Presence. DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC); #end - - var gfVersion = SONG.gf; - if (gfVersion == null) gfVersion = "gf"; - gf = new Character(400, 130, gfVersion); - gf.scrollFactor.set(0.95, 0.95); - dad = new Character(100, 100, SONG.player2); + + if (dad != null && dad.isGF) { + dad.setPosition(400, 130); + gf = dad; + dad.scrollFactor.set(0.95, 0.95); + } else { + var gfVersion = SONG.gf; + if (gfVersion == null) gfVersion = "gf"; + gf = new Character(400, 130, gfVersion); + gf.scrollFactor.set(0.95, 0.95); + } + var camPos:FlxPoint = new FlxPoint(dad.getGraphicMidpoint().x, dad.getGraphicMidpoint().y); @@ -210,7 +216,6 @@ class PlayState extends MusicBeatState // case "": // ADD YOUR HARDCODED SCRIPTS HERE! default: - trace('charts/${SONG.song}/'); var content = Paths.getFolderContent('charts/${SONG.song}/', false, true, !fromMods); for(file in content) { var ext = Path.extension(file).toLowerCase(); diff --git a/source/funkin/game/Stage.hx b/source/funkin/game/Stage.hx index 484995c5..afe83379 100644 --- a/source/funkin/game/Stage.hx +++ b/source/funkin/game/Stage.hx @@ -109,6 +109,7 @@ class Stage extends FlxBasic implements IBeatReceiver { PlayState.instance.add(PlayState.instance.gf); PlayState.instance.gf; case "dad" | "opponent": + if (PlayState.instance.dad == null || PlayState.instance.dad.isGF) continue; doCharNodeShit(PlayState.instance.dad, node); PlayState.instance.add(PlayState.instance.dad); PlayState.instance.dad; diff --git a/source/funkin/scripting/events/DanceEvent.hx b/source/funkin/scripting/events/DanceEvent.hx new file mode 100644 index 00000000..f13ae7ef --- /dev/null +++ b/source/funkin/scripting/events/DanceEvent.hx @@ -0,0 +1,9 @@ +package funkin.scripting.events; + +class DanceEvent extends CancellableEvent { + public var danced:Bool; + public function new(danced:Bool = false) { + super(); + this.danced = danced; + } +} \ No newline at end of file diff --git a/source/funkin/scripting/events/DirectionAnimEvent.hx b/source/funkin/scripting/events/DirectionAnimEvent.hx new file mode 100644 index 00000000..20200a16 --- /dev/null +++ b/source/funkin/scripting/events/DirectionAnimEvent.hx @@ -0,0 +1,38 @@ +package funkin.scripting.events; + +class DirectionAnimEvent extends CancellableEvent { + /** + Default animation that will be played + **/ + public var animName:String; + /** + In which direction the animation will be played + **/ + public var direction:Int; + /** + The suffix of the animation (ex: "-alt") - Defaults to "" + **/ + public var suffix:String; + /** + Whenever the animation will play reversed or not. + **/ + public var reversed:Bool; + /** + Whenever the animation will play reversed or not. + **/ + public var force:Bool; + /** + At what frame the animation will start playing + **/ + public var frame:Int; + + public function new(animName:String, direction:Int, suffix:String = "", reversed:Bool = false, frame:Int = 0) { + super(); + this.animName = animName; + this.direction = direction; + this.suffix = suffix; + this.reversed = reversed; + this.force = true; + this.frame = frame; + } +} \ No newline at end of file diff --git a/source/funkin/scripting/events/PointEvent.hx b/source/funkin/scripting/events/PointEvent.hx new file mode 100644 index 00000000..5b8fe215 --- /dev/null +++ b/source/funkin/scripting/events/PointEvent.hx @@ -0,0 +1,17 @@ +package funkin.scripting.events; + +class PointEvent extends CancellableEvent { + /** + X position + **/ + public var x:Float; + /** + Y position + **/ + public var y:Float; + public function new(x:Float, y:Float) { + super(); + this.x = x; + this.y = y; + } +} \ No newline at end of file diff --git a/source/funkin/system/Paths.hx b/source/funkin/system/Paths.hx index 3a08dcef..1328e5ff 100644 --- a/source/funkin/system/Paths.hx +++ b/source/funkin/system/Paths.hx @@ -100,11 +100,11 @@ class Paths return getPath('images/$key.png', IMAGE, library); } - inline static public function script(key:String, ?library:String) { - var scriptPath = getPath(key, TEXT, library); + inline static public function script(key:String, ?library:String, isAssetsPath:Bool = false) { + var scriptPath = isAssetsPath ? key : getPath(key, TEXT, library); var p:String; for(ex in Script.scriptExtensions) { - p = getPath('$key.$ex', TEXT, library); + p = isAssetsPath ? '$key.$ex' : getPath('$key.$ex', TEXT, library); if (OpenFlAssets.exists(p)) { scriptPath = p; break; @@ -161,13 +161,11 @@ class Paths var libThing = new LimeLibrarySymbol(folderPath); var library = libThing.library; - trace(library); if (library is openfl.utils.AssetLibrary) { var lib = cast(libThing.library, openfl.utils.AssetLibrary); @:privateAccess if (lib.__proxy != null) library = lib.__proxy; } - trace(library); var content:Array = []; #if sys diff --git a/source/scripting/CharacterScript.hx b/source/scripting/CharacterScript.hx new file mode 100644 index 00000000..8db41d32 --- /dev/null +++ b/source/scripting/CharacterScript.hx @@ -0,0 +1,58 @@ +package scripting; + +import funkin.scripting.events.*; + +/** + * Contains all callbacks you can add in a Character script. + * + * To add a Character script, create a file here: `data/characters/my-char.hx` + */ +interface CharacterScript { + /** + * Triggered after the characters XML has been loaded. + */ + public function create():Void; + + /** + * Triggered after the character has been entirely loaded. + */ + public function createPost():Void; + + /** + * Triggered every frame. + */ + public function update(elapsed:Float):Void; + + /** + * Triggered everytime the character will dance (play its idle animation). + */ + public function onDance(event:DanceEvent):Void; + + /** + * Triggered every beat + */ + public function beatHit(curBeat:Int):Void; + + /** + * Triggered every step + */ + public function stepHit(curStep:Int):Void; + + /** + * Triggered everytime the game tries to play an animation on your character. + */ + public function onPlayAnim(event:PlayAnimEvent):Void; + + /** + * Triggered everytime the game tries to get your player's camera position. + * This event cannot be cancelled. + */ + public function onGetCamPos(event:PointEvent):Void; + + /** + * Triggered everytime the game tries to play a sing, alt sing or miss animation. + */ + public function onPlaySingAnim(event:DirectionAnimEvent):Void; + + +} \ No newline at end of file