Hi Guys, Im writing a "Simple" text game in perl for learning purpose.
I have this problem. I want to create a timer that can do some background stuff like adding player hp / mana / anything but im not sure how to create it at this moment and don't know if this is the right part of code to execute subroutine for that. And main problem is that Heartbeat is execute only once.
This is the code snipped for reading player input.
while (1) {
Engine::doHeatbeat;
chomp (my $input = <STDIN>);
# Trim right / left white character
$input =~ s/^\s+|\s+$//g;
given ($input) {
Engine::Parser::Command($input);
}
}
The Heartbeat subroutine is at this moment dummy.. Its my first time here so sorry if i write the question wrong ;)