
-----------------------------------
shadox321
Wed Dec 12, 2007 8:22 pm

help with collision detection and making the bullet move randomly
-----------------------------------
okay i need help for my game im new to turing and dont understand most of what im doing, but heres my program
var keys : array char of boolean
var piggy : int := Pic.FileNew ("F:/ICE3/Turing/Game/pics/piggy.BMP")
var background : int := Pic.FileNew ("F:/ICE3/Turing/Game/pics/background2.BMP")
var bulletBill : int := Pic.FileNew ("F:/ICE3/Turing/Game/pics/BulletBill.BMP")
var cloud : int := Pic.FileNew ("F:/ICE3/Turing/Game/pics/clouds.BMP")
var cloud2 : int := Pic.FileNew ("F:/ICE3/Turing/Game/pics/clouds.BMP")
var piggyX : int := 0
var piggyY : int := 0
var backgroundX : int := 0
var backgroundY : int := 0
var bulletBillX : int := 550
var bulletBillY : int := 10
var cloudX : int := 300
var cloudY : int := 250
var cloud2X : int := 150
var cloud2Y : int := 100
setscreen ("offscreenonly")


%intructions%
locatexy (230, 250)
put "Press Enter To Start Playing"

locatexy (160, 200)
put "To Control The Character Use The Arrow Keys"

locatexy (170, 180)
put "To Move Out Of The Way Of The Bullet Bill"

View.Update

Input.Pause
cls



loop

        
    
        Input.KeyDown (keys)
        
  
           
% Character Blue Meanie and movements
             
%Move Character Right Across The Screen   
    if keys (KEY_RIGHT_ARROW) then     
   
        Pic.Draw (piggy, piggyX, piggyY, picMerge)
        if piggyX >= maxx then
            piggyX := -20
        end if
        piggyX := (piggyX + 2)
    
    end if

%Move Character Left Across The Screen
    if keys (KEY_LEFT_ARROW) then
            
        Pic.Draw (piggy, piggyX, piggyY, picMerge)
        if piggyX = maxy then
            piggyY := -20
        end if
        piggyY := (piggyY + 2)
    
    end if

% Move Character Down The Screen    
    if keys (KEY_DOWN_ARROW) then
            
        Pic.Draw (piggy, piggyX, piggyY, picMerge)
        if piggyY 