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

Username:   Password: 
 RegisterRegister   
 Need Help With Shoot out Game.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
kamil_360




PostPosted: Wed Dec 13, 2006 11:09 am   Post subject: Need Help With Shoot out Game.

Well what im trying to do is after the user picks his / her location for the ball they will hit the space bar and the ball will then be located in the location that the user has chosen.

the thing is i dont know how to incorporate the fact that the user will hit space bar plus the location they choose to move the ball.


( this program is still in beginging phases of production)

-Q key = top left

-A key = bottom left

-W key = top middle

-s key =bottom middle

-e key = top right

-d key = Bottom Right


code:
loop
    setscreen ("graphics:640;400")
    View.Set ("offscreenonly")
    var side : string
    var x : int := 310
    var y : int := 100
    var key: array char of boolean
   
    drawline (0, 61, maxx, 61, red)     %draws black entry space and instructions
    drawfillbox (0, 0, maxx, 60, black)
    locate (23, 1)
    put "Where Will You like to shoot!"
    locate (24, 1)
    put "Top right 'e' Top Middle 'w' Top Left 'q'"
    drawfillbox (0, 62, maxx, 260, green)     % this is setting up the field and sky
    drawfillbox (0, 260, maxx, 620, blue)
    drawline (160, 363, 480, 363, white)     %this creates the crossbar
    drawfillbox (160, 360, 480, 363, white)
    drawline (483, 240, 483, 363, white)     %this creates the posts
    drawline (157, 240, 157, 363, white)
    drawfillbox (157, 240, 160, 363, white)
    drawfillbox (483, 240, 480, 363, white)     % this builds the frame of the net
    drawline (160, 240, 480, 240, white)
    drawfillbox (160, 241, 480, 240, white)
    drawarc (320, 240, 160, 120, 180, 360, white)     %this is the arc around the net
    drawline (160, 239, 480, 239, red)
    drawline (160, 240, 180, 260, white)
    drawline (480, 240, 460, 260, white)
    drawline (180, 260, 460, 260, white)
    drawline (180, 260, 160, 360, white)
    drawline (460, 260, 480, 360, white)
    Draw.FillOval (x, y, 10, 10, white)
    Input.KeyDown (key)
    if key ('s') then
        y := 260
        Draw.FillOval (x, y, 10, 10, 90)
        locate(1,1)
        put " Aiming straight!"
        delay (5)
    end if
    Input.KeyDown (key)
    if key ('w') then
        y := 345
        Draw.FillOval (x, y, 10, 10, 90)
        locate(1,1)
        put" Aiming for the top of the net! "
        delay (5)
    end if
    Input.KeyDown (key)
    if key('q') then
        y := 345
        x := 175
        Draw.FillOval (x, y, 10, 10, 90)
        locate(1,1)
        put " Aiming for the top left corner of the net! "
        delay (5)
    end if
    Input.KeyDown (key)
    if key ('a') then
        y := 260
        x := 170
        Draw.FillOval (x, y, 10, 10, 90)
        locate(1,1)
        put " Aiming for the bottom left corner of the net! "
        delay (5)   
    end if
    Input.KeyDown (key)
    if key ('e') then
        y := 345
        x := 462
        Draw.FillOval (x, y, 10, 10, 90)
        locate(1,1)
        put " Aiming for the top right corner of the net! "
        delay (5)
        end if 
    Input.KeyDown (key)
    if key ('d') then
        y := 260
        x := 462
        Draw.FillOval (x, y, 10, 10, 90)
        locate(1,1)
        put " Aiming for the bottom right corner of the net! "
        delay (5)
    end if   
    View.Update
end loop

[/code]
Sponsor
Sponsor
Sponsor
sponsor
Ultrahex




PostPosted: Sat Dec 16, 2006 8:44 pm   Post subject: (No subject)

well they click to set ball location correct?

if so, you set a variable(s) to the location they they choose,

then basically "start" so to speak the game or put the ball into action and allow the movement of the ball.

Just An Idea.
kamil_360




PostPosted: Mon Dec 18, 2006 10:28 am   Post subject: (No subject)

Ultrahex wrote:
well they click to set ball location correct?

if so, you set a variable(s) to the location they they choose,

then basically "start" so to speak the game or put the ball into action and allow the movement of the ball.

Just An Idea.


sorry not wat were lookig for
Clayton




PostPosted: Mon Dec 18, 2006 4:20 pm   Post subject: (No subject)

why do they need to press the space key? Just have them input the key related to where they want to start, and be done with it.
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: