Text Size
Text Size
Exit Full Screen
Python Mini
Show
Source Code
View Source Code in Full Screen
Open in New Tab
from processing import * from math import cos, sin import webaudio keys = [] camx = 84.872635065 camy = -99.0 camz = 166.519093969 rot = 0 switch = True def setup(): global sus sus = webaudio.Audio('http://collateral.oyosite.com/amongusreport.mp3') sus.play() size(500,500,P3D) def z(): pushMatrix() translate(7.5, -2.5, 0.0) box(4.5, 4.0, 6.5) #das translate(-4.5, -4.0, 0.0) box(4.5, 4.0, 6.5) #dd translate(-5.0, -3.5, 0.0) box(4.5, 4.0, 6.5) #dds translate(-3.5, -4.0, 0.0) box(4.5, 4.0, 6.5) #s translate(5.5, -3.5, 0.0) box(21.0, 4.0, 6.5) #zz translate(0.0, 17.5, 0.0) box(21.0, 4.0, 6.5) #z popMatrix() def cake(): pushMatrix() translate(0.0, -45.5, 0.0) box(2.5, 20.0, 2.0) #candd translate(0.5, 5.0, 0.0) box(2.5, 20.0, 4.0) #d translate(-0.5, 0.0, 0.0) box(4.5, 25.5, 2.5) #candle translate(0.0, 8.0, 0.0) box(6.5, 23.5, 7.5) #as translate(0.0, 16.0, 0.0) box(52.0, 3.5, 47.0) #aa translate(0.0, 4.5, 0.0) box(47.5, 25.5, 44.0) #a translate(0.0, 12.0, 0.0) box(52.0, 10.0, 47.0) #cake popMatrix() def amogus(r=0): pushMatrix() rotate(r) translate(-49.0, -60.0, -31.0) box(18.5, 8.0, 1.0) translate(8.5, -3.0, 0.0) box(18.5, 8.0, 1.0) translate(0.0, 3.5, 0.0) box(18.5, 8.0, 2.0) translate(49.5, -2.5, 8.0) box(17.0, 7.0, 7.0) translate(-30.0, -2.0, -8.0) box(32.0, 11.0, 1.5) translate(0.0, 3.0, 0.0) box(32.0, 11.0, 3.0) translate(15.5, -2.0, 0.0) box(4.0, 23.5, 11.5) translate(20.5, -2.5, -4.0) box(5.5, 15.5, 11.5) translate(-6.0, 1.5, -1.5) box(5.5, 15.5, 11.5) translate(-1.5, 1.0, 5.5) box(23.0, 9.5, 10.5) translate(-4.5, 0.0, -4.0) box(5.5, 15.5, 11.5) translate(6.0, 6.0, 3.5) box(19.0, 7.0, 15.0) popMatrix() def amongbody(r=0): pushMatrix() translate(-49.0, -60.0, -31.0) translate(8.5, -3.0, 0.0) translate(0.0, 3.5, 0.0) translate(49.5, -2.5, 8.0) translate(-30.0, -2.0, -8.0) translate(0.0, 3.0, 0.0) translate(15.5, -2.0, 0.0) translate(20.5, -2.5, -4.0) translate(-6.0, 1.5, -1.5) translate(-1.5, 1.0, 5.5) translate(-4.5, 0.0, -4.0) translate(6.0, 6.0, 3.5) rotate(r) translate(-4.5, 47.0, 24.5) box(16.0, 19.5, 11.0) translate(0.0, 0.0, 14.0) box(16.0, 19.5, 11.0) translate(14.5, -27.5, -7.0) box(10.0, 31.5, 18.0) translate(-27.5, -11.5, 0.0) box(12.5, 13.0, 21.0) translate(13.0, -11.5, 0.0) box(18.0, 10.5, 20.0) translate(0.0, 20.0, 0.0) box(25.5, 44.0, 29.5) popMatrix() def keyPressed(): global keys if keyboard.keyCode not in keys: keys.append(keyboard.keyCode) def keyReleased(): global keys if keyboard.keyCode in keys: keys.remove(keyboard.keyCode) def draw(): global rot, switch global camx, camy, camz if 68 in keys: camx -= PI/100 if 65 in keys: camx += PI/100 camx %= TAU if 83 in keys and camy < 1000: camy += 2 if 87 in keys and camy > -1000: camy -= 2 if 69 in keys and camz < 1000: camz += 2 if 81 in keys and camz > 2: camz -= 2 background(0) lights() camera(cos(camx)*camz, camy, sin(camx)*camz, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) amogus(rot)#rot) amongbody()#rot) pushMatrix() translate(70,70,70) amongbody(4/PI) translate(-30,-70,20) z() translate(-20,-10,0) z() translate(-20,-10,0) z() popMatrix() pushMatrix() translate(-80,-10,-30) #amongbody() cake() popMatrix() if switch: rot -= PI/150 if rot <= -PI/5: switch = False else: rot += PI/150 if rot >= 0: switch = True run()
piickle.py
( around 156 lines python code )
Published By:
luyfru
Published on
2022-05-03T13:07:31Z
Python Mini
- an
OYOclass
application,
own your own class today
.
Run
Result
×
Error message shows here