Jump to content

Extreme Pong


Recommended Posts

Hi, has anyone made an extreme pong on C++, Java, or Basic? I have started on it with Java but then lost my mind over it. Here's the code so far:

import java.awt.*;
import java.applet.*;
public class MainPong extends Applet
{

   
static int ballx = 100;
int bally = 100;
int radii = 20;
static int velball = 10;
boolean var = true;
int bufferWidth;
   int bufferHeight;
   Image offscreen; 
   static Graphics bufferGraphics;
   Dimension dim; 
   int dix,diY;
   
   public static void Main()
   {
     
 paint();
     ballmove();

   }  	
public void paint(Graphics g)
{
 //color of ball//
 g.setColor(Color.yellow);
 //ball stat//
 g.fillOval (ballx - radii, bally - radii, 2 * radii, 2 * radii); 
 	


}
 public static void ballmove()
 {
 	ballx = ballx-velball;
 if (ballx <= 10)
 {
 	ballx = 10;
 	velball = 20;
 }


 if (ballx >= 200)
 {
 	ballx = 200;
 	velball = -20;
 }
 }

}

 

Post yours, but if you interested in making it and never have made one we should have a contest. And should we do this in C++ or java?

Edited by Pwnious
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...