
-----------------------------------
Original
Thu May 07, 2009 12:32 pm

Need help with background/collision detection
-----------------------------------
Hi, I'm new to Turing, and I'm trying to create a game where homer simpson has to eat/drink all the donuts/beers and he has to try to avoid the Flander's faces. The problem is that I cant get the beers/donuts/faces to fall as a background. Each time homer eats the donuts/beer, he gets one point. I need help on making the background and the collision detection. 
Here is the code, 
Thanks :P 

process BgmSound
  Music.PlayFileLoop ("Simpsons.mp3")
end BgmSound
fork BgmSound

View.Set ("title:Da Simpsons- By: Siyavash,graphics:400,500,position:center,center")

var z, c, q, w  : int
z:=40
c:=40
q:= 50
w:= 380

var mypic1 : int := Pic.FileNew ("homer2.bmp")
        loop
         
var chars: array char of boolean
            Input.KeyDown (chars) 
            
            if chars (KEY_UP_ARROW) then 
                c:=c+6
                Pic.Draw (mypic1, z, c, picCopy)
            end if 
            if chars (KEY_RIGHT_ARROW) then 
                z:=z+6
                Pic.Draw (mypic1, z, c, picCopy)
            end if 
            if chars (KEY_LEFT_ARROW) then 
                z:=z-7
                Pic.Draw (mypic1, z, c, picCopy)
            end if 
            if chars (KEY_DOWN_ARROW) then 
                c:=c-6
                Pic.Draw (mypic1, z, c, picCopy)
            end if 
           if chars (KEY_ENTER) then
           
           w:= w-1000
               delay (20)
              
          
          end if

Pic.Draw (mypic1, z, c, 0)
delay (20)
cls

drawfilloval (q, w, 25, 25, red) 
drawfilloval (q, w, 8, 8, white)

end loop


Mod Edit: Remember to use syntax tags! Thanks :) Code Here

-----------------------------------
Dusk Eagle
Thu May 07, 2009 1:52 pm

Re: Need help with background/collision detection
-----------------------------------
First, be sure to use syntax tags when posting code here: ] %code here.
