Nice idea.
It would seem to me that in order to do this properly, you'll need to pass a "last fed time" variable into flash and then when the user clicks feed me, update the database again with the "last fed time"
I don't know much about flash, but it seems to me it could be done easier with plain old php.
Just add a "last fed" timestamp in the user table and set everyone's to today's time (beause it will need to start with something)
Then if last fed was over X days ago (depending on what you want to set it for) display the dead pet image. If last fed was under X days ago, everything is okay.
I think instead of the pet being fed by clicking a button however, it should be based on when you last posted - in that case, you would not need to add anything to the database at all and could use the preexisting lastpost field (or lastvisit or lastactivity, depending on what you really want to do)
Then if your last post was over X days ago, it could display the dead graphic and if not, display the normal one.
|