Wednesday, 28 October 2015

Day 31: Time is Money

I got the zombies to avoid each other.
Finally.
It took alot of searching, but I found this code to put into the zombie's collison event with itself:

if x>other.x
x+=1;
else if x<other.x
x-=1;

if y>other.y
y+=1;
else if y<other.y
y-=1;

That makes the zombies stay apart, and not bunch up into one mega zombie, which has been a problem for a long time now.

I also got some code to make a 24 hour clock, which is working very nicely. I had to modify it a slight bit to get it the way  I want it to look, but that was easy enough. Now all I need to do is sync the night cycle with the clock, and all will be good.

Tomorrow I will be working on a house sprite if I can't find anything to do. Right now I can't think of much else to work on, but we'll see what the day brings.

No comments:

Post a Comment