Arcade Village's blog
SnakeSmash and end of Ellipse study
2010-10-01::Site life
New game on Arcade Village,
SnakeSmash.

Thanks to Pixoland for the graphism.
With this simple game, I finish my study of Ellipse.
In this game the sprites have a rotation of 90°.
Here is the source code :
switch ( action[ir] )
{
case TRANS_ROTATEPLUS90 :
img = new BufferedImage(r.height,r.width,BufferedImage.TYPE_4BYTE_ABGR);
g = (Graphics2D )img.createGraphics();
at = AffineTransform.getQuadrantRotateInstance(1,r.height/2,r.width/2);
at.translate((r.height-r.width)/2,(r.width-r.height)/2);
break;
case TRANS_ROTATEMOINS90 :
img = new BufferedImage(r.height, r.width, BufferedImage.TYPE_4BYTE_ABGR);
g = (Graphics2D )img.createGraphics();
at = AffineTransform.getQuadrantRotateInstance(-1,r.height/2,r.width/2);
at.translate((r.height-r.width)/2,(r.width-r.height)/2);
break;
}
bimg = new BufferedImage(r.width,r.height,BufferedImage.TYPE_INT_ARGB);
g = bimg.createGraphics();
g.drawImage(gi,0,0,r.width,r.height,r.x,r.y,r.x+r.width,r.y+r.height,null);
g.dispose();
setImage(name,imgorientation,bimg);
I also updated my Cookies manager object.
I am using the JSObject, always supported in last Java.
If you are interested to use the JSObject, import the package :
import netscape.javascript.*;
then add the library plugin.jar to your project. Is is a standard library of the java SDK.
I have now all the tools to make new games with Ellipse and I will stop boring you with java.
Have fun.
Comments
No comment