Last active
December 19, 2015 15:19
-
-
Save TokOut/a27a422ac7d80b5985ba to your computer and use it in GitHub Desktop.
starwars
This file contains 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
function setup() | |
supportedOrientations(WIDTH) | |
displayMode(OVERLAY) | |
displayMode(FULLSCREEN) | |
y = 0 | |
x = WIDTH/2 | |
s = 50 | |
z = 0.75 | |
mypicture = PCS() | |
end | |
function draw() | |
background(0, 0, 0, 255) | |
if y > HEIGHT + HEIGHT/2 then mypicture:draw() else y = y + z end | |
fill(255, 200, 0, 255) | |
font("AmericanTypewriter") | |
fontSize(25) | |
text("It is a periode of civil war.", x, y) | |
text("Rebel spaceships, striking from a hidden base, have won their first", x, y - 50) | |
text("victory against the evil Galactic Empire. During the battle, Rebel", x, y - 100) | |
text("spies maged to steal secret plans to the Empire's ultimate weapon,", x, y - 150) | |
text("the DEATH STAR, an armored space station with enough power to destroy", x, y - 200) | |
text("an entire planet. Pursued by the Empire's sinister agents, Princess", x, y - 250) | |
text("Leila races home aboard her starships, custodian of the stolen", x, y - 300) | |
text("plans that can save her people and restore freedom in the galaxy...", x, y - 350) | |
fill(255, 255, 255, 255) | |
fontSize(y/50) | |
text("Star Wars @ Codea Competition", WIDTH/2, HEIGHT/1.5) | |
end | |
PCS = class() | |
function PCS:draw() | |
stroke(255, 255, 255, 219) | |
translate(WIDTH/2 - 200, HEIGHT/2 - 200) | |
fill(255, 255, 255, 255) | |
strokeWidth(25) | |
line(0, 0, 250, 150) | |
line(0, 0, 250, 0) | |
line(250, 150, 350, 250) | |
line(250, 0, 350, -50) | |
line(350, -50, 350, 50) | |
line(350, 50, 250, 150) | |
line(350, -50, 500, -50) | |
line(350, 250, 500, 250) | |
line(350, 50, 400, 100) | |
line(400, 100, 500, 100) | |
strokeWidth(15) | |
line(400, 100, 350, 250) | |
line(250, 0, 300, 100) | |
translate(200, 200) | |
translate(0 - WIDTH / 2, 0 - HEIGHT / 2) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment