in other words if I want to define a variable called - timer?
timer ||= 300
say i have a sprite randomly appearing on the screen and moving to a different location after timer == 300 (5 seconds)
#move sprite to a random location after 5 seconds
if args.game.tick_count % 300 == 0
args.game.x = rand * 1279
args.game.y = rand * 719
end
this seems to do what is expect move the sprite after 5 seconds to a random position but i want to do this:
#move sprite to a random location after 5 seconds
if args.game.tick_count % timer == 0
args.game.x = rand * 1279
args.game.y = rand * 719
end
so when you click the sprite it increasingly gets harder by decreasing the time (moves faster each time you click the mouse)
I hope you get what I am trying to say here. lol
oh BTW when you recieve an error it doesn't make any sense at all (doesn't point to the line where the error occured) it's some random stuff that makes no sense whatsover in the console. this really needs proper error handling.