Jump to content
  • entries
    657
  • comments
    2,692
  • views
    898,671

Fireballs revamped


SpiceWare

768 views

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:

     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

 

SourceMedieval_Mayhem.zip

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...