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

Username:   Password: 
 RegisterRegister   
 Mouse Commands in turing
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
NightStrike64




PostPosted: Fri Dec 06, 2013 6:01 pm   Post subject: Mouse Commands in turing

What is it you are trying to achieve?
I'm trying to make a basic intro to my game, so when you click start or exit it will do something.


What is the problem you are having?
I cant get it to work.


Describe what you have tried to solve this problem
I've gone through a lot of forums and asked some help from friends they didn't know what to do either.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Mousewhere>

Turing:


%Declarations,Music,Background color
process playstuff
    loop
        %Music.PlayFile ("pushthetempo.MP3")
    end loop
end playstuff

fork playstuff
View.Set ("graphics:max;max")
var x2, y2, b : int
var font := Font.New ("Impact:125")
var font2 := Font.New ("Impact:75")
var x, y, c : int
var f : int := 32
colorback (7)
cls



loop

    %Title
    Font.Draw ("Asteroix", maxx div 4 + 50, 500, font, f)
    Draw.Box (553, 320, 726, 230, red)
    Font.Draw ("Play", 550, 240, font2, f)
    Draw.Box (554, 179, 691, 100, red)
    Font.Draw ("Exit", 550, 100, font2, f)

    %Mouse Commands
    mousewhere (x, y, b)
    locate (10, 10)
    color (0)
    put "X:", x
    color (0)
    put "Y", y
    if b = 1 then
        color (0)
        put "mouse clicked"
    else
        color (0)
        put "mouse not clicked"
    end if
   
    %Need Help Here
    mousewhere (x2, y2, b)
    if b = 1 then
        if x2 >= 551 and x2 <= 230 and y2 >= 320 and y2 <= 230 then
         
            color (0)
            put "hello"
        end if
    end if

    %Stars
    %randint (x, 0, maxx)
    % randint (y, 0, maxy)
    %randint (c, 1, 15)
    %delay(50)
    %drawdot (x, y, 0)



    %Color code
    f := f + 1
    delay (5)
    if f > 104 then
        f := 32
    end if

end loop




Please specify what version of Turing you are using
<Turing 4.1.1>
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Fri Dec 06, 2013 6:23 pm   Post subject: RE:Mouse Commands in turing

code:
if x2 >= 551 and x2 <= 230 and y2 >= 320 and y2 <= 230 then


I can't think of a single case where a number would ever be larger than 551 and at the same time less than 230.
NightStrike64




PostPosted: Fri Dec 06, 2013 6:26 pm   Post subject: RE:Mouse Commands in turing

So I would simply change it to >= 551... etc
NightStrike64




PostPosted: Fri Dec 06, 2013 6:28 pm   Post subject: RE:Mouse Commands in turing

or <=*
Insectoid




PostPosted: Fri Dec 06, 2013 6:49 pm   Post subject: RE:Mouse Commands in turing

Why not try it and see?
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  [ 5 Posts ]
Jump to:   


Style:  
Search: