
-----------------------------------
werdMeistah
Sun Jan 11, 2004 9:08 pm

hey guys, wondering if you can help me make  domino game
-----------------------------------
im having real trouble, the classes that im doing are tangling and everyt hings a mess ... no GUI needed though

aight ima check back

thx again ppl

-----------------------------------
poly
Sun Jan 11, 2004 9:33 pm


-----------------------------------
well hmm here are some ideas (not sure if they would or not)
- draw images representing the dominos
- using arrays make a grid pattern on the screen lets say, make the gameplay 20x20 and make each grid a rectangle shape (dimensions could be like 20x10)
- Hmm you could use keyboard buttons to rotate the domino peice
- than you'd have to write up like a procedure that would check the  dominos on the grid and make sure the current domino that you are placing will fit into the grid. That would be tricky, but I can think of a way that it might work (but really hard to explain).

theres some ideas, im guessing others have more and better ideas

-----------------------------------
Cervantes
Sun Jan 11, 2004 9:38 pm


-----------------------------------
well you mean the game dominos (which I don't know how to play) or the funness of making a maze of dominoes and then knocking them over :P

-----------------------------------
werdMeistah
Sun Jan 11, 2004 9:44 pm

well...
-----------------------------------
well heres what i mean check it out


http://j_carrillo_vii.tripod.com/dominoes.htm#BasicGame

-----------------------------------
GrandAvalon
Sun Jan 11, 2004 10:26 pm


-----------------------------------
Can you post what you have so far?

-----------------------------------
werdMeistah
Tue Jan 13, 2004 6:33 pm

here
-----------------------------------
class Domino

   export setValue, value, putDomino, startInt

   var x : int := 0
   var y : int := 0
   var xB : int := 0
   var yB : int := 0
   var startInt : int
   var orientation : int := 0



   % procedure setvalue
   % purpose : This procedure sets the value of the domino to an integer
   % parameters : one
   procedure setValue (value : int)
       startInt := value
   end setValue

   % function Value
   % purpose : This function results the value given
   % parameters : none
   function value : int
       result startInt
   end value


   % procedure putdomino
   % purpose : This procedure will draw the domino pattern based on the parameters
   % given
   % parameters : four ( x, y , faceUp, orientation)
   procedure putDomino (var x, y, orientation : int)
       var x2 : int
       var y2 : int
       x2 := x2 + 60
       y2 := y2 + 30
       var faceup : boolean := false
       if orientation = 2 then
           Draw.Box (x, y, x2, y2, black)
           Draw.Box (xB + 40, yB, x, y2, black)
       elsif orientation = 1 then
           Draw.Box (x, y, x2, y2, blue)
           Draw.Box (xB, yB + 40, x2, y2, black)
       end if
   end putDomino

   % procedure draw dots
   % purpose : this procedure draws the dots through procedure putDomino

   procedure drawDots
       var dotsDraw : int
       var dotsDrawB : int

       dotsDraw := startInt div 10
       case dotsDraw of
           label 0 :
               Draw.Line (300, 20, 400, 10, white)
           label 1 :
               Draw.FillOval (x + 20, y + 20, 2, 2, red)
           label 2 :
               Draw.FillOval (x + 10, y + 20, 2, 2, red)
               Draw.FillOval (x + 30, y + 20, 2, 2, red)
           label 3 :
               Draw.FillOval (x + 10, y + 30, 2, 2, red)
               Draw.FillOval (x + 20, y + 20, 2, 2, red)
               Draw.FillOval (x + 30, y + 10, 2, 2, red)
           label 4 :
               Draw.FillOval (x + 10, y + 30, 2, 2, red)
               Draw.FillOval (x + 10, y + 10, 2, 2, red)
               Draw.FillOval (x + 30, y + 30, 2, 2, red)
               Draw.FillOval (x + 30, y + 10, 2, 2, red)
           label 5 :
               Draw.FillOval (x + 10, y + 30, 2, 2, red)
               Draw.FillOval (x + 10, y + 10, 2, 2, red)
               Draw.FillOval (x + 30, y + 30, 2, 2, red)
               Draw.FillOval (x + 30, y + 10, 2, 2, red)
               Draw.FillOval (x + 20, y + 20, 2, 2, red)
           label 6 :
               Draw.FillOval (x + 10, y + 10, 2, 2, red)
               Draw.FillOval (x + 10, y + 20, 2, 2, red)
               Draw.FillOval (x + 10, y + 30, 2, 2, red)
               Draw.FillOval (x + 30, y + 10, 2, 2, red)
               Draw.FillOval (x + 30, y + 20, 2, 2, red)
               Draw.FillOval (x + 30, y + 30, 2, 2, red)

       end case

       % procedure drawDotsB
       % purpose : This procedure draws the second dice sequence of the domino

           dotsDrawB := startInt mod 10
           case dotsDrawB of
               label 0 :
                   Draw.Line (300, 20, 400, 10, white)
               label 1 :
                   Draw.FillOval (xB + 20, yB + 20, 2, 2, red)
               label 2
                   Draw.FillOval (xB + 10, yB + 20, 2, 2, red)
                   Draw.FillOval (xB + 30, yB + 20, 2, 2, red)
               label 3 :
                   Draw.FillOval (xB + 10, yB + 30, 2, 2, red)
                   Draw.FillOval (xB + 20, yB + 20, 2, 2, red)
                   Draw.FillOval (xB + 30, yB + 10, 2, 3, red)
               label 4 :
                   Draw.FillOval (xB + 10, yB + 30, 2, 2, red)
                   Draw.FillOval (xB + 10, yB + 10, 2, 2, red)
                   Draw.FillOval (xB + 30, yB + 30, 2, 2, red)
                   Draw.FillOval (xB + 30, yB + 10, 2, 3, red)
               label 5 :
                   Draw.FillOval (xB + 10, yB + 30, 2, 2, red)
                   Draw.FillOval (xB + 10, yB + 10, 2, 2, red)
                   Draw.FillOval (xB + 30, yB + 30, 2, 2, red)
                   Draw.FillOval (xB + 30, yB + 10, 2, 2, red)
                   Draw.FillOval (xB + 20, yB + 20, 2, 3, red)
               label 6 :
                   Draw.FillOval (xB + 10, yB + 10, 2, 2, red)
                   Draw.FillOval (xB + 10, yB + 20, 2, 2, red)
                   Draw.FillOval (xB + 10, yB + 30, 2, 2, red)
                   Draw.FillOval (xB + 30, yB + 10, 2, 2, red)
                   Draw.FillOval (xB + 30, yB + 20, 2, 2, red)
                   Draw.FillOval (xB + 30, yB + 30, 2, 2, red)

           end case
       end drawDots

   end Domino


   class Hand

       import Domino
       export dominoProc, size, putHand

       var hand : array 1 .. 7 of int
       var size : int := 7

       % function dominoproc
       % purpose : This function returns the numbered value in the tile array
       % parameters : none
       function dominoProc : int
           var randomInt : int
           var checkInt : int
           randint (randomInt, 0, 66)
           for i : 0 .. 66
               if randomInt = hand (i) then
                   randint (randomInt, 0, 66)
               else
                   randomInt := checkInt
               end if
           end for
           result randomInt
       end dominoProc

       % function size
       % purpose : This function returns the size of the hand
       % parameters : none
       function sizeDom : int
           var size : int
           result size
       end sizeDom

       % procedure add domino
       % purpose : This procedure adds a domino to the end of the array.
       % parameters : none


       procedure addDomino
       end addDomino


       % procedure find
       % purpose : This procedure returns the given value in the hand
       % parameters : x

       procedure findValue (var x : int)
           var IndexNum : int
           for i : 1 .. 7
               if hand (i) = x then
                   IndexNum := hand (i)
               end if
           end for
       end findValue

       % procedure drop/remove value
       % purpose : This procedure removes a given value from the hand
       % parameters : x
       procedure dropValue (var x : int)
           for i : 1 .. 7
               if hand (i) = x then
                   hand (i) := 0
               end if
           end for
       end dropValue


       % procedure putHand
       % purpose : This procedure prints the hand of the players
       % parameters : four (x, y, faceup, orientation)
       procedure putHand (var x, y, orientation : int)
           var count : int
           var countB : int
           var countC : int

           var countD : int
           for i : 1 .. 7
               for i2 : 1 .. 7
                   if y > 50 then
                       y := y + 10
                   end if
                   if count > 4 then
                       x := x + 5
                   elsif count  50 then
                       y := y + 10
                   end if
                   if countB > 4 then
                       x := x + 5
                   elsif countB = 10 then
                       x := x + 50
                   end if
                   if countC > 4 then
                       y := y - 5
                   elsif countC = 10 then
                       x := x + 50
                   end if
                   if countC > 4 then
                       y := y - 5
                   elsif countC  hand (i + 1) then
                   hand (i + 1) := tempInt
                   hand (i) := hand (i + 1)
                   tempInt := hand (i)
               elsif hand (i) < hand (i + 1) then
                   hand (i) := hand (i)
                   hand (i + 1) := hand (i + 1)
               end if
           end for
       end sortArray


   end Hand

   class Table

       var table : array 1 .. 28 of int
       var size : int
       var left : int
       var right : int

       % procedure left
       % purpose : This procedure indicates if it is located in the
       % left or the right side of the chain
       % parameters : none

       procedure leftB

       end leftB

       % procedure right
       % purpose : This procedure indicates if it is located in the
       % left or the right side of the chain
       % parameters : none

       procedure rightB

       end rightB

       % procedure add
       % purpose : This procedure adds the domino to the left or the right side of the chain
       % parameters : leftB, rightB

       procedure addB (var left, right : int)
       end addB

   end Table

-----------------------------------
GrandAvalon
Wed Jan 14, 2004 8:15 pm


-----------------------------------
So do you want us to edit your code and fix the errors or tell you want is wrong?  Or just finish the program which you have started?

At this stage you are FAR from completing the game.

-----------------------------------
werdMeistah
Tue Jan 20, 2004 7:27 pm

please
-----------------------------------
it would be greately appreciated if you can finish what i have started,

 thank you again for your comments,

-----------------------------------
BBPProductions
Wed Jun 03, 2009 10:21 am

Re: hey guys, wondering if you can help me make  domino game
-----------------------------------
Did you ever finish?
I know it was a while ago.
Can i see the updated code?
Or the finished code?

-----------------------------------
apomb
Wed Jun 03, 2009 10:57 am

RE:hey guys, wondering if you can help me make  domino game
-----------------------------------
A five year old post... i think you have the record, BBPProductions.

there should be an auto-lock for this kind of thing

-----------------------------------
Dusk Eagle
Wed Jun 03, 2009 3:35 pm

Re: hey guys, wondering if you can help me make  domino game
-----------------------------------
BBPProductions, if you are making a dominoes game and need help, just post a separate topic rather than necro-post in a five year old thread.

-----------------------------------
BBPProductions
Thu Jun 04, 2009 9:29 am

RE:hey guys, wondering if you can help me make  domino game
-----------------------------------
I have to do a Dominos game in my class, but not until next year, I just wanted to see it. it would have been very Helpful...
if the post is still up im sure its fair game to reply on it
and i did write i know this post is old..
That was my first post on this Fourm
You guys are pretty Rude...
