summary refs log tree commit diff stats
BranchCommit messageAuthorAge
masterremove remote registry list push to leveldb because that doesn't work right nowBenjamin Morrison3 years
 
TagDownloadAuthorAge
v0.5.0getwtxt-0.5.0.tar.gz  Benjamin Morrison3 years
v0.4.15getwtxt-0.4.15.tar.gz  Ben Morrison5 years
v0.4.14getwtxt-0.4.14.tar.gz  Ben Morrison5 years
v0.4.13getwtxt-0.4.13.tar.gz  Ben Morrison5 years
v0.4.12getwtxt-0.4.12.tar.gz  Ben Morrison5 years
v0.4.11getwtxt-0.4.11.tar.gz  Ben Morrison5 years
v0.4.10getwtxt-0.4.10.tar.gz  Ben Morrison5 years
v0.4.9getwtxt-0.4.9.tar.gz  Ben Morrison5 years
v0.4.8getwtxt-0.4.8.tar.gz  Ben Morrison5 years
v0.4.7getwtxt-0.4.7.tar.gz  Ben Morrison5 years
v0.4.6getwtxt-0.4.6.tar.gz  Ben Morrison5 years
v0.4.5getwtxt-0.4.5.tar.gz  Ben Morrison5 years
v0.4.4getwtxt-0.4.4.tar.gz  Ben Morrison6 years
v0.4.3getwtxt-0.4.3.tar.gz  Ben Morrison6 years
v0.4.2getwtxt-0.4.2.tar.gz  Ben Morrison6 years
v0.4.1getwtxt-0.4.1.tar.gz  Ben Morrison6 years
v0.4.0getwtxt-0.4.0.tar.gz  Ben Morrison6 years
v0.3.3getwtxt-0.3.3.tar.gz  Ben Morrison6 years
v0.3.2getwtxt-0.3.2.tar.gz  Ben Morrison6 years
v0.3.1getwtxt-0.3.1.tar.gz  Ben Morrison6 years
v0.3.0getwtxt-0.3.0.tar.gz  Ben Morrison6 years
v0.2.4getwtxt-0.2.4.tar.gz  Ben Morrison6 years
v0.2.3getwtxt-0.2.3.tar.gz  Ben Morrison6 years
v0.2.2getwtxt-0.2.2.tar.gz  Ben Morrison6 years
v0.2.1getwtxt-0.2.1.tar.gz  Ben Morrison6 years
v0.2.0getwtxt-0.2.0.tar.gz  Ben Morrison6 years
v0.1.1getwtxt-0.1.1.tar.gz  Ben Morrison6 years
v0.1getwtxt-0.1.tar.gz  Ben Morrison6 years
span class="nx">TYPES: { COIN: { name: 'Coin', color: '#FFD700', size: 0.2 // Size relative to hex }, GEM: { name: 'Gem', color: '#50C878', size: 0.25 } }, // Initialize items on the map init() { this.items.clear(); // Add some random items for (let i = 0; i < 10; i++) { const q = Math.floor(Math.random() * HexGrid.GRID_SIZE - HexGrid.GRID_SIZE/2); const r = Math.floor(Math.random() * HexGrid.GRID_SIZE - HexGrid.GRID_SIZE/2); // Don't place items at player start position if (q !== 0 || r !== 0) { const type = Math.random() < 0.5 ? this.TYPES.COIN : this.TYPES.GEM; this.addItem(q, r, type); } } }, // Add an item to the map addItem(q, r, type) { this.items.set(`${q},${r}`, { type, q, r }); }, // Remove an item from the map removeItem(q, r) { return this.items.delete(`${q},${r}`); }, // Get item at position getItem(q, r) { return this.items.get(`${q},${r}`); }, // Draw all items draw(ctx, hexToPixel, camera, HEX_SIZE) { this.items.forEach(item => { const pixelPos = hexToPixel({ q: item.q, r: item.r }); const screenX = pixelPos.x - camera.x; const screenY = pixelPos.y - camera.y; ctx.fillStyle = item.type.color; ctx.beginPath(); ctx.arc(screenX, screenY, HEX_SIZE * item.type.size, 0, Math.PI * 2); ctx.fill(); }); } };