Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A tile can assign a unit to defend #15

Closed
Le5tes opened this issue Feb 1, 2018 · 1 comment
Closed

A tile can assign a unit to defend #15

Le5tes opened this issue Feb 1, 2018 · 1 comment

Comments

@Le5tes
Copy link
Owner

Le5tes commented Feb 1, 2018

As a player,
So that I can send an unwilling unit to defend my land,
A tile should randomly assign one of it's units as a defender when attacked.

@LarsFin
Copy link
Collaborator

LarsFin commented Feb 20, 2018

./models/tile.js

defend(mod = Math){
  	return (this.units[mod.floor(mod.random() * this.units.length)]);
  };

See ./spec/tileSpec.js "Tile#defend" for tests

@LarsFin LarsFin closed this as completed Feb 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants