I need to write a routine where the Image drops down the left hand of the background and then goes right and follows the contour until it gets to the right hand side of the screen.
I have the following code that draws the background etc, and the object moves but the Object just bounces up and down at the moment.....
I need the object to move at one pixel resolution and follow the contour perfectly.
I am assuming that I could use Imagescollide for the Collision Detection?
I have been struggling to write this for well over a week but I am still nowhere closer...
Any help would be very much appreciated.
Andy
I have the following code that draws the background etc, and the object moves but the Object just bounces up and down at the moment.....
I need the object to move at one pixel resolution and follow the contour perfectly.
I am assuming that I could use Imagescollide for the Collision Detection?
Graphics 800,600,0,2 SetBuffer BackBuffer() AI = CreateImage(100,20) background = CreateImage(800,600) Xflag=0 Yflag=0 xpos=44 ypos=250 ;Draw Test Background Line 43,200,755,200 Line 43,200,43,537 Line 755,200,755,400 Line 43,537,143,450 Line 143,450,200,450 Line 200,450,200,400 Line 200,400,150,350 Line 150,350,150,300 Line 150,300,300,300 Line 300,300,250,350 Line 250,350,350,400 Line 350,400,450,425 Line 450,425,375,450 Line 375,450,375,500 Line 375,500,475,475 Line 475,475,550,475 Line 550,475,671,475 Line 671,475,755,400 GrabImage background,0,0 ;Draw AI Image Oval 50,50,20,20,1 GrabImage AI,50,50 ;Main Loop Repeat Cls If yflag=0 Then ypos=ypos+1 If yflag=1 Then ypos=ypos-1 If ImagesCollide(AI,xpos,ypos,0,background,0,0,0) And yflag=1 Then yflag=0:Goto again If ImagesCollide(AI,xpos,ypos,0,background,0,0,0) And yflag=0 Then yflag=1 .again DrawImage background,0,0 DrawImage AI,xpos,ypos Flip Until KeyDown(1) End
I have been struggling to write this for well over a week but I am still nowhere closer...
Any help would be very much appreciated.
Andy