RetroChallenge #3, part 8. I lied to myself.
So I sat to redo the graphics. The first thing I realized was that I still, after 30 years, don’t understand how the DRAW command really works when moving just one or 2 pixels. So I ended up using a lot of LINE and PSET, but that is all right. I also started using
DRAW” BM100,100;M110,110;BM70,100;M70,110″
instead of
LINE(100,100)-(110,110),PSET:LINE(70,100)-(70,110),PSET
since it is a lot shorter, not just to store, but also to type.
It was at that time that I noticed that my “bug” sprite was only 11 pixels high, and the player’s was 13…. No big deal, small redesign, with a little hat for the player.
Then, it was just a matter of using a “flag” variable – C in this case, to determine which of the 2 sprites for each character to PUT. If C=1 then C=0 and use one set of sprites, if not, then C=1 and use the other set.
IF C THEN PUT(X,Y)-(X+11,Y+11),P1,PSET:PUT(Y,X)-(Y+11,X+11),P1,PSET:C=0 ELSE PUT(X,Y)-(X+11,Y+11),P2,PSET:PUT(Y,X)-(Y+11,X+11),P2,PSET:C=1
And it looked quite good! But… the “Chomper”… the animation did not look good. Soooo I changed the movements to have the characters step 6 pixels at a time. Of course, that will make them take longer to go from one side of the screen to the other, but that is not a big deal.
But then, I discovered my lie.
The “reason” why I did the new graphics was so that all of them matched the movement grid size, 12×12, making collision detection a lot easier.
But now, the movement grid is 6×6!
Instead of the simple
IF H=X AND V=Y GOSUB 580
I had to go with
IF H>X-12 AND HY-12 AND V<Y+12 GOSUB 580
Well, the game was still reasonably fast. And since I noticed that the lone Chomper was not really much of a threat… why not add a second one?
Leave a Reply