
-----------------------------------
fdsafdsa
Sun Feb 19, 2006 3:36 pm

Rays and atoms bounce
-----------------------------------
I need some one to fix my rays program it wont bounce off the attom can anyone make my prog shorter so the rays can all be same and not serperated thanks i really need help
:(:(:(:(
HERES MY CODE


setscreen ("graphics:600;600,title:Laser Atoms KABOOM")
const pic := Pic.FileNew ("/Computer Science/Turing Pcitures/atom.jpg")
const pic2 := Pic.FileNew ("/Computer Science/Turing Pcitures/raygun.jpg")
const pic3 := Pic.FileNew ("/Computer Science/Turing Pcitures/raygun2.jpg")
const pic4 := Pic.FileNew ("/Computer Science/Turing Pcitures/raygun3.jpg")
const pic5 := Pic.FileNew ("/Computer Science/Turing Pcitures/raygun4.jpg")
var g : int := 145
var h : int := 145
cls

var typeatom : array 1 .. 25 of int
var num : int := 1
var num2 := 100
var num3 := 100
var grid : array 1 .. 10, 1 .. 10 of int
for a : 1 .. 10
    for b : 1 .. 10
        grid (a, b) := num2
        num2 := num2 + 40
        drawbox (num3, grid (a, b), num3 + 40, grid (a, b) + 40, black)
    end for
    num2 := 100
    num3 += 40
end for

var a : int
var b : int
var num6 : int := 1
loop
    randint (a, 2, 9)
    randint (b, 2, 9)
    grid (a, b) := pic
    var num4, num5 : int := 143
    for c : 2 .. 10
        for d : 2 .. 10
            if a = c and b = d then
                Pic.Draw (grid (a, b), num4, num5, picCopy)
            elsif a = c and b not= d then
                num5 += 40
            elsif a not= c and b = d then
                num4 += 40
            end if
        end for
    end for
    num6 += 1
    exit when num6 = 11
end loop

var count := 0
Pic.Draw (pic2, -150, 85, picCopy)
var picount : int := 0
var cdist : int := 100
var x, y, button : int

var mx2, my2, btn : int
var dist : int := 100
var dist1 : int := 100
var dist2 : int := 40
var dist3 : int := 120
var dist4 : int := 40
var count2 := 0
var col : int := 10
proc BottomLasers


    if mx2 >= dist and mx2 = dist and mx2 