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

Username:   Password: 
 RegisterRegister   
 Star Wars RISK
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Tallguy




PostPosted: Tue Nov 18, 2008 5:53 pm   Post subject: Star Wars RISK

Hey guys hows it going? Haven't been programming for a while and I thought of doing Star Wars RISK. Great fun for everyone and its Star Wars, whats better then that? lol

So my problem may seem trivial, but remember I haven't done this in a while. So far I have my start up screen were you enter your names and chose your fraction, the thing is; it takes several clicks to choose and you can both choose the same fraction, which isn't suppose to happen.

So any help is welcome, comments too.



SW Game.zip
 Description:
Star wars risk

Download
 Filename:  SW Game.zip
 Filesize:  333.99 KB
 Downloaded:  382 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
The_Bean




PostPosted: Tue Nov 18, 2008 8:24 pm   Post subject: Re: Star Wars RISK

An easy way to keep each player from choosing the same faction is to give each faction a boolean variable, initially have them all set to false, then as someone picks them make the variable true, and don't let someone else pick the faction if its boolean value is true. Basically eliminating the faction as a future possibility.
Tallguy




PostPosted: Wed Nov 19, 2008 10:01 am   Post subject: RE:Star Wars RISK

ummm, i understand what you mean, just unsure where to place it . . .
S_Grimm




PostPosted: Wed Nov 19, 2008 11:25 am   Post subject: RE:Star Wars RISK

code:

loop
    Mouse.Where (x, y, button)

    if x >= 50 and x <= 230 and y >= 230 and y <= 410 then %smugglar
        Font.Draw ("'Corrupt Side', composed of smuggulers and other veil groups who are the pain of the legal system", 15, 420, f5, 0)
        delay (200)
    end if
    if x >= 300 and x <= 480 and y >= 230 and y <= 410 then %imperal
        Font.Draw ("'Dark Side', the Imperial forces, backed by users of the dark side of the force", 90, 420, f5, 0)
        delay (200)
    end if
    if x >= 550 and x <= 730 and y >= 230 and y <= 410 then %alliance
        Font.Draw ("'Light Side', the Rebel Alliance and those who wish to overthrow the mantle of the Imperial yoke. ", 15, 420, f5, 0)
        delay (200)
    end if
    drawfillbox (0, 416, maxx, 450, 255)

    if x >= 50 and x <= 230 and y >= 230 and y <= 410 and button = 1 then   %smugglar
        drawfillbox (90, 450, maxx, 550, 255)
        Font.Draw (player1, 50, 500, f2, brightred)
        Font.Draw ("has joined the corrupt side.", 20 * length (player1) + 60, 500, f2, white)
        count := count + 1
        exit
    end if
    if x >= 300 and x <= 480 and y >= 230 and y <= 410 and button = 1 then %imperal
        drawfillbox (90, 450, maxx, 550, 255)
        Font.Draw (player1, 50, 500, f2, brightred)
        Font.Draw ("has joined the dark side.", 20 * length (player1) + 60, 500, f2, white)
        count := count + 1
        exit
    end if
    if x >= 550 and x <= 730 and y >= 230 and y <= 410 and button = 1 then %alliance
        drawfillbox (90, 450, maxx, 550, 255)
        Font.Draw (player1, 50, 500, f2, brightred)
        Font.Draw ("has joined the light side.", 20 * length (player1) + 60, 500, f2, white)
        count := count + 1
        exit
    end if
end loop


In there would be the best spot. Where your if statements are, have an " and chosen = false" statement. Only place i could think of.
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: