Hello all ,
I have try to understand Bresenham's line algorithm and how can use it in Tiled 2d game.
It's just "Bresenham's line algorithm" in love, useful for make TileMap Editor , Line of Sight for Ai , Path and other !
Very useful because we know the point of the line
Mouse Left for place a point and Mouse right for undo.
By
Bresenham's line algorithm
Bresenham's line algorithm
- Attachments
-
- Bresenham's line algorithm.love
- (791 Bytes) Downloaded 325 times
Re: Bresenham's line algorithm
Very cool. I remembering trying to do this inside of Minecraft using redstone...it never worked out.
Re: Bresenham's line algorithm
Great example. I learned Bresenham's algorithm when I was working on a word search game. The lettergrid allows you to drag and select words going up/down/left/right and diagonals:
Code (scroll down to pointsBetween) :
https://github.com/GloryFish/Experiment ... ergrid.lua
Code (scroll down to pointsBetween) :
https://github.com/GloryFish/Experiment ... ergrid.lua
Who is online
Users browsing this forum: Semrush [Bot] and 3 guests