Actually, screw polygons


After digging into it, I think the biggest performance hog is the Delaunay triangulation that Godot does when creating a new collision polygon. Since I re-initialize all polygons whenever a goal is reached, that gets really expensive really fast. Not amount of polygon simplification is going to fix that.

So I switched to using simple collision rectangles. The Godot docs itself encourages their use if they fit the object's shape, which Tetris blocks obviously do. This required some refactoring - many functions assumed polygons - but the speedup is massive!

The better players amongst you should be able to get much further without waiting for literal minutes for the goal reset :)

Files

export.zip Play in browser
1 day ago

Leave a comment

Log in with itch.io to leave a comment.