Hey guys im new here
and well i worked with processing for i think 2 days so im a nooby :3
I found a little " snake-script " and changed some
variables to see what happened I wanted to upload this script to my wordpress blog but every single time I try to look at the created web-files I just see a black area with nothing into it ..
here is the script :
color col=color(255, 255, 192);
color foodColor = color(255, 0, 0);
float speed = 1000;
int cx, cy;
int moveX = 0;
int moveY = 0;
int snakeX = 0;
int snakeY = 0;
int foodX = -1;
int foodY = -1;
boolean check = true;
int []snakesX;
int []snakesY;
int snakeSize = 1;
int windowSize = 500;
boolean gameOver = false;
PFont Font = createFont("Comic Sans MS", 20, true);
void setup() {
size(int(windowSize), int(windowSize), P3D);
background(0);
speed = 1000;
speed=speed/frameRate;
snakesX = new int[100];
snakesY = new int[100];
cx = width/2;
cy = height/2;
snakeX = cx-5;
snakeY = cy-5;
foodX = -1;
foodY = -1;
gameOver = false;
check = true;
snakeSize =1;
}
void draw() {
if (speed%10 == 0) {
background(0);
runGame();
}
speed++;
}
void reset() {
snakeX = cx-5;
snakeY = cy-5;
gameOver = false;
check = true;
snakeSize =1;
moveY = 0;
moveX = 0;
}
void runGame() {
if (gameOver== false) {
drawfood();
drawSnake();
snakeMove();
ateFood();
checkHitSelf();
}
else {
String modelString = "Verloren drücke R zum Neustart";
textAlign (CENTER);
textFont(Font);
text(modelString, 200, 200, 30);
}
}
void checkHitSelf() {
for (int i = 1; i < snakeSize; i++) {
if (snakeX == snakesX[i] && snakeY== snakesY[i]) {