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

Username:   Password: 
 RegisterRegister   
 making piece move
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Jickman




PostPosted: Fri May 25, 2007 2:50 pm   Post subject: making piece move

hi, me and a group of people have made a monoply game, and we have encounter a problem, we don't know how to make the piece move. ok u know each game has a dice right, we want the piece move to the coresponding roll, and for some reason it won't move, and also we want the piece to bounce back.
question, can u show us how to make the piece move to the coresponding dice roll? (greatly thank u if u show us on hte program)
ps. do u also know how to make the dice go randomly and stop at number , and u can do it again ( loop statement)?
plz?

ill so thank u !! plz help XD
this program is just a sample if u can show me here =D



dice part.t
 Description:
sample here

Download
 Filename:  dice part.t
 Filesize:  885 Bytes
 Downloaded:  85 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Jickman




PostPosted: Fri May 25, 2007 9:31 pm   Post subject: RE:making piece move

HELP plz =D
Expirant




PostPosted: Fri May 25, 2007 9:43 pm   Post subject: Re: making piece move

Wasn't sure exactly what you wanted, but I altered your dice code a little to get the circle to move to the appropriate square. Is this what you wanted to do?

code:

View.Set ("graphics:max;max")
colorback (7)
cls
Draw.Box (100, 75, maxx - 100, maxy div 2, yellow) %this is the whole board and the 10th square.
Draw.Box (100, 75, 190, maxy div 2, yellow) %square 1
Draw.Box (100, 75, 280, maxy div 2, yellow) %square 2
Draw.Box (100, 75, 370, maxy div 2, yellow) %square 3
Draw.Box (100, 75, 460, maxy div 2, yellow) %square 4
Draw.Box (100, 75, 550, maxy div 2, yellow) %square 5
Draw.Box (100, 75, 640, maxy div 2, yellow) %square 6
Draw.Box (100, 75, 730, maxy div 2, yellow) %square 7
Draw.Box (100, 75, 820, maxy div 2, yellow) %square 8
Draw.Box (100, 75, 910, maxy div 2, yellow) %square 9

color (12)
var dice : int := Rand.Int (1, 6)

put " Dice Roll:"
put dice

Draw.FillOval (50 + dice * 90, 150, 10, 10, blue)

Jickman




PostPosted: Sat May 26, 2007 10:46 am   Post subject: RE:making piece move

i have 1 more little question how do u make the dice display random number, and when u press a certrain letter it will stop?
CodeMonkey2000




PostPosted: Sat May 26, 2007 11:02 am   Post subject: Re: making piece move

I would do something like this:
code:
var a : int
loop
    cls
    a := Rand.Int (1, 12)
    locate (1, 1)
    put a ..
    delay(100)
    exit when hasch
end loop
Jickman




PostPosted: Sat May 26, 2007 12:21 pm   Post subject: RE:making piece move

u know that board right, how do u might it bounce back when it gets to square 10, if u roll a number 6, and ur on square 7, how do u make it bounce back ?
CodeMonkey2000




PostPosted: Sat May 26, 2007 12:26 pm   Post subject: RE:making piece move

You should check up on if statements. It's in the Turing Walkthrough
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  [ 7 Posts ]
Jump to:   


Style:  
Search: