Help with my own Game

Okay i try it :crazy_face:

1 Like
float spieler_x;
float spieler_y = 200;
float rx = width/5;
float ry = 500;
float rw = 100;
float rh = 100;
float linksX = 50;
float linksY = 500;
float linksW = 100;
float linksH = 100;
float jumpX = 1250;
float jumpY = 500;
float jumpW = 100;
float jumpH = 100;
void setup() {
  orientation(LANDSCAPE);
  background(0);
  stroke(0);
  noFill();
}
void draw() {
  fill(#FFFFFF);
  rect(spieler_x, spieler_y, 50, 50, 2);
  rect(rx, ry, rw, rh, 5);
  rect(jumpX, jumpY, jumpW, jumpH, 5);
  rect(linksX, linksY, linksW, linksH, 5);
  fill(255);
  if (mousePressed) {
    if(mouseX>rx && mouseX <rx+rw && mouseY>ry && mouseY <ry+rh) {
      fill(#818181);
      rect(rx, ry, rw, rh, 5);
        if (spieler_x < 1400) {
          spieler_x++;
      }
    }
    if (mouseX>linksX && mouseX <linksX+linksW && mouseY>linksY && mouseY <linksY+linksH) {
      fill(#818181);
      rect(linksX, linksY, linksW, linksH, 5);
      if (spieler_x > 5) {
        spieler_x--;
      }
    }
    if(mouseX>jumpX && mouseX <jumpX+jumpW && mouseY>jumpY && mouseY <jumpY+jumpH) {
      fill(#818181);
      rect(jumpX, jumpY, jumpW, jumpH, 5);
      redraw();
      spieler_y--;
    }
  }
  fullScreen();
}

I’m overwhelmed with it, I don’t know how it works🙄

The concept isn’t that difficult. Let’s say you have a phone with a screen resolution of 600 by 900 pixels, and you make a sketch and draw a button at location rect(300, 450, bw, bh).
The button will then in the middle of the screen. Now you send your app to a friend whose phone has a resolution of 1200 by 1900 pixels. The button will appear on the top left of his screen. So therefore in an Android sketch, you need to write rect(width/2, height/2);

1 Like

is there a video in German? :frowning:

You can switch on subtitles on youtube in the settings button; some of them have the german translation I just tried videos Daniel Shiffman here. For the rest, I always use google translator. Whole text pages can be translated at once.

1 Like

Install this Chrome extension and then you click on the icon and chose translate page.
This is a really good website to translate and learn from.

Thank you :relaxed: :relaxed: :relaxed: :relaxed: :relaxed: :relaxed: :relaxed: