Skip to content

Commit

Permalink
release 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli committed May 1, 2024
1 parent 217d9d7 commit f546d22
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 15 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
3.2.0 (May 1, 2024)
- `FlxGameOfLife`: New demo! ([#342](https://github.com/HaxeFlixel/flixel-demos/pull/342))
- `FlxLightPuzzle`: Bigger screen size ([#328](https://github.com/HaxeFlixel/flixel-demos/pull/328))
- Compatibility with Flixel 6.0 dev branch ([#331](https://github.com/HaxeFlixel/flixel-demos/pull/331))
- `PostProcess`: Removed demo ([#332](https://github.com/HaxeFlixel/flixel-demos/pull/332))
- `MinimalistTD`: Change `Int` args to `FlxButtonState` ([#333](https://github.com/HaxeFlixel/flixel-demos/pull/333))
- Compatibility with Flixel 5.7 ([#334](https://github.com/HaxeFlixel/flixel-demos/pull/334))
- `FlxInvaders`: Add sound and music ([#335](https://github.com/HaxeFlixel/flixel-demos/pull/335))
- `FlxSubstate`: renamed from `SubState` ([#339](https://github.com/HaxeFlixel/flixel-demos/pull/339))
- `FlxAsepriteUtil`: renamed from `FlxAsepriteUtils` ([#347](https://github.com/HaxeFlixel/flixel-demos/pull/347))
- `FlxFilterFrames`: fixed rotation and offsets ([#349](https://github.com/HaxeFlixel/flixel-demos/pull/349))
- Remove .hxproj files

3.1.0 (November 3, 2023)
------------------------------
- `FlxFSM`:fix jump after superjump pickup, add groundpound pickup ([#323](https://github.com/HaxeFlixel/flixel-demos/pull/323))
- `FlxFSM`: fix jump after superjump pickup, add groundpound pickup ([#323](https://github.com/HaxeFlixel/flixel-demos/pull/323))
- `FlxCamera`: Various changes ([#324](https://github.com/HaxeFlixel/flixel-demos/pull/324))
- add gamepad controls
- dynamic level sizing
Expand Down
6 changes: 6 additions & 0 deletions Effects/FlxSpriteFilters/source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -163,22 +163,27 @@ class PlayState extends FlxState
}
if (isAnimSpr2)
{
spr2.angle += 45 * elapsed;
updateFilter(spr2, spr2Filter);
}
if (isAnimSpr3)
{
spr3.angle += 45 * elapsed;
updateFilter(spr3, spr3Filter);
}
if (isAnimSpr4)
{
spr4.angle += 45 * elapsed;
updateDropShadowFilter(elapsed);
}
if (isAnimSpr5)
{
spr5.angle += 45 * elapsed;
updateFilter(spr5, spr5Filter);
}
if (isAnimSpr6)
{
spr6.angle += 45 * elapsed;
updateDisplaceFilter();
}
}
Expand All @@ -200,6 +205,7 @@ class PlayState extends FlxState

function updateFilter(spr:FlxSprite, sprFilter:FlxFilterFrames)
{
// spr.offset.set();
sprFilter.applyToSprite(spr, false, true);
}
}
18 changes: 11 additions & 7 deletions Features/Pathfinding/source/BigMoverPathfinder.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,20 @@ class BigMoverPathfinder extends FlxDiagonalPathfinder
(heightInTiles - 1) / 2 * map.height / map.heightInTiles
);
// offset to center of top-left tile
var startIndex = map.getTileIndexByCoords(FlxPoint.weak(start.x - offset.x, start.y - offset.y));
var endIndex = map.getTileIndexByCoords(FlxPoint.weak(end.x - offset.x, end.y - offset.y));
final startIndex = map.getTileIndexByCoords(FlxPoint.weak(start.x - offset.x, start.y - offset.y));
final endIndex = map.getTileIndexByCoords(FlxPoint.weak(end.x - offset.x, end.y - offset.y));
offset.put();

var data = createData(map, startIndex, endIndex);
var indices = findPathIndicesHelper(data);
final data = createData(map, startIndex, endIndex);
final indices = findPathIndicesHelper(data);
if (indices == null)
{
start.putWeak();
end.putWeak();
return null;
}

var path = getPathPointsFromIndices(data, indices);
final path = getPathPointsFromIndices(data, indices);

// Reset the start and end points to be exact
path[0].copyFrom(start);
Expand All @@ -45,14 +50,13 @@ class BigMoverPathfinder extends FlxDiagonalPathfinder

start.putWeak();
end.putWeak();
offset.put();

return path;
}

override function getPathPointsFromIndices(data:FlxPathfinderData, indices:Array<Int>):Array<FlxPoint>
{
var path = super.getPathPointsFromIndices(data, indices);
final path = super.getPathPointsFromIndices(data, indices);
final offset = FlxPoint.get(
(widthInTiles - 1) / 2 * data.map.width / data.map.widthInTiles,
(heightInTiles - 1) / 2 * data.map.height / data.map.heightInTiles
Expand Down
11 changes: 6 additions & 5 deletions Features/Pathfinding/source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import flixel.text.FlxText;
import flixel.tile.FlxTilemap;
import flixel.ui.FlxButton;
import flixel.util.FlxColor;

// import openfl.Assets;

class PlayState extends FlxState
Expand Down Expand Up @@ -257,7 +258,7 @@ class PlayState extends FlxState
// Check mouse pressed and unit action
if (FlxG.mouse.pressed)
{
var index = map.getTileIndexByCoords(FlxG.mouse.getWorldPosition());
var index = map.getTileIndexByCoords(FlxG.mouse.getWorldPosition(FlxPoint.weak()));
if (index != -1)
{
var tileEmpty = map.getTileByIndex(index) == 0;
Expand Down Expand Up @@ -303,17 +304,17 @@ class PlayState extends FlxState
{
// Find path to goal from unit to goal
pathfinder.diagonalPolicy = diagonalPolicy;
var pathPoints:Array<FlxPoint> = pathfinder.findPath(
final pathPoints:Array<FlxPoint> = pathfinder.findPath(
cast map,
FlxPoint.get(unit.x + unit.width / 2, unit.y + unit.height / 2),
FlxPoint.get(goal.x + goal.width / 2, goal.y + goal.height / 2),
FlxPoint.weak(unit.x + unit.width / 2, unit.y + unit.height / 2),
FlxPoint.weak(goal.x + goal.width / 2, goal.y + goal.height / 2),
simplify
);

// Tell unit to follow path
if (pathPoints != null)
{
unit.path.start(pathPoints);
unit.path.start(pathPoints, 100.0, FORWARD, false, true);
action = GO;
instructions.text = INSTRUCTIONS;
}
Expand Down
4 changes: 2 additions & 2 deletions haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"license": "MIT",
"tags": ["game", "openfl", "flash", "neko", "cpp", "android", "ios", "demo", "cross"],
"description": "Demo Projects for HaxeFlixel",
"version": "3.1.0",
"releasenote": "New FlxAsepriteUtils demo",
"version": "3.2.0",
"releasenote": "New FlxGameOfLife demo",
"contributors": ["haxeflixel", "Gama11", "GeoKureli"],
"dependencies": {}
}

0 comments on commit f546d22

Please sign in to comment.