We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I just need a bit of help with my code, I basically want my burgers to fill a line and then move down a row so I can repeat the process row by row.
burger = 0
fries = 0
def burgers ():
global burger
x = 0
x2 = 62
y = 1
while x < burger:
fill (243,213,165)
arc(x*x2+50, 55*y, 50, 50, radians (180), radians (360), CHORD)
fill (255, 255, 0)
rect (x*x2+25, 55, 50, 5)
fill (101, 67, 33)
rect (x*x2+22, 60, 57, 10)
fill (243,213,165)
rect (x*x2+25, 70, 50, 12)
x = x +1
def french_fries ():
global fries
x = 0
x2 = 30
while x < fries:
fill (255,0, 0)
rect (x*x2, 25, 25, 25)
fill (255, 255, 0)
text ("F", x*x2 + 10, 42)
rect (x*x2+3, 10, 4, 15)
rect (x*x2+7, 12, 4, 13)
rect (x*x2+11, 8, 4, 17)
rect (x*x2+15, 15, 4, 10)
rect (x*x2+19, 10, 4, 15)
x = x +1
def setup ():
background (255)
size (600, 600)
def keyPressed ():
global burger, fries
if key == "b":
burger += 1
if key == "v":
burger -= 1
if key == "f":
fries += 1
if key == "d":
fries -= 1
def draw ():
global burger, fries
background (255)
for i in range (burger):
burgers ()
if (burger == 9):
y_burger = 100
Answers
I don't know python but
http://py.Processing.org/reference/class.html
http://py.Processing.org/tutorials/objects/