Line tracing (I think)

how do you make an object trace a line on its path ( I guess I should call it path tracing)
like in missile command I tried for hours nothing worked.

Do you want path finding?

If so, there is a built-in “dumb” version:
(which doesn’t follow around walls)

There is an extension for A*, a path finding algorithm that works with the walls in a tilemap. Warning: On big tilemaps with long distances and lots of walls, it can be slow.

Self-promotion: You can find lots of Arcade extensions like the one above at my website, Awesome Arcade Extensions.

1 Like

You could draw lines from the sprite’s current location to its location a set time (idk 1 second) ago. Set an x and y variable and just update them every second so that when you need to read information from them you will have the position the sprite was at 1 second ago and you can easily get the sprites current location.

yeah that Would work but if you watch missile command gameplay the pixel get drawn every time the missile moves how would I do that

As @UnsignedArduino said, the A* extension can find a shortest path between two locations.

Actually, this extension also exposed following path feature, not only the shortest one found, but also any path consis of path waypoints(an arrray of locations). Call this directly with your waypoints maybe your solution I guess.


1 Like

thank you that worked I’m dumb sorry.
thank you bye the way

Just to chime in, it’s not dumb to not know something (especially if it’s some weird math thing or whether a program exists or not) – there’s an infinite amount of things to learn out there, not knowing one of them isn’t ever a big deal :slight_smile:.

image of xkcd "Ten Thousand" comic image


More self promotion: I’ve also made an extension that allows you to use joey’s pathing extension between locations on a tilemap, similar to what AqeeAqee said. This is good for games with a predetermined path.

Don’t manually place walls to make your A-star paths do what you want, use this! You can set a sprite to follow a path between tilemap locations and have handlers when they finish. Note that everytime you set a path, it will recalculate the paths using the A-star extension which can take a long time depending on how big the tilemap is and how many elements there are. This extension adds a TilemapPath category.

1 Like

Do you want a visible trail or pathfinding?

a visible trail

1 Like