Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Version 0.2:
- Changelog: http://pastebin.com/Kp6Srk6k
- Logo.png: http://imgur.com/3gPDZu5
- */
- int[] align = {
- 0, 200, 400
- };
- int[] blockSize = {
- 600, 50
- };
- int[] velocity = {
- 10, 20, 30, 40, 50, 60
- };
- int[] BarX = {
- -600
- };
- int[] BarY = {
- 70
- };
- int[] colors = {
- int(random(255)), int(random(255)), int(random(255))
- };
- boolean menu_firstRun = true;
- boolean game = false;
- int m_velocity = int(random(20));
- int score = 0;
- int speedLevel = 1;
- int speed = 0;
- int menuStage = 1;
- PImage img1;
- void setup() {
- img1 = loadImage("logo.png");
- size(600, 600);
- smooth();
- }
- void draw() {
- background(9, 125, 154);
- setupFrame();
- }
- void mouseClicked() {
- }
- void setupFrame() {
- if (game) {
- checkScore();
- }
- else { // the menu
- imageMode(CENTER);
- image(img1, width/2, 40);
- drawMenuBars();
- }
- }
- void checkScore() {
- if (score == 0) {
- speed = velocity[speedLevel];
- }
- else if (score >= 5) {
- }
- }
- void drawMenuBars() {
- System.out.println("X: " + BarX[0] + " | Y: " + BarY[0]);
- System.out.println(m_velocity);
- if (menu_firstRun) {
- System.out.println("Color: " + colors[0] + " | Color: " + colors[1] + " | Color: " + colors[2]);
- menu_firstRun = false;
- }
- if (menuStage == 1) {
- fill(colors[0], colors[1], colors[2], 129);
- rect(BarX[0], BarY[0], blockSize[0], blockSize[1]);
- }
- if (BarX[0] >= width) {
- BarX[0] = -600;
- colors[0] = int(random(255));
- colors[1] = int(random(255));
- colors[2] = int(random(255));
- m_velocity = int(random(5));
- while (m_velocity == 0) {
- m_velocity = int(random(5));
- }
- }
- else {
- BarX[0] += m_velocity;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement