
-----------------------------------
AK.E
Sat Jan 13, 2007 10:50 pm

Problems with cls and text
-----------------------------------
Just one more question.

I have a loop within a loop and it goes something like this

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.

-----------------------------------
rdrake
Sun Jan 14, 2007 12:28 am

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
Sun Jan 14, 2007 12:47 am

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
Sun Jan 14, 2007 8:39 am

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.

-----------------------------------
CodeMonkey2000
Sun Jan 14, 2007 11:08 am

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 loop
        fork countdown

        loop
            map
            theHero
            move
            bill
            moveBill 
that will stop the flicker. 
And for the other part use: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
Sun Jan 14, 2007 10:36 pm

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.
