Okey, got it working!

Code:
var vVelocity[3]; //Ball speed vector!
var vBounce[3]; //Bounce vectro that gets copied to vVelocity

var a;

//normal vectors of edges
var nvec_minx[3] = {1, 0, 0 };
var nvec_maxx[3] = {-1, 0, 0 };
//=======================================================
         // b = 2*|<c,n>|*n + c  Bounce vector's formula.
         /*
         a = 2*abs(vec_dot(c, n));
         vec_set(c, vector(a*n[0], a*n[1],0));
         vec_add(c, c);
         */

//nvec_maxx = vec_normalize(nvec_maxx,1);
a = 2*abs(vec_dot(vVelocity, nvec_maxx));
vec_set(vBounce, vector(a*nvec_maxx[0], a*nvec_maxx[1],0));
vec_add(vVelocity, vBounce);



does basically all the magic and it works. The issue I had with the moving was that my previous vector had wrong values. Sometimes it had speed values and sometimes it had coordinates stored in it.

So I needed to have a vector that stores speed values only! And then changing panel's position according to it. So this is my solution.

Edit: Although I have seen now that when ball gets in some steep angle or smth it suddenly amplifies it's speed and does wierd stuff. So the calculation isn't always perfect though...
vec_bounce() dind't give the same result as rewritten formula...

Thanks Joey!

Last edited by Crypton; 11/18/09 20:32. Reason: after some test time

New into Gamestudio and eager to learn it..
Stuff and games done in 2D: LINK