Commit 1482be0b authored by a.guest's avatar a.guest

Initial commit

parents
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="lib/base/core/core.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/gluegen-rt-natives-linux-aarch64.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/gluegen-rt-natives-linux-amd64.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/gluegen-rt-natives-linux-armv6hf.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/gluegen-rt-natives-linux-i586.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/gluegen-rt-natives-macosx-universal.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/gluegen-rt-natives-windows-amd64.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/gluegen-rt-natives-windows-i586.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/gluegen-rt.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/jogl-all-natives-linux-aarch64.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/jogl-all-natives-linux-amd64.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/jogl-all-natives-linux-armv6hf.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/jogl-all-natives-linux-i586.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/jogl-all-natives-macosx-universal.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/jogl-all-natives-windows-amd64.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/jogl-all-natives-windows-i586.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="lib/base/core/jogl-all.jar">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="SpaceShooter01/lib/base/core"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SpaceShooter01</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>proclipsing.core.ProcessingProjectNature</nature>
</natures>
</projectDescription>
PROCESSING_APP_PATH=C\:\\processing-3.5.3\\
PROCESSING_SKETCH_PATH=C\:\\Users\\Andy\\My Documents\\Processing\\
eclipse.preferences.version=1
# SpaceShooter-01
Space Shooter Gamer - 01
For Worksheet 01 - 1CB101 Programming 01
\ No newline at end of file
/data/
/spaceshooter/
# If you want to support more platforms, visit jogamp.org to get the
# natives libraries for the platform in question (i.e. Solaris).
name = OpenGL
application.macosx=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-macosx-universal.jar,gluegen-rt-natives-macosx-universal.jar
application.windows32=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-windows-i586.jar,gluegen-rt-natives-windows-i586.jar
application.windows64=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-windows-amd64.jar,gluegen-rt-natives-windows-amd64.jar
application.linux32=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-i586.jar,gluegen-rt-natives-linux-i586.jar
application.linux64=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-amd64.jar,gluegen-rt-natives-linux-amd64.jar
application.linux-armv6hf=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-armv6hf.jar,gluegen-rt-natives-linux-armv6hf.jar
application.linux-arm64=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-aarch64.jar,gluegen-rt-natives-linux-aarch64.jar
package spaceshooter;
import processing.core.PApplet;
import processing.core.PImage;
public class SpaceShooter extends PApplet {
enemyObject asteroid; // object used to define an asteroid
// settings() method is run when the application starts
// It is used to set the application settings
public void settings() {
size(500, 500); // Sets the size of the window
}
// setup() method is called once, after the settings() method
// setup() is used to create objects and carry out any preparations for running the application
public void setup()
{
asteroid = new enemyObject(this); // Creates a new object of the enemyObject type called asteroid
}
// The draw() method is run and as soon as it completes it is run again.
// This continues until the application ends
// The method is poorly named because it does more than simply draw to the screen
// It needs to carry out three main functions
// 1 - Process input from the mouse and keyboard
// 2 - Update all the objects in the application
// 3 - Render (draw) to the screen
// I've added methods for each of these functions and changed the draw() method
// to call these three new methods in order.
// You *shouldn't* need to ever change the draw() method
// Method to handle keyboard and mouse input
public void handleInput()
{
}
// update() handles updating all the objects in the application
// More accurately it tells all the objects in the application to update themselves,
// passing on any information they need to do that
public void update()
{
asteroid.update(); // calls the asteroid's update() method
}
// render() handles the drawing of objects to the screen
// again it mostly does this by telling all the objects to draw themselves
public void render()
{
background(0); // sets the windows background to black
asteroid.render(); // calls the asteroid's render() method to draw it
}
// draw() method described above. Called constantly byh processing
// You shouldn't need to change this
public void draw(){
handleInput();
update();
render();
}
// main() method is the starting point of any Java application
// In this case it starts the processing applet
// this calls settings() followed by setup(), then begins repeatedly calling draw.
public static void main(String[] passedArgs) {
String[] appletArgs = new String[] { "spaceshooter.SpaceShooter" };
PApplet.main(appletArgs);
}
}
package spaceshooter;
import processing.core.PApplet;
import processing.core.PImage;
public class enemyObject {
PApplet papplet; // Handle for processing methods
PImage sprite; // object to hold an image
// Constructor method for enemyObject
public enemyObject(PApplet papp)
{
papplet = papp; // required to use processing methods here
sprite = papp.loadImage("asteroid.png"); // loads the image from the data folder
sprite.resize(64, 0); // resizes the image to (x,y) dimensions. Note that if either x or y is
// zero then the image will be resized and maintain aspect ratio
}
// Method to handle keyboard and mouse input
// Not used yet!
public void handleInput()
{
}
// Method to handle updates to the enemyObject
public void update()
{
}
// Method to draw the enemyObject
public void render()
{
papplet.image(sprite,200,200); // Draws image at position 100,100
}
}
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