Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int xPos=10;
- int geschwindigkeit=10;
- int modus=0;
- void setup(){
- size(400,400);
- stroke(#8EE3DC);
- strokeWeight(50);
- point(xPos,200);
- }
- void draw(){
- background(#5A74FF);
- geschwindigkeit*=1.001;
- if ( modus == 0 ) {
- xPos=xPos+geschwindigkeit;
- }
- else
- {
- xPos=xPos-geschwindigkeit;
- }
- if ( xPos >= 340 ) {
- modus=1;
- }
- if ( xPos <= 0 ) {
- modus=0;
- }
- point(xPos,200);
- line(375,50,375,350);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement