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

Username:   Password: 
 RegisterRegister   
 I need help, someone please help me.....
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
G-lant




PostPosted: Thu May 20, 2004 3:13 pm   Post subject: I need help, someone please help me.....

Are YOU THAT PRO?


Ok I cant seem to get my Player process to work without my Playsel process. The just dont work with out each other. Can some one see whats wrong and maby, kinda, fix it for me. Confused please?
code:
% The "GUI.CreateMenu" program.
import GUI
%Pic.ScreenLoad ("C:/game/Map1.jpg", 0, 0, picCopy)
View.Set ("graphics 640, 480")
View.Set ("nocursor")
var first, second : int                 % The menus.
var item : array 1 .. 4 of int         % The menu items.
var name : array 1 .. 4 of string (20) :=
    init ("Quit", "Map", "Player", "Player select")
%(, "B", "---", "C", "D",
%"Disable B Menu Item", "Enable B Menu Item", "---",
%"Disable Second Menu", "Enable Second Menu")
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

procedure MenuSelected
    for i : 1 .. 4
        if item (i) = GUI.GetEventWidgetID then
            Text.Locate (maxrow, 1)
            put name (i) + " selected option              " ..
        end if
    end for
end MenuSelected

procedure Map
    for i : 1 .. 4
        if item (i) = GUI.GetEventWidgetID then
            Text.Locate (maxrow, 1)
            put name (i) + " selected option              " ..
        end if
    end for
end Map

procedure Playsel
    for i : 1 .. 4
        if item (i) = GUI.GetEventWidgetID then
            cls
            Text.Locate (maxrow, 1)
            put name (i) + " Test                          " ..
        end if
    end for
end Playsel

procedure Player
    for i : 1 .. 4
        if item (i) = GUI.GetEventWidgetID then
            Text.Locate (maxrow, 1)
            put name (i) + "s selected option              " ..
            delay (200)
            Playsel
        end if
    end for
end Player



% Create the menus
first := GUI.CreateMenu ("Game")
item (1) := GUI.CreateMenuItem (name (1), GUI.Quit)
item (2) := GUI.CreateMenuItem (name (2), Map)
item (3) := GUI.CreateMenuItem (name (3), Player)
%item (4) := GUI.CreateMenuItem (name (4), Playsel)

loop
    exit when GUI.ProcessEvent
end loop

Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Thu May 20, 2004 6:23 pm   Post subject: (No subject)

you have to chage the number of indexs your are looking throw in your item array.

like so:

code:

% The "GUI.CreateMenu" program.
import GUI
%Pic.ScreenLoad ("C:/game/Map1.jpg", 0, 0, picCopy)
View.Set ("graphics 640, 480")
View.Set ("nocursor")
var first, second : int                 % The menus.
var item : array 1 .. 3 of int         % The menu items.
var name : array 1 .. 4 of string (20) :=
    init ("Quit", "Map", "Player", "Player select")
%(, "B", "---", "C", "D",
%"Disable B Menu Item", "Enable B Menu Item", "---",
%"Disable Second Menu", "Enable Second Menu")
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

procedure MenuSelected
    for i : 1 .. 3
        if item (i) = GUI.GetEventWidgetID then
            Text.Locate (maxrow, 1)
            put name (i) + " selected option              " ..
        end if
    end for
end MenuSelected

procedure Map
    for i : 1 .. 3
        if item (i) = GUI.GetEventWidgetID then
            Text.Locate (maxrow, 1)
            put name (i) + " selected option              " ..
        end if
    end for
end Map

procedure Playsel
    for i : 1 .. 3
        if item (i) = GUI.GetEventWidgetID then
            cls
            Text.Locate (maxrow, 1)
            put name (i) + " Test                          " ..
        end if
    end for
end Playsel

procedure Player
    for i : 1 .. 3
       if item (i) = GUI.GetEventWidgetID then
            Text.Locate (maxrow, 1)
            put name (i) + "s selected option              " ..
            delay (200)
            Playsel
        end if
    end for
end Player



% Create the menus
first := GUI.CreateMenu ("Game")
item (1) := GUI.CreateMenuItem (name (1), GUI.Quit)
item (2) := GUI.CreateMenuItem (name (2), Map)
item (3) := GUI.CreateMenuItem (name (3), Player)
%item (4) := GUI.CreateMenuItem (name (4), Playsel)

loop
    exit when GUI.ProcessEvent
end loop
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
G-lant




PostPosted: Fri May 21, 2004 3:24 pm   Post subject: (No subject)

Ok thanks man, that helps alot. ^^
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  [ 3 Posts ]
Jump to:   


Style:  
Search: