Following a path...
BlitzMax Forums/BlitzMax Beginners Area/Following a path...
| ||
Hi guys, I'm interested in trying to make a 'shoot the gems' kind of game. What I need help on is the concept of making the gems follow a pre-determined path? Thanks heaps! Cheers, Sam |
| ||
You could make the path out of points (x,y) and store each path in a separate file then load them into Types. |
| ||
You could also draw the path into a special map and then follow it pixel by pixel. The other one is: mark certain points as base-path and connect them using bezier-curves - so you avoid a big bunch of points to make a nice curve-movement. bye MB |
| ||
But how important is that big bunch anno 2007/2008? If one path has 1024 points (512 x and 512 y), then a whopping 1024 of those paths will only cost 1MB when using bytes or 2MB using shorts .. |
| ||
if you say: point1: 10,10 point2: 11,11 then you missed more than a dozen of fractional points between - else (adding more points) you will not have only 1000 pathpoints. Using bezier curves you are able to get each point you are interested in and so you also remove jagging when eg. rotating a ball around the curve. bye MB |
| ||
Why not use vectors? i was wondering about the same thing so i cooked up this example. Note: if you dont need turning, you can remove the heavy duty math thingy, and replace DirX/Y with dx/dy. |