• Advertisement

Archived

This topic is now archived and is closed to further replies.

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

This topic is 6610 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement