
-----------------------------------
miller6
Tue Jan 19, 2010 11:20 am

Moving the ball in Brick Breaker.
-----------------------------------
What is it you are trying to achieve?
I am trying to move the ball (in this case a snowflake) just like the ball in breakbreaker.  Where it bounces off the side of the wall when it hits it.

What is the problem you are having?
Moving the ball all around the screen and showing the movement of it.


Describe what you have tried to solve this problem
Alot.  I have tried different ways of moving it, but still have problems.


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
This is the main part of moving the ball.  Not entire program posted.


var x_s, y_s : int := 1  % sflake coordinates
var width_s : int := 59 % sflake width
var sflake : int := Pic.FileNew ("sflake.gif")

loop

x_s := Rand.Int (1, maxx)
y_s := Rand.Int (1, maxy)

Pic.Draw (sflake, x_s, y_s, picMerge)
if (x_s + width_s) >= (maxx - 1) then
        x_s := x_s * -1

    elsif (y_s + width_s) >= (maxy - 1) then
        y_s := y_s * -1
    elsif (x_s - width_s) 