I've made a very rough herding game.
I have the dog that herds the sheep which is the player and an enemy (the hawk) that eats the sheep.
Currently when the hawk hits the sheep the lives decrease as long as the two are intersecting (which is often for quite a while). I need the lives to only descrease by 1 when the hawk and sheep intersect. I would also like if the sheep disappeared when this happened but one thing at a timre.
this is the specific area in the code where it happens:
here's a link to the .zip file of my code:
http://www.auriceye.com/outline10.zip
I have the dog that herds the sheep which is the player and an enemy (the hawk) that eats the sheep.
Currently when the hawk hits the sheep the lives decrease as long as the two are intersecting (which is often for quite a while). I need the lives to only descrease by 1 when the hawk and sheep intersect. I would also like if the sheep disappeared when this happened but one thing at a timre.
this is the specific area in the code where it happens:
- if ( intersectv(enemy.hawkpos, enemy.d, sheep[i].pos, sheep[i].d) == true ) {
// background(100, 0, 0);
lives--;
// freeLife.active = false;
}
here's a link to the .zip file of my code:
http://www.auriceye.com/outline10.zip
1