collect mosquito / bugs / etc from grass tiles ??
bug catching item
drop bugs to distract / attract bats
Certainly! Below is an outline and a GitHub issue template for adding mosquito ray, bug collection, bug catching item, and the ability to drop bugs to distract/attract bats.
GitHub Issue Template
Title: Add Mosquito Ray #3, Bug Collection, Bug Catching Item, and Bug Distraction/Attraction Mechanics
Description:
Enhance the game with new features to add more depth and strategy, including a new enemy type (Mosquito Ray), mechanics for collecting bugs from grass tiles, a bug catching item, and the ability to drop bugs to distract or attract bats.
Steps to Complete:
Add Mosquito Ray #3:
Create a new enemy type (Mosquito Ray):
Define the Mosquito Ray entity with unique properties and behaviors.
Implement movement and attack logic for the Mosquito Ray similar to the bat but with its own patterns.
/**
* Moves in random direction
*/
moveMosquitoRay = (mosquitoRay) => {
const { x, y } = mosquitoRay;
const directions = randomSort([
Direction.UP_LEFT,
Direction.LEFT,
Direction.DOWN_LEFT,
Direction.DOWN_RIGHT,
Direction.RIGHT,
Direction.UP_RIGHT,
]);
for (const direction of directions) {
const delta = getHexGridDelta(y, direction);
if (this.canMoveNPC(x, y, delta.x, delta.y)) {
return {
...mosquitoRay,
x: mosquitoRay.x + delta.x,
y: mosquitoRay.y + delta.y,
};
}
}
console.warn("Mosquito Ray is stuck", mosquitoRay);
return mosquitoRay;
}
Collect Bugs from Grass Tiles:
Modify existing grass tile interactions:
Update the tile interaction logic to allow for bug collection.
case GRASS_TILE.key:
if (this.hasBugCatchingItem()) {
this.collectItem(BUG_ITEM.key, playerX, playerY);
}
break;
Bug Catching Item:
Add a new item for bug catching:
Define a bug catching net or similar item.
Implement logic to check if the player has the bug catching item.
Allow the player to drop bugs from their inventory.
Implement logic to make bats move towards or away from the dropped bugs.
dropBug = (x, y) => {
if (this.state.inventory.includes(BUG_ITEM.key)) {
this.state.inventory = this.state.inventory.filter(item => item !== BUG_ITEM.key);
this.spawnBugAt(x, y);
}
}
spawnBugAt = (x, y) => {
this.state.bugs.push({ x, y });
this.attractBats(x, y);
}
attractBats = (x, y) => {
this.state.bats.forEach(bat => {
if (Math.abs(bat.x - x) + Math.abs(bat.y - y) < BAT_ATTRACTION_RADIUS) {
// logic to move bat towards the bug
}
});
}
Additional Code Examples:
Define Bug Item:
const BUG_ITEM = {
key: 'bug',
name: 'Bug',
description: 'A small bug caught from grass tiles.'
};
const BUG_CATCHING_ITEM = {
key: 'bug_net',
name: 'Bug Net',
description: 'A net used for catching bugs.'
};
collect mosquito / bugs / etc from grass tiles ?? bug catching item drop bugs to distract / attract bats
Certainly! Below is an outline and a GitHub issue template for adding mosquito ray, bug collection, bug catching item, and the ability to drop bugs to distract/attract bats.
GitHub Issue Template
Title: Add Mosquito Ray #3, Bug Collection, Bug Catching Item, and Bug Distraction/Attraction Mechanics
Description: Enhance the game with new features to add more depth and strategy, including a new enemy type (Mosquito Ray), mechanics for collecting bugs from grass tiles, a bug catching item, and the ability to drop bugs to distract or attract bats.
Steps to Complete:
Add Mosquito Ray #3:
Create a new enemy type (Mosquito Ray):
Collect Bugs from Grass Tiles:
Modify existing grass tile interactions:
Bug Catching Item:
Add a new item for bug catching:
Drop Bugs to Distract/Attract Bats:
Implement mechanics for dropping bugs:
Additional Code Examples:
Define Bug Item:
Update Inventory Management:
References:
moveBat
function for reference on how NPC movement is handled.afterMove
function to understand how player actions trigger various game events.Feel free to modify this template and outline as needed to better fit your project's needs and coding standards.