JSJitsu / ai-battle-engine

Engine for powering the game logic.
https://jsfight.club
9 stars 8 forks source link

Allow maps to have spawn points #12

Closed Asuza closed 6 years ago

Asuza commented 7 years ago

Currently, players are placed in random locations on the map. Continue to allow this (see https://github.com/JSJitsu/ai-battle-engine/blob/672fd5bdeb1503bc4063aebda2e88eacec3cf87e/index.js#L166) but also allow maps to contain an indicator that a specific block is a spawn point.

For example, if a map looked like this:

S1|  |  |  |S2
S1|  |IM|  |S2
S1|  |IM|  |S2
S1|  |  |  |S2

The engine should put team 1 players into S1 tiles, and team 2 players into S2 tiles. SP should place a player from any team in that tile.

If a map that gets loaded contains any spawn points, then the engine should not randomly place any players. There should also be a safety check that there are enough spawn points for all players, and if not, log an error and fall back to random placement.

himanshujariyal commented 7 years ago

@Asuza I'd like to work on this feature.

Asuza commented 7 years ago

Thanks, @himanshujariyal. Let me know if you have any questions.

Asuza commented 6 years ago

This is still a valid Hacktoberfest issue, as it was never completely finished. Feel free to either start from scratch or use the existing PR from @himanshujariyal.

redice44 commented 6 years ago

I'll take a crack at it this year. 😄

redice44 commented 6 years ago

@Asuza PR is up for this issue 😄 Please take a look and let me know what you think 👍

Asuza commented 6 years ago

Enhanced via #26. Thanks, @redice44!