Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Random;
- import processing.core.PApplet;
- import processing.event.MouseEvent;
- public class CagedAlpha extends PApplet {
- public static void main(String[] args) {
- PApplet.main("CagedAlpha");
- }
- List<float[]> drops = new ArrayList<float[]>();
- List<float[]> entities = new ArrayList<float[]>();
- Random rand = new Random();
- Libraries l = new Libraries();
- int w = 1920 / 2;
- int h = 1080 / 2;
- int types = 10;
- byte[][] world = new byte[1000][100];
- short[][] textures = new short[types][4];
- int[] inventory = new int[types];
- float px = world.length * 25;
- float py = 0;
- float xv = 0;
- float yv = 0;
- float cameraX;
- float cameraY;
- boolean up;
- boolean left;
- boolean right;
- boolean space;
- boolean first = true;
- boolean touchingBlock = false;
- byte blockCheck = 0;
- byte tc = 0;
- byte selection = 1;
- boolean mining = false;
- int progress = 0;
- float health = 100;
- boolean checkOut = false;
- int mb = 0;
- float magnetism = 150;
- boolean dead = false;
- int burning = 0;
- float deathX = -1;
- int reload = 0;
- boolean won = false;
- boolean menus = true;
- int difficulty = 2;
- public void settings() {
- size(w, h);
- noSmooth();
- }
- public void setup() {
- // Texturing
- addTexture(255, 255, 255, 0);
- addTexture(10, 255, 50, 10);
- addTexture(80, 35, 0, 10);
- addTexture(100, 100, 100, 30);
- addTexture(20, 20, 20, 1000000);
- addTexture(50, 0, 100, 20);
- addTexture(10000, 0, 0, 100);
- addTexture(0, 170, 170, 50);
- addTexture(200, 200, 200, 100);
- addTexture(0, 1000, 0, 10);
- noStroke();
- // World Generation
- for (int x = 0; x < world.length; x++) {
- for (int y = 0; y < world[0].length; y++) {
- double height = l.noise((double) x / 10, 0, 1) * 20;
- if (height < y - 75 && y <= 83) {
- world[x][y] = 1;
- if (height > y - 76 && Math.random() < 0.05) {
- world[x][y - 1] = 5;
- }
- }
- if (height < y - 76) {
- world[x][y] = 2;
- }
- if (height < y - 80) {
- if (Math.random() < 0.98 || height > y - 85) {
- world[x][y] = 3;
- } else if (Math.random() < 0.5 || height > y - 85) {
- world[x][y] = 8;
- } else {
- world[x][y] = 7;
- }
- }
- if (world[x][y] == 0 && y > 83) {
- world[x][y] = 6;
- }
- /*
- * if (rand.nextBoolean() && y > 50) { world[x][y] = 1; }
- */
- if ((x == 0 || x == world.length - 1) || (y == 0 || y == world[0].length - 1)) {
- world[x][y] = 4;
- }
- }
- }
- }
- public void draw() {
- // Main Menu
- if (menus) {
- first = true;
- fill(255);
- rectMode(CORNER);
- stroke(255);
- background(0);
- textSize(64);
- noFill();
- text("Difficulty: " + difficulty, 300, 200);
- textSize(16);
- text("Right & Left: Adjust difficulty (Menu Only)", 100, 250);
- text("WAD: Move", 100, 280);
- text("Left Mouse: Break block", 100, 310);
- text("Right Mouse: Place block", 100, 340);
- text("Space: Shoot (Start in menu)", 100, 370);
- text("Mouse Wheel: Select Block", 100, 400);
- textSize(32);
- rect(40, h - 92, w - 80, 64);
- if (difficulty == 0) {
- text("No enemies at all.", 50, h - 50);
- }
- if (difficulty == 1) {
- text("Pretty easy.", 50, h - 50);
- }
- if (difficulty == 2) {
- text("How the game is meant to be played.", 50, h - 50);
- }
- if (difficulty == 3) {
- text("Pretty hard.", 50, h - 50);
- }
- if (difficulty == 4) {
- text("Very, very hard.", 50, h - 50);
- }
- if (difficulty > 4 && difficulty < 11) {
- text("You won't win.", 50, h - 50);
- }
- if (difficulty > 10 && difficulty < 16) {
- text("What are you doing?", 50, h - 50);
- }
- if (difficulty > 15 && difficulty < 26) {
- text("Stop it, I can't handle this!", 50, h - 50);
- }
- if (difficulty > 25 && difficulty < 32) {
- text("What Have You done!?", 50, h - 50);
- }
- if (difficulty == 32) {
- text("I don't only feel bad for you, I feel bad for my CPU.", 50, h - 50);
- }
- textSize(100);
- fill(37, 75, 37);
- text("Caged", 325, 100);
- if (space) {
- menus = false;
- noStroke();
- }
- } else {
- if (first) {
- randomTicks(10000);
- }
- randomTicks(0.1f);
- // Placing & Breaking
- int mx = (int) (mouseX + cameraX - w / 2) / 50;
- int my = (int) (mouseY + cameraY - h / 2) / 50;
- if (!dead) {
- if (mousePressed && mouseButton == RIGHT && inventory[selection] > 0
- && !check((mouseX + cameraX - w / 2), (mouseY + cameraY - h / 2))) {
- if (selection > 0) {
- world[mx][my] = selection;
- inventory[selection] -= 1;
- doTick(mx, my);
- doTick(mx - 1, my);
- doTick(mx + 1, my);
- doTick(mx, my - 1);
- doTick(mx, my + 1);
- }
- }
- if (mousePressed && mouseButton == LEFT
- && check((mouseX + cameraX - w / 2), (mouseY + cameraY - h / 2))) {
- if (mining) {
- check((mouseX + cameraX - w / 2), (mouseY + cameraY - h / 2));
- if (!(blockCheck == mb)) {
- progress = 2 * (int) ((float) textures[blockCheck][3] / Math.pow(inventory[0] + 5, 0.3));
- } else {
- progress -= 1;
- }
- if (progress <= 0) {
- breakBlock(mx, my);
- mining = false;
- }
- } else {
- mb = blockCheck;
- mining = true;
- progress = 2 * (int) ((float) textures[blockCheck][3] / Math.pow(inventory[0] + 5, 0.3));
- }
- } else {
- mining = false;
- }
- // Projectiles
- reload -= 1;
- if (space && reload <= 0 && inventory[0] > 0) {
- inventory[0] -= 1;
- reload = (int) (120 / Math.pow(inventory[0], 0.3));
- float tx = mouseX - w / 2;
- float ty = mouseY - h / 2;
- float dist = dist(0, 0, tx, ty) / 20;
- tx /= dist;
- ty /= dist;
- spawnEntity(px, py, tx, ty, 0);
- // health = 0;
- // randomTicks(1000);
- /*
- * magnetism = 9999999; for (int i = 0; i < 10; i++) { int
- * tx = mx + (rand.nextInt(10) - 5); int ty = my +
- * (rand.nextInt(10) - 5); check(tx * 50, ty * 50); if
- * (health > textures[blockCheck][3] / 10) { if
- * (breakBlock(tx, ty)) { // health -=
- * textures[blockCheck][3] / 10; } } }
- */
- }
- }
- background(0);
- rectMode(CENTER);
- updatePlayer();
- if (!dead) {
- cameraX = px;
- cameraY = py;
- }
- // Doing Entities;
- doDrops();
- doEntities();
- // Drawing World
- loadPixels();
- for (int i = 0; i < pixels.length; i++) {
- float x = i % w + cameraX - w / 2;
- float y = i / w + cameraY - h / 2;
- float px = i % w;
- float py = i / w;
- if (px < width - 100 || py < height - 50) {
- if (check(x, y)) {
- float r = textures[blockCheck][0];
- float g = textures[blockCheck][1];
- float b = textures[blockCheck][2];
- float h;
- if (dead) {
- h = 40 / (dist(0, 0, x - cameraX, y - cameraY));
- } else {
- h = 10000 / (l.qlength(x - cameraX, y - cameraY) + 5000);
- }
- r *= h;
- g *= h;
- b *= h;
- pixels[i] = color(r, g, b);
- } else if (checkOut) {
- if (y < world[0].length * 50 + 1000) {
- pixels[i] = color(0, 255, 255);
- } else {
- pixels[i] = color(0, 0, 255);
- }
- }
- } else {
- x -= w / 2 - 50;
- y -= h / 2 - 25;
- x = (x - cameraX) * 25 + cameraX;
- y = (y - cameraY) * 25 + cameraY;
- if (check(x, y)) {
- float r = textures[blockCheck][0];
- float g = textures[blockCheck][1];
- float b = textures[blockCheck][2];
- pixels[i] = color(r, g, b);
- }
- x -= cameraX;
- y -= cameraY;
- if (x < 25 && x > -25 && y < 50 && y > -50) {
- pixels[i] = color(255);
- }
- }
- }
- updatePixels();
- // Drawing GUI & Player
- if (!dead) {
- rectMode(CENTER);
- fill(255);
- rect(w / 2, h / 2, 50, 100);
- if (inventory[selection] > 0) {
- fill(color(textures[selection][0], textures[selection][1], textures[selection][2]));
- rect(25, height - 25, 50, 50);
- fill(255);
- textSize(32);
- text(inventory[selection], 60, height - 14);
- textSize(16);
- text(selection, 20, height - 60);
- }
- rectMode(CORNER);
- fill(0, 255, 0);
- rect(0, 0, health / 100 * width, 25);
- rectMode(CENTER);
- if (deathX > 0) {
- if (Math.abs(deathX - px) < 100) {
- deathX = -1;
- }
- fill(255);
- if (deathX < px) {
- rect(12, 37, 25, 25);
- } else {
- rect(width - 12, 37, 25, 25);
- }
- }
- }
- if (won) {
- health += (100 - health) / 2;
- }
- }
- }
- boolean breakBlock(int x, int y) {
- if (check(x * 50, y * 50) && (!(blockCheck == 4) || inventory[0] > 4999)) {
- world[x][y] = 0;
- if (blockCheck == 1) {
- blockCheck = 2;
- }
- spawnDrop(x * 50 + 25, y * 50 + 25, blockCheck, 10);
- if (Math.random() < 0.01 * textures[blockCheck][3]) {
- spawnDrop(x * 50 + 25, y * 50 + 25, 0, 10);
- }
- return true;
- }
- return false;
- }
- void spawnDrop(float x, float y, int type, float force) {
- float[] buf = new float[5];
- buf[0] = x;
- buf[1] = y;
- buf[2] = type;
- buf[3] = (float) (Math.random() - 0.5) * force;
- buf[4] = (float) (Math.random() * -force / 2 - force / 2);
- drops.add(buf);
- }
- void spawnEntity(float x, float y, float xv, float yv, float type) {
- float[] buf = new float[5];
- buf[0] = x;
- buf[1] = y;
- buf[2] = xv;
- buf[3] = yv;
- buf[4] = type;
- entities.add(buf);
- }
- void killEntity(int e) {
- float[] buf = entities.get(e);
- if (buf[4] == 1) {
- for (int i = 0; i < 10; i++) {
- spawnDrop(buf[0], buf[1], 0, 10);
- }
- entities.remove(e);
- }
- }
- void doEntities() {
- rectMode(CENTER);
- for (int i = 0; i < entities.size(); i++) {
- float[] buf = entities.get(i);
- buf[0] += buf[2];
- buf[1] += buf[3];
- if (buf[4] == 0) {
- fill(255);
- rect(buf[0] - cameraX + w / 2, buf[1] - cameraY + h / 2, 10, 10);
- for (int j = 0; j < entities.size(); j++) {
- float[] ob = entities.get(j);
- if (ob[4] == 1) {
- if (buf[0] - 35 < ob[0] && buf[0] + 35 > ob[0] && buf[1] - 35 < ob[1] && buf[1] + 35 > ob[1]) {
- entities.remove(i);
- if (i < j) {
- killEntity(j - 1);
- } else {
- killEntity(j);
- }
- j = entities.size();
- i--;
- }
- }
- }
- if (check(buf[0], buf[1])) {
- breakBlock((int) buf[0] / 50, (int) buf[1] / 50);
- entities.remove(i);
- i--;
- }
- } else if (buf[4] == 1) {
- boolean kill = false;
- check(buf[0] - 13, buf[1]);
- if (blockCheck == 6) {
- kill = true;
- }
- check(buf[0] + 13, buf[1]);
- if (blockCheck == 6) {
- kill = true;
- }
- check(buf[0], buf[1] - 13);
- if (blockCheck == 6) {
- kill = true;
- }
- check(buf[0], buf[1] + 13);
- if (blockCheck == 6) {
- kill = true;
- }
- if (kill) {
- killEntity(i);
- i--;
- }
- buf[3] += 0.1;
- fill(255);
- rect(buf[0] - cameraX + w / 2, buf[1] - cameraY + h / 2, 25, 25);
- if (buf[0] > px - 25 && buf[0] < px + 25 && buf[1] > py - 50 && buf[1] < py + 50 && !dead) {
- health -= 1;
- }
- if (check(buf[0] - 13, buf[1] + 13) || check(buf[0] + 13, buf[1] + 13)) {
- buf[3] = -5;
- }
- if (!dead) {
- if (px < buf[0]) {
- buf[2] -= 0.5;
- } else {
- buf[2] += 0.5;
- }
- }
- if (check(buf[0] - 25, buf[1]) || check(buf[0] + 25, buf[1])) {
- buf[2] *= -1;
- }
- buf[2] *= 0.9;
- }
- }
- }
- void doDrops() {
- rectMode(CENTER);
- for (int i = 0; i < drops.size(); i++) {
- float[] buf = drops.get(i);
- fill(textures[(int) buf[2]][0], textures[(int) buf[2]][1], textures[(int) buf[2]][2]);
- buf[0] += buf[3];
- buf[1] += buf[4];
- if (check(buf[0], buf[1]) && blockCheck != 6) {
- buf[0] -= buf[3];
- buf[1] -= buf[4];
- buf[3] = 0;
- buf[4] = 0;
- }
- buf[3] *= 0.95;
- buf[4] *= 0.95;
- buf[4] += 0.5;
- float d = dist(px, py, buf[0], buf[1]);
- if (d < magnetism) {
- buf[3] += (px - buf[0]) / d;
- buf[4] += (py - buf[1]) / d;
- }
- rect(buf[0] - cameraX + w / 2, buf[1] - cameraY + h / 2, 10, 10);
- float ix = buf[0];
- float iy = buf[1];
- rand.setSeed(i * 1000);
- if (check(ix, iy + rand.nextInt(50))) {
- buf[4] -= 1;
- }
- if (ix > px - 25 && ix < px + 25 && iy > py - 50 && iy < py + 50 && !dead) {
- inventory[(int) buf[2]] += 1;
- drops.remove(i);
- i--;
- }
- }
- }
- void setBlock(int x, int y, int block) {
- if (x < world.length && x > 0 && y < world[0].length && y > 0) {
- world[x][y] = (byte) block;
- }
- }
- void doTick(int rx, int ry) {
- if (!(world[rx][ry] == 0 || world[rx][ry] == 6 || world[rx][ry] == 9)) {
- check(rx * 50 + 25, ry * 50 - 25);
- if (!first && Math.random() < (double) difficulty * difficulty / 1000 && blockCheck == 0
- && l.qdist(rx * 50 + 25, ry * 50 + 25, px, py) > 62500) {
- blockCheck = 1;
- check(rx * 50 + 25, ry * 50 - 125);
- if (blockCheck == 0) {
- if (world[rx][ry - 1] == 0) {
- spawnEntity(rx * 50 + 25, ry * 50 + 25, 0, 0, 1);
- }
- }
- }
- }
- if (world[rx][ry] == 1) {
- if (world[rx - 1][ry] == 2 && world[rx - 1][ry - 1] == 0) {
- setBlock(rx - 1, ry, 1);
- }
- if (world[rx + 1][ry] == 2 && world[rx + 1][ry - 1] == 0) {
- setBlock(rx + 1, ry, 1);
- }
- if (world[rx - 1][ry + 1] == 2 && world[rx - 1][ry] == 0) {
- setBlock(rx - 1, ry + 1, 1);
- }
- if (world[rx + 1][ry + 1] == 2 && world[rx + 1][ry] == 0) {
- setBlock(rx + 1, ry + 1, 1);
- }
- if (world[rx - 1][ry - 1] == 2 && world[rx - 1][ry - 2] == 0) {
- setBlock(rx - 1, ry - 1, 1);
- }
- if (world[rx + 1][ry - 1] == 2 && world[rx + 1][ry - 2] == 0) {
- setBlock(rx + 1, ry - 1, 1);
- }
- }
- if (world[rx][ry] == 5) {
- int set = 5;
- if (Math.random() < 0.8) {
- set = 3;
- }
- world[rx][ry] = (byte) set;
- set = 3;
- if (Math.random() < 0.9) {
- set = 5;
- }
- int dir = rand.nextInt(5);
- if (dir == 0 && world[rx + 1][ry] == 0) {
- setBlock(rx + 1, ry, set);
- } else if (dir == 1 && world[rx - 1][ry] == 0) {
- setBlock(rx - 1, ry, set);
- } else if (world[rx][ry - 1] == 0) {
- setBlock(rx, ry - 1, set);
- }
- }
- if (world[rx][ry] == 6 && world[rx][ry + 1] == 0) {
- setBlock(rx, ry, 0);
- setBlock(rx, ry + 1, 6);
- }
- if (world[rx][ry] == 8) {
- if (world[rx - 1][ry] == 7 && world[rx + 1][ry] == 7 && world[rx][ry - 1] == 7 && world[rx][ry + 1] == 7) {
- world[rx][ry - 1] = 0;
- world[rx - 1][ry] = 0;
- world[rx][ry + 1] = 0;
- world[rx + 1][ry] = 0;
- world[rx][ry] = 0;
- for (int j = 0; j < 100; j++) {
- spawnDrop(rx * 50 + 25, ry * 50 + 25, 0, 20);
- }
- } else if (world[rx - 1][ry] == 1 && world[rx + 1][ry] == 1 && world[rx][ry - 1] == 1
- && world[rx][ry + 1] == 1) {
- world[rx][ry - 1] = 0;
- world[rx - 1][ry] = 0;
- world[rx][ry + 1] = 0;
- world[rx + 1][ry] = 0;
- world[rx][ry] = 0;
- spawnDrop(rx * 50 + 25, ry * 50 + 25, 9, 10);
- }
- }
- if (world[rx][ry] == 7) {
- for (int j = 0; j < 100; j++) {
- int tx = rx + rand.nextInt(10) - 5;
- int ty = ry + rand.nextInt(10) - 5;
- if (check(tx * 50, ty * 50)) {
- if (world[tx][ty] == 6) {
- setBlock(tx, ty, 7);
- }
- }
- }
- }
- }
- void randomTicks(float per) {
- for (int i = 0; i < (world.length * world[0].length) * per / 100; i++) {
- int rx = rand.nextInt(world.length);
- int ry = rand.nextInt(world[0].length);
- doTick(rx, ry);
- }
- }
- boolean check(float x, float y) {
- checkOut = false;
- x /= 50;
- y /= 50;
- if (x < world.length && x > 0 && y < world[0].length && y > 0) {
- if (!(world[(int) x][(int) y] == 0)) {
- blockCheck = world[(int) x][(int) y];
- return true;
- } else {
- blockCheck = 0;
- }
- } else {
- checkOut = true;
- }
- return false;
- }
- void kill() {
- burning = 0;
- deathX = px;
- dead = true;
- float odds = 1 / ((float) findBlock(9).size() + 1);
- for (int i = 0; i < inventory.length; i++) {
- for (int j = 0; j < inventory[i]; j++) {
- if (getRandBlock(9) != null && Math.random() > odds) {
- int[] buf = getRandBlock(9);
- spawnDrop(buf[0] * 50 - 25, buf[1] * 50 - 50, i, 20);
- } else {
- spawnDrop(px, py, i, 20);
- }
- }
- inventory[i] = 0;
- }
- }
- int[] getRandBlock(int type) {
- List<int[]> buf = findBlock(type);
- if (buf.size() > 0) {
- int i = rand.nextInt(buf.size());
- int[] b = new int[2];
- b[0] = buf.get(i)[0];
- b[1] = buf.get(i)[1];
- return b;
- } else {
- return null;
- }
- }
- List<int[]> findBlock(int type) {
- List<int[]> dat = new ArrayList<int[]>();
- for (int x = 0; x < world.length; x++) {
- for (int y = 0; y < world[0].length; y++) {
- if (world[x][y] == type) {
- int[] buf = new int[2];
- buf[0] = x;
- buf[1] = y;
- dat.add(buf);
- }
- }
- }
- return dat;
- }
- void updatePlayer() {
- if (py > world[0].length * 50 + 1000) {
- burning = 0;
- won = true;
- yv -= 0.3;
- }
- if (py > world[0].length * 50 + 1100) {
- yv *= 0.98;
- menus = true;
- }
- if (dead) {
- health = 100;
- progress -= 1;
- if (progress == 0) {
- first = true;
- dead = false;
- }
- }
- health -= (float) (inventory[6] / 5) / 10;
- if (health <= 0 && !won) {
- kill();
- progress = 180;
- }
- if (dead) {
- px = 0;
- py = 0;
- }
- if (health < 100) {
- health += 0.01;
- }
- touchingBlock = false;
- if (first) {
- yv = 0;
- xv = 0;
- blockCheck = 0;
- int[] buf = getRandBlock(9);
- if (buf != null) {
- px = buf[0] * 50 + 25;
- py = buf[1] * 50 - 1;
- first = false;
- }
- if (first) {
- while (!(blockCheck == 1)) {
- py = 0;
- px = rand.nextInt(world.length) * 50;
- while (!check(px - 25, py + 50) && !check(px + 25, py + 50)) {
- py += 1;
- }
- }
- }
- py -= 50;
- first = false;
- }
- fill(textures[0][0], textures[0][1], textures[0][2]);
- yv += 0.2;
- xv *= 0.8;
- px += xv;
- py += yv;
- if (check(px - 20, py - 40) || check(px + 20, py - 40) || check(px - 20, py + 40) || check(px + 20, py + 40)) {
- health -= 0.1;
- }
- if (check(px - 24, py - 49) || check(px + 24, py - 49)) {
- touchingBlock = true;
- py -= yv;
- yv = 0;
- if (blockCheck == 6) {
- burning = 300;
- }
- }
- if (check(px - 24, py + 49) || check(px + 24, py + 49)) {
- if (yv > 15) {
- health -= (yv - 15) * 10;
- }
- touchingBlock = true;
- if (blockCheck == 6) {
- burning = 300;
- }
- py -= yv;
- if (up) {
- yv = -7;
- } else {
- yv = 0;
- }
- }
- if (check(px + 24, py - 49) || check(px + 24, py + 49) || check(px + 24, py)) {
- touchingBlock = true;
- if (blockCheck == 6) {
- burning = 300;
- }
- px -= xv;
- xv = 0;
- } else {
- if (right && !(check(px - 24, py - 24) || check(px - 24, py + 49) || check(px + 24, py))) {
- xv += 2;
- }
- }
- if (check(px - 24, py - 24) || check(px - 24, py + 49) || check(px + 24, py)) {
- touchingBlock = true;
- if (blockCheck == 6) {
- burning = 300;
- }
- px -= xv;
- xv = 0;
- } else {
- if (left && !(check(px + 24, py - 49) || check(px + 24, py + 49) || check(px + 24, py))) {
- xv -= 2;
- }
- }
- if (burning > 0) {
- health -= 0.2;
- burning--;
- }
- }
- void addTexture(int r, int g, int b, int h) {
- textures[tc][0] = (short) r;
- textures[tc][1] = (short) g;
- textures[tc][2] = (short) b;
- textures[tc][3] = (short) h;
- tc++;
- }
- public void mouseWheel(MouseEvent event) {
- byte old = selection;
- selection -= event.getCount();
- selection %= inventory.length;
- if (selection < 0) {
- selection = (byte) (inventory.length - 1);
- }
- while (inventory[selection] == 0 && !(old == selection)) {
- selection -= event.getCount();
- selection %= inventory.length;
- if (selection < 0) {
- selection = (byte) (inventory.length - 1);
- }
- }
- }
- public void keyPressed() {
- if (key == 'w') {
- up = true;
- }
- if (key == 'a') {
- left = true;
- }
- if (key == 'd') {
- right = true;
- }
- if (key == ' ') {
- space = true;
- }
- if (menus) {
- if (keyCode == LEFT && difficulty > 0) {
- difficulty--;
- }
- if (keyCode == RIGHT && difficulty < 32) {
- difficulty++;
- }
- }
- }
- public void keyReleased() {
- if (key == 'w') {
- up = false;
- }
- if (key == 'a') {
- left = false;
- }
- if (key == 'd') {
- right = false;
- }
- if (key == ' ') {
- space = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement