Turing Help

Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Locked
KukuriChan
Posts: 13
Joined: Tue Dec 30, 2003 1:41 pm

Turing Help

Post by KukuriChan »

I'm suppose to be doing a dice game during this break but there's something wrong with my program. See, I have a problem with my code. When you choose the play button, it loads the screen instantly but then it goes right to the procedure that tells you how to play and then goes to the next procedure. How do you make it so that the procedure is only active when you choose it? I tried putting it in the conditional loop but there was an error when I did that. :( If anybody can help me I'll be really happy.

Code: Select all

loop
    if Mouse.ButtonMoved ("up") then
        Mouse.ButtonWait ("down", x, y, buttonnumber, buttonupdown)
        if x >= 220 and x <= 300 and y >= 100 and y <= 130 then
            delay (300)
            cls
            Pic.ScreenLoad ("chess-game-carpet600.jpg", 0, 0, picXor)
            exit
        elsif x < 220 and x > 300 and y < 100 and y > 130 then
            return     % goes back to the beginning if out of range of button
        end if
        if x >= 320 and x <= 400 and y >= 100 and y <= 130 then
            exit
        elsif x < 320 and x > 400 and y < 100 and y > 130 then
            return
        end if
        if x >= 420 and x <= 500 and y >= 100 and y <= 130 then
            delay (400)
            Window.Select (helpWindow)
        elsif x < 420 and x > 500 and y < 100 and y < 130 then
            return
        end if
    end if
end loop

drawfillbox (maxx, 0, 600, maxy, grey)
Font.Draw ("Menu", 550, 600, button, 0)
include "proc howtoplay.t"
include "N ame.t"
[code] 

[color=#888888][size=85]Archived topic from Iceteks,  old topic ID:2147, old post ID:18257[/size][/color]
syb
Posts: 222
Joined: Wed Jun 18, 2003 10:12 pm

Turing Help

Post by syb »

Well. I haven't done anything in turing for a bit so... i'll have to think on it. just one thing. Is that all you code if not can you give all of it to me?

Archived topic from Iceteks, old topic ID:2147, old post ID:18277
The wisdom of sight comes from the father of lights
Fat Cat
Posts: 16
Joined: Wed Mar 31, 2004 8:33 pm

Turing Help

Post by Fat Cat »

is the syntax of some your conditional checks appears odd ?;

EG;

elsif x < 320 and x > 400 and y < 100 and y > 130 then
return


[ x can't be <320 AND >400 at the same time can it ? should this be an OR ]


elsif x < 420 and x > 500 and y < 100 and y < 130 then
return


[ x can't be <420 AND >500 at the same time can it ? should this also be an OR statement ]


Archived topic from Iceteks, old topic ID:2147, old post ID:18642
User avatar
Death
Posts: 7919
Joined: Thu Sep 30, 2004 10:12 pm

Turing Help

Post by Death »

Wow, that isn't gonna help me very much. The code displayed IS helpful, but I gotta see what's in the INCLUDE statements as well. More than likely the problem exists in one of those files (Darn Turing, can't even surpass 3000 lines of code without an include statement.) How pitiful.

Archived topic from Iceteks, old topic ID:2147, old post ID:22441
Locked