Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setup()
- displayMode(STANDARD)
- parameter("Size",50,500,200)
- parameter("CamHeight", 0, 1000, 300)
- parameter("Angle",-180, 180, 0)
- end
- function draw()
- -- First arg is FOV, second is aspect
- perspective(45, WIDTH/HEIGHT)
- -- Position the camera up and back, look at origin
- camera(0,CamHeight,-300, 0,0,0, 0,1,0)
- -- This sets a dark background color
- background(40, 40, 50)
- -- This sets the line thickness
- strokeWidth(5)
- smooth()
- rectMode(CENTER)
- -- Make a floor
- translate(0,-Size/2,0)
- rotate(Angle,0,1,0)
- rotate(90,1,0,0)
- sprite("SpaceCute:Background", 0, 0, 300, 300)
- -- Rotate and translate the square
- resetMatrix()
- rotate(Angle,0,1,0)
- translate(0, 0, -100)
- fill(44, 97, 161, 255)
- rect(0, 0, Size, Size)
- resetMatrix()
- rotate(Angle,0,1,0)
- fill(191, 26, 26, 255)
- ellipse(0, 0, Size*0.8)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement