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

Username:   Password: 
 RegisterRegister   
 help with making program continue
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
roosterfest123




PostPosted: Wed Jun 08, 2011 3:32 pm   Post subject: help with making program continue

What is the problem you are having?
<hello i cant manage to get the program to display the question at the end of the program if someone can help ill appreciate it, is there a way to clear the screen from not just color but everything?>





Turing:


<View.Set ("offscreenonly")
setscreen ("graphics:max;678;nobuttonbar")
var punch,winner, jump1, kick, man2, man3, man4, duck, hit1 : int
var man5 : int
var health : int
health := 100
var background : int
var count : boolean
var answer:string
var keys : array char of boolean
var x := 1
var y := 1
background := Pic.FileNew ("background.bmp")
winner := Pic.FileNew ("winner.bmp")
jump1 := Pic.FileNew ("jump.bmp")
man2 := Pic.FileNew ("man2.bmp")
duck := Pic.FileNew ("duck.bmp")
man3 := Pic.FileNew ("man3.bmp")
kick := Pic.FileNew ("kick.bmp")
man4 := Pic.FileNew ("man4.bmp")
man5 := Pic.FileNew ("man 5.bmp")
hit1 := Pic.FileNew ("hit1.bmp")
punch := Pic.FileNew ("punch.bmp")
procedure walkRight
    for i : 1 .. 2
        x := x + 70
        if x > 1000 then
            x := 1000
        end if
        cls
        Pic.Draw (background, 1, 1, picXor)
        Pic.Draw (man4, x, y, picMerge)
        View.Update
    end for
end walkRight
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure walkLeft
    for i : 1 .. 2
        x := x - 70
        if x < 0 then
            x := 0
        end if
        cls
        Pic.Draw (background, 1, 1, picXor)
        Pic.Draw (man4, x, y, picMerge)
        View.Update
    end for
end walkLeft

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure jump
    for i : 1 .. 15
        y := y + 15
        cls
        Pic.Draw (background, 1, 1, picXor)
        Pic.Draw (jump1, x, y, picMerge)
        View.Update
    end for
    for i : 1 .. 15
        y := y - 15
        cls
        Pic.Draw (background, 1, 1, picXor)
        Pic.Draw (jump1, x, y, picMerge)
        View.Update
    end for
end jump
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure jump2
    for i : 1 .. 15
        y := y + 15
        x := x + 9
        cls
        if x > 1000 then
            x := 1000
        end if
        Pic.Draw (background, 1, 1, picXor)
        Pic.Draw (jump1, x, y, picMerge)
        View.Update
    end for
    for i : 1 .. 15
        y := y - 15
        x := x + 10
        cls
        if x > 1000 then
            x := 1000
        end if
        Pic.Draw (background, 1, 1, picXor)
        Pic.Draw (jump1, x, y, picMerge)
        View.Update
    end for
end jump2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure jump3
    for i : 1 .. 15
        y := y + 15
        x := x - 9
        cls
        if x < 0 then
            x := 0
        end if
        Pic.Draw (background, 1, 1, picXor)
        Pic.Draw (jump1, x, y, picMerge)
        View.Update
    end for
    for i : 1 .. 15
        y := y - 15
        x := x - 10
        cls
        if x < 0 then
            x := 0
        end if
        Pic.Draw (background, 1, 1, picXor)
        Pic.Draw (jump1, x, y, picMerge)
        View.Update
    end for
end jump3

loop

    Pic.Draw (jump1, x, y, picMerge)
    Input.KeyDown (keys)
    if keys (KEY_UP_ARROW) then
        jump
    end if
    if keys (KEY_RIGHT_ARROW) then
        delay (100)
        walkRight
        delay (50)
        Pic.Draw (man5, x, y, picMerge)
    end if

    if keys (KEY_LEFT_ARROW) then
        delay (100)
        walkLeft
        delay (50)
        Pic.Draw (man5, x, y, picMerge)
    end if
    cls
    Pic.Draw (background, 1, 1, picXor)
    Pic.Draw (man5, x, y, picMerge)
    if keys ('1') then
        cls
        Pic.Draw (background, 1, 1, picXor)
        Pic.Draw (hit1, x, y, picMerge)
        if x >= 750 then
            health := health + 10
        end if
    end if
    if keys ('e') then
        jump2
    end if
    if keys ('q') then
        jump3
    end if
    if keys ('2') then
        cls
        Pic.Draw (background, 1, 1, picXor)
        Pic.Draw (punch, x, y, picMerge)
        if x >= 930 then
            health := health + 5
        end if
    end if
    if keys ('3') then
        cls
        Pic.Draw (background, 1, 1, picXor)
        Pic.Draw (kick, x, y, picMerge)
        if x >= 880 then
            health := health + 5
            end if
    end if
    if keys (KEY_DOWN_ARROW) then
        cls
        Pic.Draw (background, 1, 1, picXor)
        Pic.Draw (duck, x, y, picMerge)
    end if
    Draw.FillBox(1150,650,health,1000,brightred)
    View.Update
    if health = 1150 or health > 1150 then
   
 cls
     Pic.Draw (winner, 1, 1, picXor)
delay(1000)
cls
put"would you like to play again?"
get answer
end if
end loop
       
       
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>

Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Jun 08, 2011 3:37 pm   Post subject: RE:help with making program continue

the question is probably there, but you can't see because
Quote:

View.Set ("offscreenonly")
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
roosterfest123




PostPosted: Wed Jun 08, 2011 3:49 pm   Post subject: Re: help with making program continue

so what can i do, do i have to make buttons??
Tony




PostPosted: Wed Jun 08, 2011 5:05 pm   Post subject: RE:help with making program continue

You would still need to draw the buttons, same as text.
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: