Im updating my version of Deal or No deal to make it look a bit better graphic wise.
I posted the original on CodersWorkshop but that don't exist any more.
The original was more text based(user input via keyboard).
This version will be mouse based.
The problem ive got is that the boxes don't deleteafter i have clicked on them.
Can any body offer help on this problem
Thanks
Destroyer :)
I posted the original on CodersWorkshop but that don't exist any more.
The original was more text based(user input via keyboard).
This version will be mouse based.
AppTitle "DEAL OR NO DEAL" init_graphics() Global box_state=0 Dim box(22) ;----------------------------------------------------------------------- ;Main Loop ;----------------------------------------------------------------------- While Not KeyHit(1) ClsColor 55,55,55 Cls display_boxes() draw_pointer() Line 0,40,640,40 Line 0,400,640,400 Text 5,5,"Box Picked > "+box_state Flip Wend End ;----------------------------------------------------------------------- ;Functions ;----------------------------------------------------------------------- Function display_boxes() Restore boxdata For n = 1 To 22 Read id$,boxNo$,x,y,w,h If id$="" Then Exit Color 255,0,0 ;top Rect x,y,w,h Color 55,0,0 ;bottom Rect x+1,y+1,w,h Color 200,0,0 ;middle Rect x+1,y+1,w-1,h-1,1 Color 255,255,255 Text x+3,y,boxNo$ check_box(id$,boxNo,x,y,w,h) Next End Function ;----------------------------------------------------------------------- Function check_box(id$,boxNo$,x,y,w,h) If MouseDown(1) If RectsOverlap( MouseX(), MouseY(), 1, 1, x,y,w+1,h+1 ) Then box_state=id$ If box_state=id$ Color 55,55,55 Rect x,y,w+1,h+1,1 End If End If End If End Function ;----------------------------------------------------------------------- Function draw_pointer() Color 255,255,255 Oval MouseX(),MouseY(),4,4,1 End Function ;----------------------------------------------------------------------- Function init_graphics() Graphics3D 640,480,16,2 SetBuffer BackBuffer() SeedRnd MilliSecs() HidePointer End Function ;----------------------------------------------------------------------- ;Data ;----------------------------------------------------------------------- .boxdata Data "1","Box 1",10,100,55,13 Data "2","Box 2",10,120,55,13 Data "3","Box 3",10,140,55,13 Data "4","Box 4",10,160,55,13 Data "5","Box 5",10,180,55,13 Data "6","Box 6",10,200,55,13 Data "7","Box 7",10,220,55,13 Data "8","Box 8",10,240,55,13 Data "9","Box 9",10,260,55,13 Data "10","Box 10",10,280,55,13 Data "11","Box 11",10,300,55,13 Data "12","Box 12",575,100,55,13 Data "13","Box 13",575,120,55,13 Data "14","Box 14",575,140,55,13 Data "15","Box 15",575,160,55,13 Data "16","Box 16",575,180,55,13 Data "17","Box 17",575,200,55,13 Data "18","Box 18",575,220,55,13 Data "19","Box 19",575,240,55,13 Data "20","Box 20",575,260,55,13 Data "21","Box 21",575,280,55,13 Data "22","Box 22",575,300,55,13 Data "","",0,0,0,0 ;-----------------------------------------------------------------------
The problem ive got is that the boxes don't deleteafter i have clicked on them.
Can any body offer help on this problem
Thanks
Destroyer :)