[AS3] Virtual Pet Game

Hello Kongregate! I want to do a virtual pet game, all good. But i want this game was like in realtime or something like that. In my mind i was planning do this:
create 3 vars: hours, minutes and seconds that will say, well obviously hours,minutes and seconds. Ok, the game will autosave before you leave and when you come back, the script will compare the hour you left and the hour you came. Already compared, the hungry of you pet will descrease. Example: You left the game at 10:30:51 with 0 Hungry, and you come back at 12:08:43 watching that your Pet’s hungry is.. 5. Now… is this a good way to do a “realtime” pet game or is there another way?

Sorry for my bad English and i hope this explanation is understandable.

That is very possible and you seem to have understood the necessary mechanics quite well, but I would recommend you start with something simpler just to get a better hang on things, something like Pong, Breakout or Pacman.

It will work, but do you really want to do the idea? Players might not like the idea of real time waiting. Anyway, just make sure to compare time basing on some time server, not the computer time else players will cheat.

...
//When the game is loaded
NetTime.addEventListener(NetTime.TIME_UPDATED, handleTime);
...
private function handleTime(e:Event):void{
//Get current time
var currentTime:Date = NetTime.getDate();
//Update based on time
...
}

I agree with Drakim. And I see an other problem with the system, dépending in how you implement it.

In your example, the hunger increase by 5 in 2 hours. What will append if the player let the game open, and watch a movie? Or is connect long enough for the hunger bar to change state? It must be cumulate with an internal clock during the connexion to work correctly, if you have not already implement it.

In all case, good luck for your game, and don’t hesitate to share the solution you choose in the end.

I think there should be a sim game made for people that like to control other people or just like sim ordinary games. like virtual families game or something like that . NO JAVA NO UNITY OR ANYTHINGLIKETHATFORPEOPLETHATDONTHAVETHAT!!!! you can reproduce to make other people . attract a man . buy a house . go to work . ordinary things in life . no real time like fish tycoon .

Hey, do you like games? So do we — that’s what makes Kongregate the best source of free games online. We have thousands upon thousands of free online games, from both one-man indies and large studios, rated and filtered so you can play the best of the best. Read more »