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

Username:   Password: 
 RegisterRegister   
 Is there a Line.Draw that i can use wiht a return value?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
crimsonXess




PostPosted: Sun Oct 19, 2008 12:50 pm   Post subject: Is there a Line.Draw that i can use wiht a return value?

I'm trying to make a guitar hero type game and for it i need a line that can give me a return value so when i use

if Key_pressed= "j" and line = (oval)% when the person hits the key when the oval is on the line then give the person a point
then
point:=point +1
end if

but the problem is i cant do that because i cant assign a variable to the line Razz, help please
or if you got another way to do this please explain fully


***I'm a noob at this and just started this a while ago , please help if you can and give full explanation*****
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Sun Oct 19, 2008 12:54 pm   Post subject: RE:Is there a Line.Draw that i can use wiht a return value?

Check the Y value of the oval to see if it is equal to the Y value of the line. Of course, this would make it very difficult, so I would suggest checking if the Y is within a certain distance, say, 5 pixels, of the line.
crimsonXess




PostPosted: Sun Oct 19, 2008 5:08 pm   Post subject: Re: Is there a Line.Draw that i can use wiht a return value?

how would i do that?
Tony




PostPosted: Sun Oct 19, 2008 5:19 pm   Post subject: RE:Is there a Line.Draw that i can use wiht a return value?

Sketch this out on paper, and figure out the math from there.

A line has a certain Y value, for the height at which it is drawn.

A circle has a certain Y value, for the position of it's center, at a given frame. The said circle also has a radius.

How would you describe a condition where you are certain that the line is inside the circle?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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  [ 4 Posts ]
Jump to:   


Style:  
Search: