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

Username:   Password: 
 RegisterRegister   
 Turing Help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
zaner9942




PostPosted: Tue May 14, 2013 6:24 pm   Post subject: Turing Help

Hello I am a new student to programming and am in grade 10 and just started programming this year, I only have some experience in VB and am now just learning turing.
the problem that i am having is that for my beginners programming course we are required to create a turing program that has a least five objects and two that move.
So far I beginning going but i am stuck on the part where i can make the background change between night and day, and also a stick figure that moves with the arrow keys.
i have below the code that i have write,

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Author : Zanie Hussanie
%Date: May, 8 2013
%Filename" Program.t
%Description:to create a digital landscape
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
View.Set (" graphics : 600; 400, offscreenonly")%
Draw.FillBox (0,60,700,400,blue)% draw sky
Draw.FillBox (0,0,700,60,green)% draw ground
Draw.ThickLine( 70,80,70,10,20,brown)% tree
Draw.FillOval(580,350,40,40,yellow)% drawing sun
Draw.FillOval(90,90,20,20,green)% tree leaves
Draw.FillOval(70,70,20,20,green)% tree leaves
Draw.FillOval(50,80,20,20,green)% tree leaves
Draw.FillOval(60,100,20,20,green)% tree leaves
Draw.FillStar(20,350,0,400,red)% for loop to night
Draw.Line(420,30,460,90,red)% draw stick figure
Draw.Line(460,90,500,30,red)% draw stick figure
%Draw.Line(,red)

if anyone would be kind as to help/teach on me how to do the above stated tasks that would be great,
thank you to all the people that help me in advance!
Sponsor
Sponsor
Sponsor
sponsor
Nathan4102




PostPosted: Tue May 14, 2013 6:44 pm   Post subject: RE:Turing Help

To make it change between night and day, You could have a sun and moon travelling in a circle, each rising after the other sets, hidden behind the ground while set. That would be some trig work though, you could just have the sun and moon move right across the sky instead.

For the stick man, I'd suggest learning how to control just a static stick man with the arrows first. Then after that, you can add a walking motion with legs/arms after that. Look into Getch/Hasch, or Input.KeyDown.
Panphobia




PostPosted: Tue May 14, 2013 6:52 pm   Post subject: RE:Turing Help

Ok so first of all, if you want anything to change or move while the program is running you need a loop. Also secondly if you want an object to move you cannot represent their x and y values as constants e.g.(7,580,1) you have to use variables. After you have done these things, think about when you want it to change from day to night, and try to figure out an appropriate if statement for that.
zaner9942




PostPosted: Thu May 16, 2013 12:14 pm   Post subject: RE:Turing Help

Thanks for replying, just a quick question though, what is the best way to make the program interactive for the user, thanks!
Nathan4102




PostPosted: Thu May 16, 2013 12:49 pm   Post subject: RE:Turing Help

You could have an option to set the time, that would be pretty neat. Maybe if you want to get really crazy, you can make a scenery editor.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: