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

Username:   Password: 
 RegisterRegister   
 Problems with cls and text
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
AK.E




PostPosted: Sat Jan 13, 2007 10:50 pm   Post subject: Problems with cls and text

Just one more question.

I have a loop within a loop and it goes something like this

Turing:
loop
    fork level % This is basically displaying text

    loop
        map % Draws a box from 0, 0 to maxx, maxy

        collision := checkCollision

        if collision = true then
            exit
        end if

    end loop

    cls

    var answer : string

    put "What programming language is this game running under?"
    get answer

    if answer = Str.Upper ("TURING") then
        put "good"
        delay (1000)
    end if

end loop


Unfortunately the cls never happens.
The screen never clears.
Just the moment the collision happens everything is stopped and i still see the map which hasn't been cleared but I have to enter the text and I can't see myself inputting it. Shouldn't the put "What programming language is this game running under?" appear over the map even if the cls doesn't work for whatever reason? For some reason it doesn't. Any help would be appreciated.
Sponsor
Sponsor
Sponsor
sponsor
rdrake




PostPosted: Sun Jan 14, 2007 12:28 am   Post subject: RE:Problems with cls and text

Unfortunately since you did not include all of your code, I can not run it to see where it stops. My guess is that no collision occurs, and therefore the loop never exits and thus the cls is not executed. Though if it asks which language this program was written in, then this is not the case.
CodeMonkey2000




PostPosted: Sun Jan 14, 2007 12:47 am   Post subject: RE:Problems with cls and text

Are you useing setscreen("offscrenonly") ? then you need to include View.Update to udate the screen, or else the screen won't change.
AK.E




PostPosted: Sun Jan 14, 2007 8:39 am   Post subject: Re: Problems with cls and text

No the collision did occur and I use View.Set ("offscreenonly") but View.Update doesn't help.

I've attached my code so hopefully you guys can help me now.



TheGame.zip
 Description:
Contains a Turing file and a JPEG

Download
 Filename:  TheGame.zip
 Filesize:  4.84 KB
 Downloaded:  55 Time(s)

CodeMonkey2000




PostPosted: Sun Jan 14, 2007 11:08 am   Post subject: Re: Problems with cls and text

Yes it was a problem with View.Update. Take it out of all the procedures and processes and put only one after
code:
loop
        fork countdown

        loop
            map
            theHero
            move
            bill
            moveBill

that will stop the flicker.
And for the other part use:
code:
var answer : string
        colour (red)
        put "What programming language is this game running under?"
        View.Update
        get answer
        if answer = "TURING" then
            put "good"
            View.Update
also your collision isn't correct.
AK.E




PostPosted: Sun Jan 14, 2007 10:36 pm   Post subject: RE:Problems with cls and text

yes I know the collision has problems but this thing is due tommorow and so I didn't have a lot of time work on it. Afterwards I'll fix it.

Thanks a lot for your help.
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  [ 6 Posts ]
Jump to:   


Style:  
Search: