- Fenton the dog runs after the mouse pointer. He runs slower when he is nearer the mouse.
- The sheep run away from Fenton. Sheep run slower when Fenton is further away.
- The speed and direction of Fenton and the sheep is calculated using vector math
- The sheep go slower when Fenton is further by using inverse proportion
- Sprites are placed using semantic DOM elements such as
<sheep>
. Use CSS to style the sprite. - Sprites are animated with CSS transform in a simple game loop.
- Open index.html in localhost
- Install Typescript
npm install -g typescript
- Transpile the code in watch mode by typing
tsc -w
in the terminal