
-----------------------------------
darkdwight7
Thu Apr 14, 2011 1:36 pm

advice for turing games ie (risk)
-----------------------------------
i would like some advice on what to do with this game im trying to make all i want is to now how to attack another country i have no guys yet ok accually this is what i asking i want to now how to press 1 button like alaska then NWT then somthing happend so i can attack other country thxs  :mrgreen and i added the pic and here the code
import GUI

var window := Window.Open ("graphics:1227;733")
Pic.ScreenLoad ("graphics/risks.bmp", 0, 0, 0)
var alaska, clear, NWT, greenland, easternCAN, MIDCAN, westernCan, westernUSA, eastUSA,
    mexico, brazil, Argen, Chil, ven, AFIC, SAfrica, EAfrica, mad, Congo, egypt, Middlee,
    sEur, wEur, russia, nEur, brit, scan, ice, ind, siam, chin, jap, kam, yak, irk, mog,
    kaz, ural, sib, Ind, newgu, eastAus, westAus : int
    
var activeTool := "place"
var mx, my, button : int
proc Pencil
    activeTool := "pencil"
end Pencil

alaska := GUI.CreateButton (50, 650, 0, "Alaska", Pencil)
NWT := GUI.CreateButton (155, 640, 0, "NWT", Pencil)
greenland := GUI.CreateButton (415, 680, 0, "Greenland", Pencil)
easternCAN := GUI.CreateButton (280, 590, 0, "EastCAN", Pencil)
MIDCAN := GUI.CreateButton (200, 600, 0, "Ontario", Pencil)
westernCan := GUI.CreateButton (108, 600, 0, "WestCan", Pencil)
westernUSA := GUI.CreateButton (85, 545, 0, "WestUSA", Pencil)
eastUSA := GUI.CreateButton (190, 530, 0, "EastUSA", Pencil)
mexico := GUI.CreateButton (120, 450, 0, "Mexico", Pencil)
brazil := GUI.CreateButton (315, 300, 0, "Brazil", Pencil)
Argen := GUI.CreateButton (255, 190, 0, "Argentina", Pencil)
Chil := GUI.CreateButton (260, 280, 0, "Peru", Pencil)
ven := GUI.CreateButton (240, 390, 0, "Venezuela", Pencil)
AFIC := GUI.CreateButton (510, 440, 0, "WestAfrica", Pencil)
SAfrica := GUI.CreateButton (610, 260, 0, "SouthAfrica", Pencil)
EAfrica := GUI.CreateButton (680, 390, 0, "EastAfrica", Pencil)
mad := GUI.CreateButton (710, 270, 0, "Madagascar", Pencil)
Congo := GUI.CreateButton (610, 350, 0, "Congo", Pencil)
egypt := GUI.CreateButton (610, 480, 0, "Egypt", Pencil)
Middlee := GUI.CreateButton (690, 500, 0, "MiddleEast", Pencil)
sEur := GUI.CreateButton (570, 550, 0, "SouthernEurope", Pencil)
wEur := GUI.CreateButton (470, 550, 0, "WesternEurope", Pencil)
russia := GUI.CreateButton (660, 600, 0, "Russia", Pencil)
nEur := GUI.CreateButton (550, 590, 0, "NorthernEurope", Pencil)
brit := GUI.CreateButton (490, 600, 0, "Britain", Pencil)
scan := GUI.CreateButton (560, 640, 0, "Scandinavia", Pencil)
ice := GUI.CreateButton (470, 640, 0, "Iceland", Pencil)
ind := GUI.CreateButton (850, 460, 0, "India", Pencil)
siam := GUI.CreateButton (950, 430, 0, "Siam", Pencil)
chin := GUI.CreateButton (900, 510, 0, "China", Pencil)
jap := GUI.CreateButton (1070, 530, 0, "Japan", Pencil)
kam := GUI.CreateButton (1050, 640, 0, "Kamchatka", Pencil)
yak := GUI.CreateButton (930, 640, 0, "Yakutsk", Pencil)
irk := GUI.CreateButton (930, 600, 0, "Irkutsk", Pencil)
mog := GUI.CreateButton (930, 560, 0, "Mongolia", Pencil)
kaz := GUI.CreateButton (760, 560, 0, "Kazakhstan", Pencil)
ural := GUI.CreateButton (770, 630, 0, "Ural", Pencil)
sib := GUI.CreateButton (840, 640, 0, "Siberia", Pencil)
Ind := GUI.CreateButton (980, 360, 0, "Indonesia", Pencil)
newgu := GUI.CreateButton (1100, 330, 0, "NewGuinea", Pencil)
eastAus := GUI.CreateButton (1070, 250, 0, "EasternAustralia", Pencil)
westAus := GUI.CreateButton (1000, 230, 0, "WesternAustralia", Pencil)
proc attack
if button=1 and button 
            then
        var attackwindow := Window.Open("graphics:500;500")
    end if
end attack
loop
    Mouse.Where (mx, my, button)


        attack
    exit when GUI.ProcessEvent
end loop

-----------------------------------
darkdwight7
Thu Apr 14, 2011 1:47 pm

RE:advice for turing games ie (risk)
-----------------------------------
oh and please i farly new just want to learn nothing else dont finsh the programm for me thx  :D

-----------------------------------
apython1992
Thu Apr 14, 2011 2:39 pm

RE:advice for turing games ie (risk)
-----------------------------------
For future reference, it's easier for us to help when you use code/syntax tags that properly indent the code. Example:


put "HI!"


put "HI!"


As far as your actual question goes, it was difficult to understand. Are you asking how to trigger an event of some sort when you click on a country?

-----------------------------------
Zren
Fri Apr 15, 2011 7:37 pm

RE:advice for turing games ie (risk)
-----------------------------------
Do you know about arrays?

Risk is ... difficult to create without a knowing about nodes http://en.wikipedia.org/wiki/Node_(computer_science) . You would need a minimal knowledge of creating a node with a list of countries (nodes) it connects to.

Nodes are easily done with a class (OOP) structure, something you've probably not learned yet, and is angrily difficult in Turing.

-----------------------------------
RandomLetters
Sat Apr 16, 2011 2:36 pm

RE:advice for turing games ie (risk)
-----------------------------------
Are you willing to learn about arrays?  If not, then you're life will be hell.

I don't think you necessarily need to use nodes.  You could use a 2d array of connections between countries.
