A83: What's wrong?


[Prev][Next][Index][Thread]

A83: What's wrong?




Ok, I made a little program.  This is my first program using SOS and my first
program using sprites...and I have a small, teeny-tiny problem.  Well, what
the program (supposedly) does is bounce a little happy-face around the screen.
I have 4 variables, xc, yc, dx, and dy.  Xc holds the x coord, yc holds the y
coord, dx holds the direction x is moving (0 for right, 1 for left) and dy
holds the direction y is moving (0 for down, 1 for up).
I'm using the sprite routine in ZLIB (lib1).
The problem is that when the sprite gets to the bottom of the screen, not only
does the direction of y change, the direction of x also changes!  So, it's
just going from the top left corner to the bottom right (not quite corner,
about 30 pixels from the corner).
If you would like the source code to find out what's wrong, I have uploaded it
to my webpage, you can find it at www.hmph.com/bouncy.asm
Feel free to visit my starcraft page while you're at it :P
-Rangsk