jwunderl / arcade-tilemap-a-star Goto Github PK
View Code? Open in Web Editor NEWa star implementation for tilemaps in pxt-arcade ---beta
Home Page: https://jwunderl.github.io/arcade-tilemap-a-star/
License: MIT License
a star implementation for tilemaps in pxt-arcade ---beta
Home Page: https://jwunderl.github.io/arcade-tilemap-a-star/
License: MIT License
From @darzu :
cooperative pathing: when several sprites of a destination with overlapping paths, they figure out how to move aside or pause to each other pass (hard problem; also we don’t generally have sprite “bumping” physics)
From @jwunderl :
I’m imagining we could even do something cute like make it so sprites follow on the side of the path if they’re not tile size, so you could have roads that little 8x8 cars could drive in both directions on, that would be an adorable little city building game
I’m imagining we could even do something cute like make it so sprites follow on the side of the path if they’re not tile size, so you could have roads that little 8x8 cars could drive in both directions on, that would be an adorable little city building game
From @riknoll:
https://github.com/riknoll/arcade-level-design-game/blob/master/enemy.ts#L214
the code is pretty simple, it just recalculates the paths in a background fiber. I trigger it whenever the target sprite moves outside of a given range (30 pixels in my case). Would definitely need to be tested on hardware because I expect a large tilemap or a lot of followers at the same time will be pretty slow. That might be fine though
similar to #11, but only triggers a single time after the player has passed the given value
From @jwunderl:
we could do a starting implementation by just returning a getter for the sprites currentIndex / path length?
Either by saying "follow a null or empty path", or some explicit API for this.
Imagine a block that takes an x,y coordinate and returns the nearest x,y on the a-star path. This would be useful for things like constraining a sprite to the nearest point on a path.
From @riknoll:
It would be awesome to have some sort of built-in behavior that stops the enemies from overlapping at their destinations. I think that’s never really desirable in the follow scenario.
Errr… I guess it is desirable if one sprite is chasing another. Would be a great option though!
A global event handler to know when a sprite finishes following a path.
I think it’d be neat if pathing could specify a set of tiles types that sprites could use (e.g. road tiles), instead of just “anything but walls”.
Essentially a “whitelist” of valid tiles (e.g. roads) instead of a “blacklist” of tiles to avoid (e.g. walls).
This decoupling with walls could be nice, because walls are used for many reasons. In one of my games I temporarily set a bunch of a walls, do the pathing, then unset those wall locations just so I can get pathing to work how I want.
Since this is not specific to arcade, we should make sure this data structure works in microbit too. Maybe rename to
pxt-heap
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.