FiShMaStEr
Aug 14 2004, 10:22 AM
hey there, love the support you guys give here its excellent.
now i have encountered a bug while making my own version of battleships. im currently in the stage of laying down the pieces, but have encountered a problem with rotating. i can get the blocks of the ships to line up in the Y direction, but the images i dont know how to rotate. I have found a huge number of scripts, but the way they do it mostly is creating a new image. I also noticed that Ali has a version of asteroids in java mode in the java games section, which uses a ship in the middle rotating on a keyboard button press, this could be harnessed so when clicked it will rotate a certain amount of degrees possibly.
if anyone can help me out it would be great. willing to supply everything (heck its freeware aint it!)
usr.c
Aug 14 2004, 09:37 PM
Admittidly, when I was writing Centipede for a unit assignment, I ended up using seperate images too depending on which side the sprite was facing. I've since come across an alternative method to rotate shapes by using methods, like rotate, froom the Java2D library.
Check out the demos and tutorials at java.sun.com:
http://java.sun.com/products/java-media/2D...rms/Rotate.htmlhttp://java.sun.com/products/java-media/2D.../Rotate-pi.htmlA good intro:
http://www.javaworld.com/javaworld/jw-07-1...w-07-media.htmlThere's also a wealth of information here:
http://community.java.net/games/
FiShMaStEr
Aug 17 2004, 03:48 AM
well i believe i just did it the cheating way
i set it up so that when the word of battleships under rotate is clicked (well the box) it then just loads a pre rotated image file instead of the original and does the fliip mechanism i had b4. works alot easier then creating a whole bunch of new classes for each flip of all 30 pieces lol. thanks for the help though.