Today we also created wrote some script in order to control the behaviour of Annie in accordance to the time. At the moment it is working between the hours of 19:00 and 0:00 this is the period which at the moment, annie sleeps in. Therefore she is unable to be fed. Also when Annie is sleeping she acquires a lower alpha level.
Code:
timedate = new Date();
var clockH = timedate.getHours();
var clockM = timedate.getMinutes();trace(clockH);
if (clockH >= 19 and clockH <= 23){
speed = 0;
happiness = 50;
_root.cell._alpha=20;
}
OK…you can see how easy it was to influence this behaviour with this small piece of code, but then again this is only from an hours point of view. Soon we wish to be able to provide more detail of sleep patterns by using minutes and even seconds to control her. Also when she wakes back up again her happiness level returns to a neutral state, much like when we up and feel a lot calmer than when we went to bed (in most cases).
When we get the minutes working they will influence Annie’s eating patterns that she decides herself! After a period of 10 minutes if she hasn’t been fed she will become a little adventurous and go out searching for food, and by ‘go out’ i mean go into her previously typed email entries and scoff on some of those. She will not gain any happiness from this as she is doing it herself (lazy) but it will keep her alive that little bit longer.