Commit 477c3079 authored by Noman Rafique's avatar Noman Rafique

first and final commit of pong.

parent 05e018e4
import processing.core.PApplet;
import java.util.Random;
public class Pong extends PApplet
{
// x position of the ball
private int ballX;
// y position of the ball
private int ballY;
// Ball speed in the x direction
private int ballSpeedX;
// Ball speed in the y direction
private int ballSpeedY;
// Width of our window
final private int width = 640;
// height of our window
final private int height = 480;
public static void main(String[] args) {
// Set up the processing library
PApplet.main("Pong");
}
public void settings() {
// Set our window size
size(width, height);
}
public void setup() {
// Create a random initial position and speed for the ball
Random r = new Random();
ballX = r.nextInt(width);
ballY = r.nextInt(height);
ballSpeedX = r.nextInt(width / 100) + 1;
ballSpeedY = r.nextInt(height / 100) + 1;
}
public void draw() {
// Clear the background of the window
background(255, 255, 255);
// Draw the ball
ellipse(ballX, ballY, 32, 32);
// Move the ball
ballX += ballSpeedX;
ballY += ballSpeedY;
}
}
#!/bin/bash
#PROCESSING=~/Downloads/processing-3.3.5/core/library/core.jar
PROCESSING=/opt/processing/core/library/core.jar
javac -cp $PROCESSING Pong.java
java -cp $PROCESSING:. Pong
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="lib" path="core.jar"/>
<classpathentry exported="true" kind="lib" path="jsyn-20171016.jar"/>
<classpathentry exported="true" kind="lib" path="sound.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>pong</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
/Pong$Ball.class
/Pong$Computer.class
/Pong$Paddle.class
/Pong$Player.class
/Pong.class
/evafangoria.txt
File added
File added
This diff is collapsed.
Eva Fangoria Truetype Font for Windows Version 1.0
2018 Iconian Fonts - Daniel Zadorozny
http://www.iconian.com/
This font comes with the following 22 versions: Regular, Italic, Condensed, Condensed Italic, Expanded, Expanded Italic, 3D, 3D Italic, Outline, Outline Italic, Rotated, Rotated 2, Rotalic, Staggered, Staggered Italic, Staggered Rotalic, Warped, Warped Italic, Warped Rotalic, Semi-Italic, Super-Italic and Leftalic.
This font may be freely distributed and is free for all non-commercial uses. Use of the fonts are at your own risk.
For commercial use of the font please visit http://iconian.com/commercial.html for additional information.
This font is e-mailware; that is, if you like it, please e-mail the author at:
iconian@aol.com
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment