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

Username:   Password: 
 RegisterRegister   
 How to randomize columns picture slides down from and how to set difficulties for a game
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
moon15




PostPosted: Tue Apr 07, 2009 5:50 pm   Post subject: How to randomize columns picture slides down from and how to set difficulties for a game

I have the game everything seems to be alright its just that I need help with randomizing which columns the pictures slide down in and how to set easy, medium and hard difficulties in my game.
The code is
Turing:
setscreen ("graphics")
var key : string
key :=""
process keys
key :=""
if hasch then
key:= getchar
Input.Flush
end if
end keys
procedure witch
    var witch : int := Pic.FileNew ("witch.jpg")
    for y : 200 .. 600
        Pic.Draw (witch, 250, (maxx - y), 0)
        delay (5)
        fork keys
        if key = "w"
        then cls
        exit
         end if
           end for
end witch
procedure ghost
    var ghost : int := Pic.FileNew ("ghost.bmp")
    for y : 200 .. 600
        Pic.Draw (ghost, 250, (maxx - y), 0)
        delay (5)
        fork keys
        if key = "g"
        then cls
        exit
        end if
    end for
end ghost
procedure blue_monster
    var blue_monster : int := Pic.FileNew ("blue_monster.bmp")
    for y : 200 .. 600
        Pic.Draw (blue_monster, 250, (maxx - y), 0)
        delay (5)
        fork keys
        if key = "m"
        then cls
        exit
        end if
          end for
end blue_monster
loop
    put "Do you wish to play this spooky freaky intense game?(y/n)*WARNING MAY CAUSE SEIZURES AND WEIRD PROBLEMS"
    var reply : string (1)
    get reply
    cls
    exit when reply not= "y"
    put "Whats your difficulty? (e,m,h)"
    var replydifficulty : string (1)
    get replydifficulty
    exit when replydifficulty = "l"
    if replydifficulty = "e" then
        if replydifficulty = "m" then
            if replydifficulty = "h" then
            end if
        end if
    end if
    loop
        var menace : int := Rand.Int (1, 3)
        if menace = 1 then
            ghost
        elsif menace = 2 then
            witch
        elsif menace = 3 then
            blue_monster
        end if
       end loop
      end loop


Mod Edit: Remember to use syntax tags! Thanks Smile
code:
[syntax="turing"]Code Here[/syntax]
Sponsor
Sponsor
Sponsor
sponsor
moon15




PostPosted: Tue Apr 07, 2009 7:51 pm   Post subject: RE:How to randomize columns picture slides down from and how to set difficulties for a game

code again
Turing:

setscreen ("graphics")
var key : string
key :=""
process keys
key :=""
if hasch then
key:= getchar
Input.Flush
end if
end keys
procedure witch
    var witch : int := Pic.FileNew ("witch.jpg")
    for y : 200 .. 600
        Pic.Draw (witch, 250, (maxx - y), 0)
        delay (5)
        fork keys
        if key = "w"
        then cls
        exit
         end if
           end for
end witch
procedure ghost
    var ghost : int := Pic.FileNew ("ghost.bmp")
    for y : 200 .. 600
        Pic.Draw (ghost, 250, (maxx - y), 0)
        delay (5)
        fork keys
        if key = "g"
        then cls
        exit
        end if
    end for
end ghost
procedure blue_monster
    var blue_monster : int := Pic.FileNew ("blue_monster.bmp")
    for y : 200 .. 600
        Pic.Draw (blue_monster, 250, (maxx - y), 0)
        delay (5)
        fork keys
        if key = "m"
        then cls
        exit
        end if
          end for
end blue_monster
loop
    put "Do you wish to play this spooky freaky intense game?(y/n)*WARNING MAY CAUSE SEIZURES AND WEIRD PROBLEMS"
    var reply : string (1)
    get reply
    cls
    exit when reply not= "y"
    put "Whats your difficulty? (e,m,h)"
    var replydifficulty : string (1)
    get replydifficulty
    exit when replydifficulty = "l"
    if replydifficulty = "e" then
        if replydifficulty = "m" then
            if replydifficulty = "h" then
            end if
        end if
    end if
    loop
        var menace : int := Rand.Int (1, 3)
        if menace = 1 then
            ghost
        elsif menace = 2 then
            witch
        elsif menace = 3 then
            blue_monster
        end if
       end loop
      end loop
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  [ 2 Posts ]
Jump to:   


Style:  
Search: