You are not logged in.
hello guys,im new in wii programming.i have managed to project some images and a png control with the wii remote on the 'game' but the last think left to do is the collision thing.I cannot figure out what could i do in order to check if the png file controller by wii remote collides with an projected,any help is appreciated
Offline
Maybe those simple collision functions will work for you:
GRRLIB_PtInRect
GRRLIB_RectInRect
GRRLIB_RectOnRect
Offline
thank you for your reply but,i dont think that these functions can help me.I need to find the exaclty x,y coordinates of my image which is randomly created with the function rand().and also there is no command like target.x or target_x (target is the texture)
Offline
If you generate the coordinates why don't you keep them in memory
Offline
i have thought of doing that,i will give it a try and then i will tell u the result
Offline
If you need information about the GRRLIB_texImg structure: http://grrlib.santo.fr/doc/struct_g_r_r … x_img.html
Offline
thank y but i dont think that i can manage to deal with rectonrect function,is there any function like if pic.bounces.interceptswith(pic2.bounce)then (visual basic)
Offline
Look at the code in the basic_drawing example folder. Check the code where Link is moving over a rupee.
Offline
my code is based on this example but it uses rectonrect function this one"(GRRLIB_RectOnRect(320+left, 240+top, 48, 64, 618, 434, 12, 30))"
Offline
something last,how can i get x,y-coordinate of the upper-left corner of the rectangle.
Offline
It's so easy to do something like this:
static int CoordX = 0;
static int CoordY = 0;
...
CoordX = 22; // Random value
CoordY = 44; // Random value
GRRLIB_DrawImg(CoordX, CoordY, MyTexture, 0, 1, 1, 0xFFFFFFFF);
...
GRRLIB_RectOnRect using CoordX and CoordY...
Offline
crayon thanks a lot !!!!u have solved my issue !!!!!!!!!!!!!!!!!!!!!!!!!
Offline