Jump to content
Sign in to follow this  
RSS Bot

SpiceWare's Blog - Fireballs revamped

Recommended Posts

I rewrote the fireball movement routines to use less RAM. I tried out REALbasic in order to create the direction/speed tables. It's a little qwerky, but it got the job done.

 

The direction/speed is now stored in a single byte for each fireball. When viewing the bits as 76543210, bits 765 control the speed while 43210 control the direction. This yields 7 speeds(speed 0 flags a not-moving fireball) and 32 directions. The directions are set up like this:CODE 0

^

|

24<--+-->8

|

v

16

 

If the fireball bounces off the top or bottom the direction is changed using (16 - DirSpeed) and %11111.

 

If the fireball bounces off the left or right side the direction is changed using (32-DirSpeed) and %11111.

 

In the attached BIN I have 1 fireball going at speed 1 with an initial direction of 4. The fireball with speed 4 starts out going in direction 3, and the fireball with speed 7(the fastest) starts out in direction 5. While the PAL tables are in place, I haven't yet made the routienes use them so the fireballs will slow down if you change to PAL mode.

BIN mm.bin

 

Source Medieval_Mayhem.zip

 

http://www.atariage.com/forums/index.php?a...&showentry=1454

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...