
-----------------------------------
jamonathin
Wed Dec 21, 2005 2:47 pm

Intializing Applet
-----------------------------------
Hey all,  wanted to get back into making games (as some of you may know) and i'm just going to start with a basic brickout style game.  But i cant seem to get anything to start.  How do I go about initializing my applet?

Here's my code.  The only part I wanna see right now is refresh();.  The other stuff is there for later on.

import java.awt.*;

public class Tetris
{
	Thread fThread;
	Image offScreenImage;
	Graphics offScreenGraphics;
	
	int xPlayer = 100;
	int yPlayer = 20;
	int gameSpeed = 4;
	
	int bxSize = 30; // Block - x size.
	int bySize = 30; // Block - y size.
	
	int maxx = 360;
	int maxy = 360;
	
	boolean keyUp = false;
	boolean keyDown = false;
	boolean keyLeft = false;
	boolean keyRight = false;
	
	//	 2-D map
	byte fMap

-----------------------------------
wtd
Wed Dec 21, 2005 2:48 pm


-----------------------------------
public void init

That's in even the most basic applet tutorial.

Google is your friend, especially with "site:java.sun.com".

-----------------------------------
jamonathin
Thu Dec 22, 2005 10:32 am


-----------------------------------
Yeah turns out i needed

extends Applet implements Runnable
and

public void run()
I saw those in the other example, but I thought they were just user created names, not that init and run were needed :doh:.

-----------------------------------
jamonathin
Thu Dec 22, 2005 10:33 am


-----------------------------------
Yeah turns out i needed

extends Applet implements Runnable
and

public void run()
I saw those in the other example, but I thought they were just user created names, not that init and run were needed :doh:.
