Click [+] to add pet. Click pet to gently move it into a loving home. Click the stage to gather pets and learn the meaning of "herding cats". Movement speed multiplier in speech bubble.
Demo of some code ideas for a dear friend: Wandering and movement speed. Movement speed is kind of complicated: You have to calculate the distance between the sprite's location and its destination, then divide that by the speed to get the time it should take. Distance between two points: sqrt( ((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)) ) The map is 480 x 360. That's a distance of max distance = sqrt(480*480 + 360*360) = 600 speed = distance/time So if crossing the map (distance = 600) at "normal" speed takes 1.5 seconds: normal speed = 600/1.5 = 400 (units/second) So my speed = 400 * "speed multiplier" If "x" and "y" are my destination, then how far do I have to go? distance = sqrt( ((x position - "x") * (x position - "x")) + ((y position - "y") * (y position - "y")) ) time = distance/speed so... glide ( sqrt( ((x position - "x") * (x position - "x")) + ((y position - "y") * (y position - "y")) ) / ( 400 * "move speed multiplier" ) ) to "x", "y"