
-----------------------------------
jrblast
Thu Dec 08, 2005 8:23 pm

program flashes
-----------------------------------
Well, in light of finishing my game of snake, i decided to move onto a more complex game...much of the coded so far i took from the astroids game :oops: lol, anyways, it keeps flashing, i use the viewupdate thing, but it still flashes, any ideas? heres the code btw



const ballRad : int := 10           %declaring constants and vars
const paddleWidth : int := 30
const paddleThicnkness : int := 10
const paddleHeight : int := 5
const screenX : int := 900
const screenY : int := 700
const frameDelay : int := 5
const rate : int := 5
var mouseX, mouseY, ballX, ballY, button, ballDX, ballDY, ballAngle, collision, paddleX : int

ballX := 450                 %giving values to variables
ballY := 350
ballDX := 0
ballDY := -1
mouseX := screenX div 2
paddleX := 350
setscreen ("offscreenonly, nobuttonbar, graphics:900;,700")

loop
    cls
    mousewhere (mouseX, mouseY, button)
    ballX += ballDX
    ballY += ballDY
    if mouseX > paddleX then
        paddleX += rate
    end if
    if mouseX < 0 or mouseX > maxx then
        mouseX := 0
    end if
    if mouseX - paddleWidth >= 0 and mouseX + paddleWidth 