Skip to content

Commit

Permalink
fix Nape tilemap for 5.9.0+ (#437)
Browse files Browse the repository at this point in the history
* fix Nape tilemap for 5.9.0+

* update ci
  • Loading branch information
Geokureli authored Jun 15, 2024
1 parent f76d8b2 commit cdeb0de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build:
strategy:
matrix:
haxe-version: ["4.2.5", "4.3.3"]
haxe-version: ["4.2.5", "4.3.4"]
target: [html5, hl, neko, flash, cpp]
fail-fast: false
runs-on: ubuntu-latest
Expand All @@ -29,9 +29,8 @@ jobs:
haxelib install haxelib 4.0.3
haxelib dev flixel-addons .
- uses: HaxeFlixel/setup-flixel@v1
- uses: HaxeFlixel/setup-flixel@master
with:
haxe-version: current
flixel-versions: dev
target: ${{matrix.target}}
run-tests: true
17 changes: 9 additions & 8 deletions flixel/addons/nape/FlxNapeTilemap.hx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package flixel.addons.nape;

import flixel.addons.nape.FlxNapeSpace;
import flixel.FlxG;
import flixel.addons.nape.FlxNapeSpace;
import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.system.FlxAssets;
import flixel.tile.FlxBaseTilemap;
import flixel.tile.FlxTilemap;
import flixel.util.FlxArrayUtil;
import flixel.tile.FlxBaseTilemap;
import flixel.system.FlxAssets;
import nape.geom.Vec2;
import nape.phys.Body;
import nape.phys.BodyType;
Expand Down Expand Up @@ -100,11 +100,12 @@ class FlxNapeTilemap extends FlxTilemap
var polygon:Polygon;
for (index in tileIndices)
{
var coords:Array<FlxPoint> = getTileCoords(index, false);
if (coords == null)
continue;

for (point in coords)
#if (flixel >= "5.9.0")
final points = getAllTilePos(index);
#else
final points = getTileCoords(index, false);
#end
for (point in points)
{
polygon = new Polygon(vertices, mat);
polygon.translate(Vec2.get(point.x, point.y));
Expand Down

0 comments on commit cdeb0de

Please sign in to comment.