Blank window on export.
in
Integration and Hardware
•
2 years ago
I'm having a some trouble with a unfinished game. It runs fine in the processing IDE when I hit run, but whenever I try to export it (Both to windows application (non-full screen) and web applet), it just appears as a blank white screen/window. Any help would be appreciated.
Exported windows application:
http://dl.dropbox.com/u/21772177/VT74.rar
Code:
- import controlP5.*;
- import fisica.*;
- PFont font;
- FWorld world;
- FPoly tank, gun, land;
- pTank player;
- ControlP5 controlP5;
- int storystage, seed, sx, sy = 0;
- float tankvx,tankvy,tankvr,py = 0;
- color stro = color(255, 128, 0);
- color fil = color(255, 128, 0);
- boolean menu = true;
- void setup() {
- size(1024, 512, P2D);
- background(0);
- font = loadFont("VectorBattle-18.vlw");
- Fisica.init(this);
- world = new FWorld();
- world.setEdges();
- world.setEdgesFriction(20);
- world.setGrabbable(false);
- levelgen();
- pTank player = new pTank();
- player.spawn(200, 100);
- ///////////////////////
- // for(int i = 0; i < landscape.length; i++){
- // landscape[i] = noise(width,i*0.08);
- // }
- // land = new FPoly();
- // land.setStroke(stro);
- // land.setFill(fil);
- // land.setDensity(0.0f);
- // land.vertex(0,height);
- // land.vertex(width,height);
- // for(int i = landscape.length; i < 0; i--){
- // land.vertex(i, landscape[i]);
- // }
- // world.add(land);
- ////////////////////////
- controlP5 = new ControlP5(this);
- controlP5.addSlider("health", 0, 1000, 1000, 850, 10, 100, 10);
- }
- void draw() {
- background(52, 56, 56);
- gamecheck();
- story();
- if ( keyPressed) {
- if ( key == 'd' || key == 'D' ) {
- tank.adjustAngularVelocity(0.5);
- }
- else if ( key == 'a' || key == 'A' ) {
- tank.adjustAngularVelocity(-0.5);
- }
- if (key == 'w' || key == 'W') {
- tank.adjustVelocity(10, 0);
- }
- if (key == 's' || key == 'S') {
- tank.adjustVelocity(-10, 0);
- }
- if (key == 'f') {
- delay(200);
- storystage++;
- }
- }
- if (mousePressed) {
- stroke(255);
- pewpew();
- }
- controlP5.draw();
- world.step();
- world.draw(this);
- if(keyPressed){
- if(key == 'p'){
- delay(100);
- saveFrame("progress-####");
- }
- }
- }
- class pTank {
- void spawn (int xSpawn, int ySpawn) {
- sx = xSpawn;
- sy = ySpawn;
- tank = new FPoly();
- tank.setStroke(0, 180, 204);
- tank.setFill(52, 56, 56);
- tank.vertex(10, 10);
- tank.vertex(30, 10);
- tank.vertex(40, 15);
- tank.vertex(35, 20);
- tank.vertex(10, 20);
- tank.vertex(5, 15);
- tank.vertex(7, 12);
- world.add(tank);
- tank.setPosition(xSpawn, ySpawn);
- }
- }
- void winball(int sizeOf, int Xball, int Yball) {
- FBlob winball = new FBlob();
- winball.setStroke(0, 180, 204);
- winball.setFill(52, 56, 56);
- winball.setAsCircle(Xball, Yball, 40);
- world.add(winball);
- }
- void story() {
- fill(0, 140, 158);
- textFont(font, 18);
- if (storystage == 0) {
- text("Press W+S to move back and forth <'f' to advance>", 100, 30);
- }
- if (storystage == 1) {
- text("Press A+D to rotate <'f' to advance>", 100, 30);
- }
- if (storystage == 2) {
- text("Click on something to fire <'f' to advance>", 100, 30);
- }
- if (storystage == 3) {
- text("Now, GO GO VECTOR TANK!", 100, 30);
- }
- }
- void pewpew() {
- FRaycastResult result = new FRaycastResult();
- FBody b = world.raycastOne(tank.getX()+25, tank.getY()+2, mouseX, mouseY, result, true);
- for (int i = 0; i<10; i++) {
- if(result.getX() != 0){
- line(tank.getX()+int(random(-3,3)), tank.getY()+int(random(-3,3)), result.getX()+int(random(-3,3)), result.getY()+int(random(-3,3)));
- }
- }
- }
- void levelgen() {
- world.remove(land);
- noiseSeed(seed);
- land = new FPoly();
- land.setStroke(stro);
- land.setFill(fil);
- land.setDensity(0.0f);
- land.vertex(width,height);
- land.vertex(0,height);
- for(int i = 0; i<width; i+=10){
- land.vertex(i,map(noise(width,i*0.005),0,1,height-100,50));
- }
- seed++;
- world.add(land);
- }
- void turret(int spawnx, int spawny) {
- }
- void gamecheck(){
- if(tank.getX() > 950){
- py = tank.getY();
- tankvx = tank.getVelocityX();
- tankvy = tank.getVelocityY();
- tankvr = tank.getAngularVelocity();
- tank.setPosition(20,py);
- tank.setAngularVelocity(tankvr);
- tank.setVelocity(tankvx,tankvy);
- levelgen();
- }
- }
1