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

Username:   Password: 
 RegisterRegister   
 Turing Project Help!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh pageAdd this topic to your bookmarks (CTRL-D) View next topic
Author Message
WhooliMooli




PostPosted: Fri Jan 17, 2014 10:23 pm   Post subject: Turing Project Help!

Hey, so for my Intro to computer studies course we have to create a pong game for our final program, I was just wondering If anyone could tell me why this does not work, and a solution for this problem?

var scorefont : int := Font.New ("Agency FB:45")

Font.Draw (": ", p1score, 100, 500, scorefont, yellow)
Font.Draw (": ", p2score, 524, 374, scorefont, yellow)
^Turing Is constantly giving me an error for this but I do not no how to fix it, please help!
 
Sponsor
Sponsor
Sponsor
sponsor
Nathan4102




PostPosted: Fri Jan 17, 2014 10:56 pm   Post subject: RE:Turing Project Help!

What's the error say? And can you show us how you declare 'yellow', 'scorefont', and 'p1(1/2)score'?
 
WhooliMooli




PostPosted: Fri Jan 17, 2014 11:26 pm   Post subject: Re: Turing Project Help!

The error says "Call to "draw" has to many parameter", however I need the yellow at the end for the colour of the font.

This is exactly it:
var p1score, p2score : int := 0
var scorefont : int := Font.New ("Agency FB:45")

Font.Draw (": ", p1score, 100, 500, scorefont, yellow)
Font.Draw (": ", p2score, 524, 374, scorefont, yellow)

and if I get rid of the yellow which I need for the color of the text it says "Color value of 5004 is out of bounds. Max color number = 256"
 
Dreadnought




PostPosted: Fri Jan 17, 2014 11:42 pm   Post subject: Re: Turing Project Help!

Your problem is here
Font.Draw (": ", p1score, 100, 500, scorefont, yellow)

It looks like you're trying to draw two strings to the screen, but Font.Draw only draws one string. Try putting them together using +.
 
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh pageAdd this topic to your bookmarks (CTRL-D) View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: