Jump to content
  • entries
    34
  • comments
    88
  • views
    25,622

Bigger Drones

Sign in to follow this  
Guest

281 views

All righty then. Thanks all for the feedback on the drones. I have attached a version with the drone size increased to 2x2 versus the original 1x1. I also improved their behavior so that they do not keep firing back and forth. Let me know what you think. I have also attached the source code for the drones and the main program with the binary. The drones are implemented as state machines. They are in a Hunting state going along the edge. They enter the Fire state when lined up with the player at 90 degrees to the direction of travel. After they fire and reach the opposite edge, they enter the rest state which they stay in until they turn a corner, then they reenter the hunt state and begin again. There is a separate version of each state for each direction, and I use a table of pointers indexed by the state of the drone to call the correct function for updating the drone. The DroneUpdate subroutine is written to update any number of drones from 0 to N; so I can easily adapt it to different game levels with different numbers of drones. I still need to implement an inversion function that will take the result of the state function for every other drone and invert it by flipping the 2 lowest order bits of newly transitioned state values. The result will be drones that hunt in a clockwise direction as oppose to the current counter clockwise behavior.The next big obstacle to tackle is player movement and control. I need to get at least rudimentary control in place and then I can refine it as the game develops. I am foreseeing it will be implemented in a state machine fashion similar to what I am using for the drones. The player sprite is associated with a state value used to index a table of function pointers. Within each state function the joystick position and PF graphics under the player are analyed to yeild a position update and possibly a state change. For those with PAL setups, I do plan to support NTSC and PAL as separate releases. I don't see it as practical to try and support both formats with one binary. I am too dependent and large numbers of constants based on the frame rate to do it that way. I am striving to make the game play exactly the same in both frame rates. For example to control the speed of objects under both formats, every game object has one or more speeds declared as number of pixels moved per second from 0 to 50. Then, internally that speed is translated into a fraction by the formula:OBJECT_SPEED_FRACTION = OBJECT_SPEED * 255 / FRAMES_PER_SECONDThe result of the equation is a single byte from 0 to 255. For each game object, I maintain a one byte fraction of pixel movement. Every frame the OBJECT_SPEED_FRACTION is added to the current pixel fraction. If the result sets the carry flag then the object moves a single pixel in the direction it is currently going. Cheers!

Sign in to follow this  


5 Comments


Recommended Comments

The bigger drones look better to me! Is it possible to change their colour so that they don't blend in with the platforms?

 

Chris

Share this comment


Link to comment
The bigger drones look better to me!  Is it possible to change their colour so that they don't blend in with the platforms?

 

Chris

 

 

Yes, I can change their color or even make them flash. I will make that change in the future.

 

Thanks for the feedback,

Share this comment


Link to comment

Skeleton & Skeleton+ were released as separate NTSC and PAL versions. In addition to correcting for the different frame rates, you also need to consider how you will handle the extra vertical resolution. Stretching stuff by 20% ain't always possible (The PAL Skeleton has an extra rib!) and it can increase the size of any stored bitmaps. (Which really made PAL Skeleton/Skeleton+ a tight fit in 4K.) Also don't forget to adjust any vertical velocity vectors!

Share this comment


Link to comment
In addition to correcting for the different frame rates, you also need to consider how you will handle the extra vertical resolution. 

 

 

I am going to take the easy way out and put a blank strip at the top and bottom of the screen :)

 

Cheers!

Share this comment


Link to comment
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...