Re: How to make my MOSR bounce? Energy ball!
well let's see... I'm not really sure if I have the right idea of how the ray functions work but I'd say run 2 CastStrengthRay's of (half your sprites width)+3 and make it skip all but the last pixel, in the direction depending on the velocity of the object (horizontal and vertical components, if positive X value then ray end pos = 10, if negative then -10). If the ray returns 1 then a terrain pixel was hit by the ray, if the X ray hit than reverse the X velocity and same with the Y.
see here for functions that you could use:
http://www.datarealms.com/wiki/index.ph ... eneManagerI wish data would give examples, But I think you'd use it like so:
if CastStrengthRay(ball.Pos, (halfballwidthaddthree,0), 0, unnecessaryvector, halfballwidthaddtwo, 0, 1) == 1 do something
startpos, vector position of the end of the ray(unsure), check for pixels of strength grater than value, a vector to store the location of the pixel that was found (unnecessary for what you want to do but it must still be there), how many pixels to skip, ID of another material you want to skip(other than air, 0/default material because you don't really want to skip any other materials), wrap around map if crosses a seam(1, you want this).