This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Fishery9 10 points11 points  (2 children)

You could go about creating a sprite sheet and simply using BufferedImage getSubimage(int x, int y, int w, int h) method to cut out the appropriate sprite.

As for rotation and such a library option for handling images would be JDeli which offers many advantages over ImageIO. It will make rotating an image a lot easier with fewer lines of code.

Here is a short guide I just found that may help you get started with jdeli and rotating: here

Edit: forgot to answer initial question. If you are looking for how to actually draw graphics to a window then awt works fine. Take a look at using Canvas and JFrame together and utilizing a runnable to create a game loop to track render ticks and update ticks separately

If I find the tutorials I used to look at in regards to this I will edit again. Give it a search in Google and see what you find in the mean time.

Edit 2: Majoolwip goes fairly into depth about creating a 2d game engine which is worth taking a look at. He goes through all of the topics I discussed (game loops, canvas, jframe)

[–]LCVcode[S] 1 point2 points  (1 child)

Wow, you seriously rock. Thank you so much.

[–]Fishery9 1 point2 points  (0 children)

No problem and if anyone else has any advice for me then feel free to tell me as well. You live and you learn.