Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 [source][halloween] Draw.Pumpkin
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Tony




PostPosted: Fri Oct 10, 2003 7:43 pm   Post subject: [source][halloween] Draw.Pumpkin

code:

procedure Pumpkin(x:int,y:int,size:int)

const myColor:int := 113

%draw top
Draw.ThickLine(x+round(size/2),y+size,x+round(size*0.6),y+round(size*1.1),round(size/20),green)

%draw bottom half
Draw.FillArc(x+round(size/2),y+round(size/2),round(size/2),round(size/4),180,360,myColor)
%draw top half
Draw.FillArc(x+round(size/2),y+round(size/2),round(size/2),round(size/2),0,180,myColor)

%outline
Draw.Arc(x+round(size/2),y+round(size/2),round(size/2),round(size/4),180,360,black)
Draw.Arc(x+round(size/2),y+round(size/2),round(size/2),round(size/2),0,180,black)

%draw mouth
Draw.FillOval(x+round(size/2),y+round(size/5*2),round(size/4),round(size/10),black)
Draw.FillOval(x+round(size/2),y+round(size/5*2.5),round(size/2),round(size/10),myColor)

%draw teeth
Draw.ThickLine(x+round(size/5*2),y+round(size/2.5),x+round(size/5*2),y+round(size/2.5),round(size/10),myColor)
Draw.ThickLine(x+round(size/5*3),y+round(size/2.5),x+round(size/5*3),y+round(size/2.5),round(size/10),myColor)

%draw left eye
Draw.FillOval(x+round(size/4),y+round(size/3)*2,round(size/10),round(size/10),black)
Draw.FillOval(x+round(size/4)+round(size/15),y+round(size/3)*2-round(size/15),round(size/15),round(size/15),myColor)


%draw right eye
Draw.FillOval(x+round(size/4)*3,y+round(size/3)*2,round(size/10),round(size/10),black)
Draw.FillOval(x+round(size/4)*3-round(size/15),y+round(size/3)*2-round(size/15),round(size/15),round(size/15),myColor)


end Pumpkin


A scalable, already cut pumpkin head for halloween. You're free to use the above procedure in your halloween related submisions.

code:

View.Set("offscreenonly")

for i:50..300
Pumpkin(round(maxx/2)-round(i/2),round(maxy/2)-round(i/2),i)
View.Update
end for

Bat
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
krishon




PostPosted: Sat Oct 11, 2003 10:07 am   Post subject: (No subject)

nice emoticon Very Happy
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: