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

Username:   Password: 
 RegisterRegister   
 Need help with a game "Poison Penny"
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Murphman




PostPosted: Thu Nov 26, 2009 2:20 pm   Post subject: Need help with a game "Poison Penny"

What is it you are trying to achieve?
I am trying to make a game called poison penny. I want it so that 12 pennies are displayed on the screen and one nickel which is the poision penny. The user's will be able to click one or 2 pennies and when they are clicked they disapear. After all the pennies are gone the player who clicks the poison penny lose's


What is the problem you are having?
I am trying to use procedure's to make the pennies i drew them in paint. I can only get them to appear once when it is called on and i am wondering if it is possible to do this. Or how i should start this program i am lost and could use the help on making this game.


Describe what you have tried to solve this problem
I have tried loops, for loops, if statements, labels.


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


Turing:

%Penny
procedure Penny
    var mypic : int := Pic.FileNew ("Penny.bmp")
    Pic.Draw (mypic, 150, 2, 0)
   
end Penny
%Poison Penny
procedure Poison
    for i : 50 .. 600 by 50
        var mypic : int := Pic.FileNew ("Poison Penny.bmp")
        Pic.Draw (mypic, i, 200, 0)
    end for
end Poison
%Variables
var name1, name2 : string
%Introduction  to the game
put "This game is called Poison Penny. The way this game works is player 1 gets"
put "to go first he can click 1 or 2 pennies after he goes it is player 2's turn"
put "the person who clicks on the poison penny lose's the game."
put ""
put "Please press any key to continue."
Input.Pause
cls
%Asks for the first name
put "Hello Player 1 please enter your name."
get name1
put "Welcome ", name1
delay (1000)
cls
%Asks for the second name
put "Hello Player 2 please enter your name."
get name2
put "Welcome ", name2
delay (1000)
cls



Please specify what version of Turing you are using
4.1
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Nov 26, 2009 2:31 pm   Post subject: Re: Need help with a game "Poison Penny"

Murphman @ Thu Nov 26, 2009 2:20 pm wrote:
I can only get them to appear once when it is called on and i am wondering if it is possible to do this.

What are you referring to by "this"?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Murphman




PostPosted: Fri Nov 27, 2009 9:57 am   Post subject: Re: Need help with a game "Poison Penny"

i am trying to say, is it possblie to make 12 pennies appear in a line. All in one procedure.
Tony




PostPosted: Fri Nov 27, 2009 1:03 pm   Post subject: RE:Need help with a game "Poison Penny"

Yes. You might want to use a for-loop... as you already appear to be doing.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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: