
-----------------------------------
Original
Fri May 08, 2009 1:46 pm

Score count and and collision detection
-----------------------------------
No one answered my previous question, so I'll try to rephrease it this time. I am new to turing, and i am trying to make a game that has donuts falling on the background. When Homer's face hits the donuts, the score goes up by one. I need to learn how to make a score count, and how to make the collision detection between homer and the falling donuts. Here is the code i have written so far. One more thing, when you run this, the donuts constantly flash. Can some help me fix this problem? Your help is appreciated. Here is the code.

Thanks


var x, y : int
x := 100
var movex : int
var movec : int
var homer : int := Pic.FileNew ("homer.bmp")

y := 100

var chars : array char of boolean
process donutfall
    loop

        randint (movec, 0, 255)
        randint (movex, 0, maxx)

        for decreasing i : maxy .. 0 by 20

            Draw.FillOval (movex, i, 20, 20, movec)
            delay (20)
            cls
            View.UpdateArea (0, 0, maxx, maxy)
            if i 