Last active
February 24, 2017 07:16
-
-
Save dz0/c518144cdb6a0fbc22b34f6e17c526db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int x=100, y=100; | |
| int vx=5, vy=3; | |
| void setup(){ | |
| size(600, 600); | |
| } | |
| void draw(){ | |
| background(255); | |
| fill(0, 200, 0); | |
| ellipse( x, y, 30, 30); | |
| // judesys -- suveikia kas akimirką (ne kas sekundę) | |
| x += vx; | |
| y += vy; | |
| if(x >= width) x = 0; | |
| if(y >= height) vy = -vy; | |
| // info | |
| fill( 0, 0, 100 ); | |
| text("x: "+x + ", y: "+y, 30, 30); | |
| text("vx: "+vx + ", vy: "+vy, 30, 60); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment