Advertisement
Nojus_Globys

jan31

Jan 31st, 2023
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | Software | 0 0
  1.  
  2. PImage // kintamojo tipas - paveiksliukas
  3.   lion,
  4.   car;
  5.  
  6. int
  7.   // pozicijos
  8.   lionX, lionY,
  9.   carX, carY,
  10.  
  11.   // dydžiai
  12.   // plotis auštis
  13.   lionW, lionH,
  14.   carW, carH,
  15.  
  16.   // greičiai
  17.   carSpeed,
  18.  
  19.   lionStep = 1,
  20.   maxStep,
  21.  
  22.   road; // horizontali linija, žyminti kelią
  23.  
  24. void setup () {
  25.   size (1280, 740);
  26.  
  27.   lion = loadImage ("data/lion.png");
  28.   car = loadImage ("data/car.png");
  29.  
  30.   imageMode (CENTER);
  31.  
  32.   // (float)2500
  33.   //float size1 = height / float(2500);
  34.   //println (size1);
  35.   //println (size2);
  36.   float size = height / 2500.0; // 0.3
  37.   // 559 * 0.296 = 165.464
  38.   // originalus * koeficientas
  39.   lionW  = (int)(lion.width * size);
  40.   lionH = (int)(lion.height * size);
  41.   carW = (int)(car.width * size);
  42.   carH = (int)(car.height * size);
  43.  
  44.   road = height - height / 4;
  45.  
  46.   //image (lion, width / 2, height / 2, lion.width * 0.5, lion.height * 0.5);
  47.   //rect (x, y, w, h);
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement