betovar / caten

A web-based Settlers of Catan game using node.js
1 stars 0 forks source link

Resource Collecting #1

Open betovar opened 11 years ago

betovar commented 11 years ago

This is the second part of the roll-the-dice stage.

When a number is rolled, the server looks for settlements on the hexes (max 2 hexes). If a settlement or city is built on a node, the server will return the calculated resource payouts to the owner.

betovar commented 11 years ago

Settlements are built on a hex if the distance between settlement and hex is less equal to the radius or characteristic edge length plus some small epsilon.

betovar commented 11 years ago

Since the server tracks all cards, a player with a resource payout receives the cards to the hand object on the server. then the server re-emits each player's hand object on their own socket.