[java] How do I write a fast sprite engine with Java 2?

Started by
-1 comments, last by Hookflash 24 years, 1 month ago
I am considering writing some games using Java 2, but Java 2D is turning out to be kinda confusing. Are there any tutorials online that deal with Java 2D features that would be useful for games (i.e., BufferedImage, drawImage, WriteableRaster, etc.)? Thanks for your time and help. Hookflash P.S. I would like to write a sprite engine from scratch rather than using someone else''s code. P.S.S. Seeing as how Swing components are automatically double buffered, would it be wise for me to just blit all my sprites to a JPanel from within it''s paintComponent method, allowing it to handle the double buffering for me? i.e., class DisplayPanel extends JPanel { public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D)g; //...blit sprites to panel here... } } Then, I could just call "panel.repaint()" from a Timer?

This topic is closed to new replies.

Advertisement