The Artima Developer Community
Sponsored Link

Java Answers Forum
Trouble with Java Game

1 reply on 1 page. Most recent reply: Mar 10, 2003 9:02 PM by Max Lyn

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
John

Posts: 1
Nickname: jarby
Registered: Mar, 2003

Trouble with Java Game Posted: Mar 10, 2003 2:47 PM
Reply to this message Reply
Advertisement
Ok, I made a java game last semester in my first year of java programming class, and it fully works *for me*, but whenever other people play it (with very few exceptions), they say its either flickery or too fast. I have a Win XP 2.66 GHZ computer so I don't think its too slow to run it.

Here's a link to the game: gamesarchive.iwarp.com
On that page I put a link to it, its called Snowboard Madness.

Do I have some kind of updated Java compiler in my browser or a newer IE than most other people, or is there a different reason this game isn't working for most people who try it?


Max Lyn

Posts: 11
Nickname: techrolla
Registered: Feb, 2003

Re: Trouble with Java Game Posted: Mar 10, 2003 9:02 PM
Reply to this message Reply
You just need to make the gae double buffered. Just make a Graphics object then an off screen Image and just update and repaint the screen, heres an example

class whatever {
Graphics offG;
Image offImage;

public whatever()
{

offImage = createImage(size().width, size().height);
offG = offImage.getGraphics();
}

public void update(Graphics g)
{
offG.setColor(getBackground());
offG.fillRect(0, 0, size().width, size().height);

offG.setColor(getForeground());
offG.drawRect(10, 40, 30, 30);

paint(offG);

g.drawImage(offImage, 0, 0, null);
}

Thats How you can make it double buffered. By the way, tight ass game, you should make the guy spin and shit.

Flat View: This topic has 1 reply on 1 page
Topic: java virtual machine launcher Previous Topic   Next Topic Topic: Please help me with a program

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use