Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #A1R1ShahidIbrahimIS_pyde
- # Bear Bouncing
- # Ibrahim Shahid
- # Bear Bounces Across The Screen
- # 12/02/16 Revision 1
- #Setup
- def setup():
- size(1200, 800)
- initalize()
- #Methods
- def initalize():
- global scl,pos,vel
- #Constants
- #Vectors
- pos=PVector(0,60)
- vel=PVector(5,5)
- #Variables
- scl = .5
- #Images and Sounds
- def deadmau5 ():
- global scl,pos
- pushMatrix();
- translate(pos.x, pos.y); #this reorients the origin to be at x=200 and y=200
- scale(1);
- fill(204, 95, 0);
- #arms
- ellipse(131, 185, 135, 41);
- ellipse(280, 185, 135, 41);
- #body
- ellipse(203, 229, 126, 142);
- #ears
- fill(204, 95, 0);
- ellipse(177, 88, 33, 33);
- ellipse(227, 88, 33, 33);
- fill(242, 159, 239);
- ellipse(177, 88, 16, 16);
- ellipse(227, 88, 16, 16);
- #head
- fill(204, 95, 0);
- ellipse(203, 133, 93, 93);
- #legs
- ellipse(181, 273, 50, 50);
- ellipse(232, 273, 50, 50);
- fill(0, 0, 0);
- ellipse(235, 280, 25, 25);
- ellipse(180, 280, 25, 25);
- ellipse(170, 264, 6, 6);
- ellipse(181, 261, 6, 6);
- ellipse(192, 264, 6, 6);
- ellipse(222, 264, 6, 6);
- ellipse(234, 261, 6, 6);
- ellipse(245, 264, 6, 6);
- #eyes
- fill(255, 255, 255);
- ellipse(188, 122, 25, 25);
- ellipse(224, 122, 25, 25);
- #pupils
- fill(0, 0, 0);
- ellipse(188, 122, 10, 10);
- ellipse(224, 122, 10, 10);
- fill(255, 255, 255);
- ellipse(187, 121, 5, 5);
- ellipse(222, 121, 5, 5);
- fill(0, 0, 0);
- #nose
- fill(242, 159, 239);
- triangle(207, 155, 214, 142, 198, 142);
- #mouth
- fill(0, 0, 0);
- ellipse(208, 165, 30, 18);
- #fingers
- ellipse(100, 184, 26, 26);
- ellipse(311, 184, 26, 26);
- ellipse(77, 185, 6, 6);
- ellipse(83, 194, 6, 6);
- ellipse(83, 176, 6, 6);
- ellipse(170, 264, 6, 6);
- ellipse(181, 261, 6, 6);
- ellipse(192, 264, 6, 6);
- ellipse(332, 185, 6, 6);
- ellipse(328, 194, 6, 6);
- ellipse(328, 176, 6, 6);
- popMatrix(); #this essentially resets the origin
- def movedead():
- global vel,pos
- pos.add(vel)
- if (pos.x>width-350):
- vel.x=-1*vel.x
- if(pos.y>height-300):
- vel.y=-1*vel.y
- if(pos.x<-60):
- vel.x=-1*vel.x
- if(pos.y<-70):
- vel.y=-1*vel.y
- #Draw Method
- def draw ():
- background(0)
- deadmau5()
- movedead()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement