Subject: Re: [stella] Object handler organisation From: Christopher Tumber <christophertumber@xxxxxxxxxx> Date: Fri, 08 Nov 2002 14:28:10 -0500 |
>I've a data structure for things the kernel can display. >The kernel just executes and draws these objects, >without knowing what is what, they all are treated >equal, obviously I don't have the time in the kernel for >distinguishing between drawing a ship or a meteor or >anything. Ahhh, I see, makes sense! So ignore my previous post then! (Except the parts about jsr/rts and GeneralMovement, JoystickMovement, CollisionDetection and ZMovement - But you knew all that already) Okay, how about a slight re-org of the testing: MoveNextSprite LDA sprtsizetype,X CMP #$20 BMI NoMeteorSprite BNE IsShipSprite JSR GeneralMovement ; General Movement JSR JoystickMovement ; Move according to Joystick JSR CollisionDetection ; Handle Collision with shot JSR ZMovement ; Move along the z axxis JSR HandleMeteor ; Special meteor handling JMP Spritedone ; Done IsShipSprite JSR GeneralMovement ; General Movement JSR JoystickMovement ; Move according to Joystick JSR CollisionDetection ; Handle Collision with shot JSR ZMovement ; Move along the z axxis JSR HandleShip ; Special ship handling JMP Spritedone ; Done NoMeteorSprite ... - Assumes you're actually looking for values of #$20 and #$28 and not a range of values, if you are then you're back to ignoring my posts (smile). - If your VoidObject is a "dead" object, can you change it's value from #$0f to #$00? Then you can: MoveNextSprite LDA sprtsizetype,X BEQ IsVoidObject CMP #$20 BMI NoMeteorSprite BNE IsShipSprite ... (If it's something else, then ignore this too. I'm only suggesting this because a "dead" (or unused) object is going to be a very common object so it makes sense to be checking for it early, particularly if we can eliminate a compare...) Again, assuming the VoidObject is a "dead" object, when you're Z sorting objects, can you also sort so that VoidObjects are always at the end of the list? So as soon as you hit the first VoidObject you can abort processing... MoveNextSprite LDA sprtsizetype,X BEQ Spritedone CMP #$20 BMI NoMeteorSprite BNE IsShipSprite ... So you'd only be processing objects which are still alive. And since you're doing collision detection here too, anything that "dies" this frame will be sorted for the next display and then the next time we return to these routines it will be at the end of the list. Chris... ---------------------------------------------------------------------------------------------- Archives (includes files) at http://www.biglist.com/lists/stella/archives/ Unsub & more at http://www.biglist.com/lists/stella/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [stella] Object handler organis, Manuel Polik | Thread | Re: [stella] Object handler organis, Manuel Polik |
Re: [stella] Textpad Macros, Manuel Polik | Date | Re: [stella] Textpad Macros, Thomas Jentzsch |
Month |