Computer Science Canada

draw die

Author:  ruff_riders91 [ Tue Dec 09, 2003 11:41 am ]
Post subject:  draw die

setscreen ("graphics")
var x, y, x2, y2, h, die : int
loop
randint (h, 10, maxy)
randint (x, 0, maxx - h)
randint (y, 0, maxy - h)
randint (die, 1, 6)
const size := h div 15
const col := white
drawfill (1, 1, black, black)
drawfillbox (x, y, x + h, y + h, brightred)
case die of
label 1 :
drawfilloval (x + h div 2, y + h div 2, size, size, col)
label 2 :
drawfilloval (x + h div 5, y + h div 5, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5 * 4, size, size, col)
label 3 :
drawfilloval (x + h div 2, y + h div 2, size, size, col)
drawfilloval (x + h div 5, y + h div 5, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5 * 4, size, size, col)
label 4 :
drawfilloval (x + h div 5, y + h div 5, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5 * 4, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5, size, size, col)
drawfilloval (x + h div 5, y + h div 5 * 4, size, size, col)
label 5 :
drawfilloval (x + h div 5, y + h div 5, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5 * 4, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5, size, size, col)
drawfilloval (x + h div 5, y + h div 5 * 4, size, size, col)
drawfilloval (x + h div 2, y + h div 2, size, size, col)
label 6 :
drawfilloval (x + h div 5, y + h div 5, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5 * 4, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 5, size, size, col)
drawfilloval (x + h div 5, y + h div 5 * 4, size, size, col)
drawfilloval (x + h div 5, y + h div 2, size, size, col)
drawfilloval (x + h div 5 * 4, y + h div 2, size, size, col)

end case
delay (200)
cls
end loop

Author:  Dan [ Tue Dec 09, 2003 3:14 pm ]
Post subject: 

nice, whould be usfull for making one of thous die based games.

have some bits

Author:  PaddyLong [ Tue Dec 09, 2003 4:15 pm ]
Post subject: 

turn it into a function and it'd be perfect

Author:  Triple Five [ Wed Dec 10, 2003 1:38 pm ]
Post subject: 

kool Very Happy man! good for craps.... thanks for the programming im gonna see if i can make a craps game and post it


: