
-----------------------------------
uberwalla
Tue Aug 22, 2006 5:56 pm

Help get my menu to work better... (more details inside)
-----------------------------------
ok so i have the pong games im working on and i have a menu i created to go through the game.

in the controls sections i have a back type thing that i can't get to work.

if possible could someone try to configure it so it works and tell me so i can imput it into my source code.

o and also after the credits i want it to be able to just go back to the menu if thats at all possible.

thx in advance.

-----------------------------------
NikG
Wed Aug 23, 2006 3:00 pm


-----------------------------------
why did you create another topic?
you could have just added to your [url=http://www.compsci.ca/v2/viewtopic.php?t=13372]old one.

-----------------------------------
uberwalla
Wed Aug 23, 2006 10:01 pm

reply
-----------------------------------
because this is a newer version... And its a totally different problem.

-----------------------------------
Cervantes
Wed Aug 23, 2006 10:45 pm


-----------------------------------
Okay, enough of these threads. I feel it necessary to say that I have no desire to offer help, and I'm one who usually offers help in threads that haven't received it yet.

Why have I no desire to help? Because you make it too difficult. You post your entire code and give a vague description of what you want done. Instead, you should post only the relevant portion of your code and give a detailed and, preferrably, easy to read description of the problem and why you think it is occuring or what you think you can do to fix it.

-----------------------------------
NikG
Thu Aug 24, 2006 2:09 am

Re: reply
-----------------------------------
because this is a newer version... And its a totally different problem.You know... it IS possible to post 2 files (such as your newer version) in that first post.

And it's not a different problem, you mentioned the same thing in that first post too!

-----------------------------------
uberwalla
Thu Aug 24, 2006 10:17 am

reply
-----------------------------------
Cervantes: im sorry but im not very good when it comes to explaining it.
and i posted the whole code because i dont know if i did something wrong somewhere else that caused the problem.

nikg : it isnt the same problem...
from the last post i had trouble because the menu was going into and f****** up the game itself.

what i would like some help on now... is that in the menu i have the section entitled "controls" when i go in i have it that there is a back button sort of thing. I would like it so i can get the back button to work when i hit enter. 

Eg.) I start pong and dont know controls... i go to the controls menu and i look at them then hit enter to get back to the main menu. Instead of having to close the whole app. and restarting it  :? .

So plz cervantes, nikg or anyone plz help me with this.

Im sorry for my bad start coming to this forum. I promise to slow down on my threads, and to explain more.

-----------------------------------
Clayton
Thu Aug 24, 2006 7:30 pm


-----------------------------------
look into forwarding procedures, this allows you to call a procedure from another, even if the called procedure follows the procedure your in (by line number), this way you can have a "controls" proc to display your contol menu, then if enter is pressed go back to the "menu" proc beneath it

have you tried searching before? your question has been asked before, try searching keywords and see what you can come up with before rushing to hit the new topic button

-----------------------------------
uberwalla
Thu Aug 24, 2006 10:02 pm

reply
-----------------------------------
Ok TY.

and sorry again for not searching.

-----------------------------------
uberwalla
Thu Aug 24, 2006 10:33 pm

not working.
-----------------------------------
ok so i tried forwarding my procedures but it says exactly like it always says, "procedures can only be declared at the program, module, or monitor level"

i dont understand.

-----------------------------------
uberwalla
Thu Aug 24, 2006 10:47 pm

reply
-----------------------------------
ok this is what i have. i can't seem to understand the forwarding. the code is kinda long sorry, but its as short as i could make it where i can pinpoint the problem.


var font := Font.New ("Comicsans:14:bold")
var winID, winID1, winID2, winID3, winID4, maxnumber, minnumber, changeso, select, answer : int
var font4 := Font.New ("Comicsans:12:bold,underline")
var font5 := Font.New ("Comicsans:12:bold")
var font6 := Font.New ("Comicsans:12")
var keys : array char of boolean
var altered : int := 1
winID := Window.Open ("graphics:500;400;nobuttonbar;position:middle;center;title:Pong!")
procedure selectoptions
    if keys (KEY_UP_ARROW) then
        if altered = minnumber then
            altered := maxnumber
        else
            altered -= changeso
        end if
        delay (150)
    end if
    if keys (KEY_DOWN_ARROW) then
        if altered = maxnumber then
            altered := minnumber
        else
            altered += changeso
        end if
        delay (150)
    end if
end selectoptions

procedure drawoptions
    Font.Draw ("Start", 220, 200, font, black)
    Font.Draw ("Controls", 220, 150, font, black)
    Font.Draw ("Credits", 220, 100, font, black)
    Font.Draw ("Quit", 220, 50, font, black)
end drawoptions

process controls
    loop
        Font.Draw ("Player 1", 145, 182, font4, black)
        Font.Draw ("Player 2", 295, 182, font4, black)
        Font.Draw ("Up:", 145, 145, font5, black)
        Font.Draw ("Down:", 145, 90, font5, black)
        Font.Draw ("Up:", 295, 145, font5, black)
        Font.Draw ("Down:", 295, 90, font5, black)
        Font.Draw ("W", 145, 125, font6, black)
        Font.Draw ("S", 145, 70, font6, black)
        Font.Draw ("Up Arrow", 295, 125, font6, black)
        Font.Draw ("Down Arrow", 295, 70, font6, black)
        drawline (100, 50, 400, 50, black)
        drawline (100, 200, 400, 200, black)
        drawline (100, 50, 100, 200, black)
        drawline (400, 50, 400, 200, black)
        drawline (100, 175, 400, 175, black)
        drawline (250, 200, 250, 50, black)
        locate (maxrow - 1, maxcol div 2 - 2)
        Font.Draw ("Back", 230, 19, font, black)
        drawfilloval (210, 25, 6, 6, black)
        Input.KeyDown (keys)
        if keys (KEY_ENTER) then
            delay (150)
            exit
        end if
        View.Update
    end loop
end controls

procedure pong
    loop
        drawoptions
        Input.KeyDown (keys)
        maxnumber := 4
        minnumber := 1
        changeso := 1
        selectoptions
        select := altered
        if select = 1 then
            drawfilloval (200, 205, 6, 6, black)
            drawfilloval (200, 155, 6, 6, white)
            drawfilloval (200, 105, 6, 6, white)
            drawfilloval (200, 55, 6, 6, white)
        elsif select = 2 then
            drawfilloval (200, 205, 6, 6, white)
            drawfilloval (200, 155, 6, 6, black)
            drawfilloval (200, 105, 6, 6, white)
            drawfilloval (200, 55, 6, 6, white)
        elsif select = 3 then
            drawfilloval (200, 205, 6, 6, white)
            drawfilloval (200, 155, 6, 6, white)
            drawfilloval (200, 105, 6, 6, black)
            drawfilloval (200, 55, 6, 6, white)
        elsif select = 4 then
            drawfilloval (200, 205, 6, 6, white)
            drawfilloval (200, 155, 6, 6, white)
            drawfilloval (200, 105, 6, 6, white)
            drawfilloval (200, 55, 6, 6, black)
        end if
        if keys (KEY_ENTER) then
            if select = 2 then
                %fork click
                cls
                Window.Close (winID)
                winID3 := Window.Open ("graphics:500;400;nobuttonbar;position:middle;center;title:Pong Controls")
                drawfillbox (0, 0, maxx, maxy, 0)
                %Pic.Draw (pic2, 100, 200, 0)
                fork controls
                exit
            end if
        end if
    end loop
end pong

pong


-----------------------------------
richcash
Thu Aug 24, 2006 11:11 pm


-----------------------------------
1. Don't use a process for your controls (processes are better to be avoided!). Turn your controls process into a procedure (and don't fork it, just call it normally, obviously!)

2. Take the exit statement out of your pong procedure (right under where you previously forked controls).

3. Add a cls after your delay (150) in your controls procedure (line 58).

That should work!

-----------------------------------
uberwalla
Thu Aug 24, 2006 11:39 pm

reply
-----------------------------------
WOW! it works :D

thx man.

sorry everyone for my annoyance :?

-----------------------------------
uberwalla
Thu Aug 24, 2006 11:51 pm

reply
-----------------------------------
nvm sorry guys im back again.
richcash ur idea worked very well, ty.

But when i added it to the rest of my program when i hit enter for the back button it goes back to the menu and its a white screen with dots that move :?

its really long but ill post it so u can possibly help me out with anything else i may have done wrong so i can learn more :D



var winID, winID1, winID2, winID3, winID4, maxnumber, minnumber, changeso, select, answer : int
var altered : int := 1
var keys : array char of boolean
var chars : array char of boolean
var font := Font.New ("Comicsans:14:bold")
var font1 := Font.New ("Fixedsys:30")
var font2 := Font.New ("Fixedsys:12")
var font3 := Font.New ("Fixedsys:16")
var font4 := Font.New ("Comicsans:12:bold,underline")
var font5 := Font.New ("Comicsans:12:bold")
var font6 := Font.New ("Comicsans:12")
var font7 := Font.New ("Continuum Light:14:bold")
var font8 := Font.New ("Continuum Light:14:italic")
var pic1 : int := Pic.FileNew ("Pong/PONG.bmp")
var pic2 : int := Pic.FileNew ("Pong/PONGcontrols.bmp")
var spd : int := 3
var x : int := 320
var y : int := 200
var a : int := +1
var b : int := -1
var y2, y1 : int := 230
var rx : real
var ry : real
var move : int := 1
var ply : int := 1
var p1, p2 : int := 0
var s : int := 5
var cp : int := 2
var cs : int := 4
var fscredits : int
var fontclr : int
var change : int
var heading, temp : string := " "
var credited : flexible array 1 .. 0 of string
var starx, stary, starspeed : array 1 .. 120 of int
var endtime : int

winID := Window.Open ("graphics:500;400;nobuttonbar;position:middle;center;title:Pong!")
drawfillbox (0, 0, maxx, maxy, 7)
%Pic.Draw (pic1, 100, 200, 0)

process scoreboard
    locate (2, 13)
    put p2
    locate (2, maxcol - 3)
    put p1
    Draw.Box (3, maxy - 40, maxx - 3, maxy - 3, black)
    Font.Draw ("Pong!", 308, maxy - 25, font2, black)
    Font.Draw ("Player 1:", 15, maxy - 27, font2, black)
    Font.Draw ("Player 2:", maxx - 115, maxy - 27, font2, black)
end scoreboard

%process click
   % Music.PlayFile ("Pong/click.wav")
%end click

procedure drawoptions
    Font.Draw ("Start", 220, 200, font, white)
    Font.Draw ("Controls", 220, 150, font, white)
    Font.Draw ("Credits", 220, 100, font, white)
    Font.Draw ("Quit", 220, 50, font, white)
end drawoptions

procedure selectoptions
    if keys (KEY_UP_ARROW) then
        if altered = minnumber then
            altered := maxnumber
        else
            altered -= changeso
        end if
        delay (150)
    end if
    if keys (KEY_DOWN_ARROW) then
        if altered = maxnumber then
            altered := minnumber
        else
            altered += changeso
        end if
        delay (150)
    end if
end selectoptions

process ball
    loop
        fork scoreboard
        Draw.FillBox (0, 0, 640, 400, black)
        Draw.FillOval (320, 200, 10, 10, white)
        ply := 1
        delay (1000)
        fork scoreboard
        y := 200
        x := 320
        rand (rx)
        if rx >= 0.5 then
            a := +1
        else
            a := -1
        end if

        rand (ry)
        if ry >= 0.5 then
            b := +1
        else
            b := -1
        end if

        move := 1

        loop
            Draw.FillOval (x, y, 10, 10, white)
            delay (spd)
            Draw.FillOval (x, y, 10, 10, black)
            y := y - b
            x := x - a
            if y >= 390 then
                b := +1
            elsif y = 612 then
                if y = y1 - 67 then
                    a := +1
                end if
            end if
            if x >= 629 then
                Draw.FillOval (x, y, 10, 10, white)
                ply := 0
                move := 0
                p2 := p2 + 1
                exit
            end if
            if x  31 then
                Font.Draw (heading, maxx div 2 - Font.Width (heading, font7) div 2, maxy div 2 + 25 * (upper (credited) - 1) div 2, font7, 31)
                for i : 1 .. upper (credited)
                    Font.Draw (credited (i), maxx div 2 - Font.Width (credited (i), font8) div 2, maxy div 2 + (upper (credited) - 1 - i - upper (credited) div 2) * 25, font8, 31)
                end for
            else
                Font.Draw (heading, maxx div 2 - Font.Width (heading, font7) div 2, maxy div 2 + 25 * (upper (credited) - 1) div 2, font7, fontclr div 3)
                for i : 1 .. upper (credited)
                    Font.Draw (credited (i), maxx div 2 - Font.Width (credited (i), font8) div 2, maxy div 2 + (upper (credited) - 1 - i - upper (credited) div 2) * 25, font8, fontclr div 3)
                end for
            end if
        end if

        fontclr += change
        if fontclr = 200 then
            change := -2
        elsif fontclr = -20 then
            change := 2
        end if

        View.Update
        delay (30)

        drawfillbox (0, 60, 600, 340, 7)
        exit when hasch

        if temp = "---" then
            exit when (Time.Elapsed - endtime) > 0000
        end if
    end loop

    Font.Free (font7)
    Font.Free (font8)
    close : fscredits
end creditswatch

procedure controls
    loop
        Font.Draw ("Player 1", 145, 182, font4, white)
        Font.Draw ("Player 2", 295, 182, font4, white)
        Font.Draw ("Up:", 145, 145, font5, white)
        Font.Draw ("Down:", 145, 90, font5, white)
        Font.Draw ("Up:", 295, 145, font5, white)
        Font.Draw ("Down:", 295, 90, font5, white)
        Font.Draw ("W", 145, 125, font6, white)
        Font.Draw ("S", 145, 70, font6, white)
        Font.Draw ("Up Arrow", 295, 125, font6, white)
        Font.Draw ("Down Arrow", 295, 70, font6, white)
        drawline (100, 50, 400, 50, white)
        drawline (100, 200, 400, 200, white)
        drawline (100, 50, 100, 200, white)
        drawline (400, 50, 400, 200, white)
        drawline (100, 175, 400, 175, white)
        drawline (250, 200, 250, 50, white)
        locate (maxrow - 1, maxcol div 2 - 2)
        Font.Draw ("Back", 230, 19, font, white)
        drawfilloval (210, 25, 6, 6, white)
        Input.KeyDown (keys)
        if keys (KEY_ENTER) then
            delay (150)
            cls
            exit
        end if
        View.Update
    end loop
end controls

procedure pong
    loop
        drawoptions
        Input.KeyDown (keys)
        maxnumber := 4
        minnumber := 1
        changeso := 1
        selectoptions
        select := altered
        if select = 1 then
            drawfilloval (200, 205, 6, 6, white)
            drawfilloval (200, 155, 6, 6, black)
            drawfilloval (200, 105, 6, 6, black)
            drawfilloval (200, 55, 6, 6, black)
        elsif select = 2 then
            drawfilloval (200, 205, 6, 6, black)
            drawfilloval (200, 155, 6, 6, white)
            drawfilloval (200, 105, 6, 6, black)
            drawfilloval (200, 55, 6, 6, black)
        elsif select = 3 then
            drawfilloval (200, 205, 6, 6, black)
            drawfilloval (200, 155, 6, 6, black)
            drawfilloval (200, 105, 6, 6, white)
            drawfilloval (200, 55, 6, 6, black)
        elsif select = 4 then
            drawfilloval (200, 205, 6, 6, black)
            drawfilloval (200, 155, 6, 6, black)
            drawfilloval (200, 105, 6, 6, black)
            drawfilloval (200, 55, 6, 6, white)
        end if
        if keys (KEY_ENTER) then
            if select = 1 then
                %fork click
                cls
                font1 := Font.New ("Fixedsys:30")
                font2 := Font.New ("Fixedsys:12")
                font3 := Font.New ("Fixedsys:16")
                Font.Draw ("                Select Opponent:", 50, 305, font2, 7)
                Font.Draw ("                1) Computer", 50, 285, font2, 7)
                Font.Draw ("                2) Another Player", 50, 265, font2, 7)
                locate (25, 1)
                get answer
                if answer = 1 then
                    %fork click
                    cp := 1
                elsif answer = 2 then
                  %  fork click
                    cp := 2
                end if
                cls
                if cp = 1 then
                    Font.Draw (" Select The Computer's Skill Level:", 110, 305, font2, 7)
                    Font.Draw ("1) Beginnner", 110, 285, font2, 7)
                    Font.Draw ("2) Average", 110, 265, font2, 7)
                    Font.Draw ("3) Pro", 110, 245, font2, 7)
                    locate (25, 1)
                    get answer
                    if answer = 1 then
                       % fork click
                        cs := 5
                    elsif answer = 2 then
                       % fork click
                        cs := 3
                    elsif answer = 3 then
                       % fork click
                        cs := 2
                    end if
                    cls
                end if
                Font.Draw (" At what speed do u want to play?", 110, 305, font2, 7)
                Font.Draw ("1) slow", 110, 285, font2, 7)
                Font.Draw ("2) Average", 110, 265, font2, 7)
                Font.Draw ("3) Fast", 110, 245, font2, 7)
                locate (25, 1)
                get answer
                if answer = 1 then
                   % fork click
                    spd := 4
                elsif answer = 2 then
                    %fork click
                    spd := 3
                elsif answer = 3 then
                    %fork click
                    spd := 2
                end if
                cls
                Font.Draw ("What score would you like to play to?", 110, 300, font2, 7)
                locate (25, 1)
                get answer
               % fork click
                s := answer
                cls
                Window.Close (winID)
                winID2 := Window.Open ("graphics:640;457;nobuttonbar;position:middle;center;title:Pong!")
                fork game
                exit
            end if
            if select = 2 then
               % fork click
                cls
                Window.Close (winID)
                winID3 := Window.Open ("graphics:500;400;nobuttonbar;position:middle;center;title:Pong Controls")
                drawfillbox (0, 0, maxx, maxy, 7)
               % Pic.Draw (pic2, 100, 200, 0)
                controls
            end if
            if select = 3 then
               % fork click
                cls
                Window.Close (winID)
                winID3 := Window.Open ("graphics:500;400;nobuttonbar;position:middle;center;title:Pong Credits")
                creditswatch
                exit
            end if
            if select = 4 then
                %fork click
                Window.Close (winID)
                exit
            end if
        end if
    end loop
end pong

pong



i put the "%" in front of the pics and the sounds so if u want to run it to see what i mean.

sorry again for the long code

-----------------------------------
Ultrahex
Sat Aug 26, 2006 10:42 pm


-----------------------------------
Ok There appears to be something COMPLETELY wrong with the last thing you posted above ^ the sourcecode i tried to run it but when i hit back the screen goes complete white with 3 dots (black) you probably forgot to refill in the back black or something along those lines.

i have also wondered about a few things like why you have 4 winID's im not sure if you are using them but in reality i think every single turing program only needs one (except the odd one like that 3D model editor i believe made back [Was That in Turing?] well anyhow)

ill update another post like this one in a little bit im tired now so i was just putting feedback in at the moment.

Peace, Alex

-----------------------------------
Ultrahex
Sun Aug 27, 2006 1:14 am


-----------------------------------
Ok, here is your program AGAIN


var winID, maxnumber, minnumber, changeso, select, answer : int
var altered : int := 1
var keys : array char of boolean
var chars : array char of boolean
var font := Font.New ("Comicsans:14:bold")
var font1 := Font.New ("Fixedsys:30")
var font2 := Font.New ("Fixedsys:12")
var font3 := Font.New ("Fixedsys:16")
var font4 := Font.New ("Comicsans:12:bold,underline")
var font5 := Font.New ("Comicsans:12:bold")
var font6 := Font.New ("Comicsans:12")
var font7 := Font.New ("Continuum Light:14:bold")
var font8 := Font.New ("Continuum Light:14:italic")
var pic1 : int := Pic.FileNew ("Pong/PONG.bmp")
var pic2 : int := Pic.FileNew ("Pong/PONGcontrols.bmp")
var spd : int := 3
var x : int := 320
var y : int := 200
var a : int := +1
var b : int := -1
var y2, y1 : int := 230
var rx : real
var ry : real
var move : int := 1
var ply : int := 1
var p1, p2 : int := 0
var s : int := 5
var cp : int := 2
var cs : int := 4
var fscredits : int
var fontclr : int
var change : int
var heading, temp : string := " "
var credited : flexible array 1 .. 0 of string
var starx, stary, starspeed : array 1 .. 120 of int
var endtime : int
select := 0
var menuSection := "MainMenu"
winID := Window.Open ("graphics:500;400;nobuttonbar;position:middle;center;title:Pong!")
View.Set ("offscreenonly") %OffScreen Buffering
drawfillbox (0, 0, maxx, maxy, 7)
%Pic.Draw (pic1, 100, 200, 0)

procedure scoreboard
    locate (2, 13)
    put p2
    locate (2, maxcol - 3)
    put p1
    Draw.Box (3, maxy - 40, maxx - 3, maxy - 3, black)
    Font.Draw ("Pong!", 308, maxy - 25, font2, black)
    Font.Draw ("Player 1:", 15, maxy - 27, font2, black)
    Font.Draw ("Player 2:", maxx - 115, maxy - 27, font2, black)
end scoreboard

process ball
    loop
        scoreboard
        Draw.FillBox (0, 0, 640, 400, black)
        Draw.FillOval (320, 200, 10, 10, white)
        ply := 1
        delay (1000)
        y := 200
        x := 320
        rand (rx)
        if rx >= 0.5 then
            a := +1
        else
            a := -1
        end if

        rand (ry)
        if ry >= 0.5 then
            b := +1
        else
            b := -1
        end if

        move := 1

        loop
            Draw.FillOval (x, y, 10, 10, white)
            delay (spd)
            Draw.FillOval (x, y, 10, 10, black)
            y := y - b
            x := x - a
            if y >= 390 then
                b := +1
            elsif y = 612 then
                if y = y1 - 67 then
                    a := +1
                end if
            end if
            if x >= 629 then
                Draw.FillOval (x, y, 10, 10, white)
                ply := 0
                move := 0
                p2 := p2 + 1
                exit
            end if
            if x  31 then
                Font.Draw (heading, maxx div 2 - Font.Width (heading, font7) div 2, maxy div 2 + 25 * (upper (credited) - 1) div 2, font7, 31)
                for i : 1 .. upper (credited)
                    Font.Draw (credited (i), maxx div 2 - Font.Width (credited (i), font8) div 2, maxy div 2 + (upper (credited) - 1 - i - upper (credited) div 2) * 25, font8, 31)
                end for
            else
                Font.Draw (heading, maxx div 2 - Font.Width (heading, font7) div 2, maxy div 2 + 25 * (upper (credited) - 1) div 2, font7, fontclr div 3)
                for i : 1 .. upper (credited)
                    Font.Draw (credited (i), maxx div 2 - Font.Width (credited (i), font8) div 2, maxy div 2 + (upper (credited) - 1 - i - upper (credited) div 2) * 25, font8, fontclr div 3)
                end for
            end if
        end if

        fontclr += change
        if fontclr = 200 then
            change := -2
        elsif fontclr = -20 then
            change := 2
        end if

        View.Update
        delay (30)

        drawfillbox (0, 60, 600, 340, 7)
        exit when hasch

        if temp = "---" then
            exit when (Time.Elapsed - endtime) > 3000
        end if
    end loop
    close : fscredits
    menuSection := "MainMenu"
end creditswatch

/*
 You May Feel To Rather Seperate Each Sections and Run There
 Procedures From Inside the Case Instead of Putting The Commands Within!
 */


loop
    drawfillbox (0, 0, maxx, maxy, black) %Makes Background Black
    Window.Set(winID,"graphics:500;400;nobuttonbar;position:middle;center;title:Pong!,offscreenonly")
    case menuSection of
        label "MainMenu" :
            Font.Draw ("PONG!!!",150,300,font1,white)
            Font.Draw ("Start", 220, 200, font, white)
            Font.Draw ("Controls", 220, 150, font, white)
            Font.Draw ("Credits", 220, 100, font, white)
            Font.Draw ("Quit", 220, 50, font, white)

            Input.KeyDown (keys)

            %Movement Up and Down On Menu
            delay (100) %Delay So Doesn't Go Extremely Fast (Makes Easier to Select in Menu)
            if keys (KEY_UP_ARROW) then
                select -= 1
            end if
            if keys (KEY_DOWN_ARROW) then
                select += 1
            end if
            select := select mod 4 %Note 4 is Your Max + 1, Starting at 0, so 0..3 it goes through

            %You Were Drawing White on Black Background, Not Quite Sure Why...
            if select = 0 then
                drawfilloval (200, 205, 6, 6, white)
            elsif select = 1 then
                drawfilloval (200, 155, 6, 6, white)
            elsif select = 2 then
                drawfilloval (200, 105, 6, 6, white)
            elsif select = 3 then
                drawfilloval (200, 55, 6, 6, white)
            end if

            if keys (KEY_ENTER) then
                %fork click
                if select = 0 then
                    View.Set ("nooffscreenonly")
                    loop
                        cls
                        Font.Draw ("                Select Opponent:", 50, 305, font2, black)
                        Font.Draw ("                1) Computer", 50, 285, font2, black)
                        Font.Draw ("                2) Another Player", 50, 265, font2, black)
                        locate (25, 1)
                        get cp
                        %fork click
                        if cp = 1 or cp = 2 then
                            exit
                        end if
                    end loop
                    if cp = 1 then
                        loop
                            cls
                            Font.Draw (" Select The Computer's Skill Level:", 110, 305, font2, 7)
                            Font.Draw ("1) Beginnner", 110, 285, font2, 7)
                            Font.Draw ("2) Average", 110, 265, font2, 7)
                            Font.Draw ("3) Pro", 110, 245, font2, 7)
                            locate (25, 1)
                            get cs
                            %fork click
                            case cs of
                                label 1 :
                                    cs := 5
                                    exit
                                label 2 :
                                    cs := 3
                                    exit
                                label 3 :
                                    cs := 2
                                    exit
                                label :
                            end case
                        end loop
                    end if
                    loop
                        cls
                        Font.Draw (" At what speed do u want to play?", 110, 305, font2, 7)
                        Font.Draw ("1) Fast", 110, 285, font2, 7)
                        Font.Draw ("2) Average", 110, 265, font2, 7)
                        Font.Draw ("3) Slow", 110, 245, font2, 7)
                        locate (25, 1)
                        get spd
                        %fork click
                        if spd >= 1 and spd 