hello!
I’m french, so my english will not be perfect
I make a game with Java and its API Java2D. With this, I rotate my objects, a bullet _ which must take a direction so as to its head is toward the target_ . I use this way:
c.rotate(rt, cent_X, cent_Y);
c.drawRect(X_MIN, Y_MIN, X_MAX, Y_MAX); // it's a rectangle for checking
c.drawImage(img,
//possition/placement de l'image:
pos_X,pos_Y,
pos_X+largeur,pos_Y+hauteur,
//choix de la sous-image:
f_base,0,
(saut_pixel+f_base),hauteur,null);
c.rotate(-rt, cent_X, cent_Y);
The bullet is rotated in the well direction but, its orthogonal frame is changed too. Thus, when I check the bounce with the screenborders, there is error, “the screenborders of the bullet” have rotated.
In fact, the bullet bounces on the Rectangle(X_MIN,Y_MIN,X_MAX,Y_MAX) that i draw “for checking” during the Graphics2D rotation and not on the true BorderScreen.
I don’t know if i was clear, but this problem is very strange.
If you want, I can give a .jar so as to you see my problem.
Edit: the “c” is a Graphics2D used by my Sprite.
re-Edit: it’s all the more strange that my Object Tank don’t pose problem when I rotate it by the same way. This tank move in four directions only (up, down, right, left), so its rotation’s angle takes 0, 90, 180, 270 degres value. And these rotations don’t pose problem _ visible problem would be more right_.