Sheeps4k

The game got really slow from level 10 onwards - 2000, 2200 etc sheep!

At that point it got pretty easy to save the required 200+ sheep - the wolves just can’t kill 1800+ sheep fast enough, in fact the wolves were very helpful when you need to herd bigger bunches of sheep at a faster speed ;).

Once you have 1500+ sheep you can only herd them in small chunks unless you have have help from the wolves.

Nice game though, even though it got slow, I still continued playing :D.

Thanks i’m following some of those tips now, i have been intentionally away from eclipse for this seasons holidays, so there is no changes yet, but there will be.

[quote]Only thing that crosses my mind, though you’re probably already doing this, is to make sure you’re not drawing two circles for each sheep, and you’re just pasting a pregenerated image where needed. Java circles are pretty slow.
[/quote]
in fact i’m drawing the ovals each cicle, it’s slower, but it saves me some bytes from image variables and drawing the ovals into them for the first time, but i’ll maybe do so, and put something else than ovals for all the actors

[quote]do you really need more sheep?
[/quote]
i’m working in a litle gameplay twist (for the levels to make some sense, and to be a litle more playable) wich implies a limited number of sheeps :slight_smile: anyway implement a tree for the sheeps could be too mucho for the space remaining ;D

i have left that loop like this, for now


dist = ((sheep[i] - sheep[o]) * (sheep[i] - sheep[o]));
dy = ((sheep[i + 1] - sheep[o + 1]) * (sheep[i + 1] - sheep[o + 1]));
if ((dist + dy) < (SHEEP_VIEW_RANGE * SHEEP_VIEW_RANGE)) {
num_on_range++;
dist = (float) Math.sqrt(dist + dy) + 0.1f;

thanks alot