Jump to content
IGNORED

Mord's Blog - Collision Detection Rewrite


RSS Bot

Recommended Posts

For budding 6502 programmers.

 

 

	ldx #7							  ; We load the Collision Pointer.
lda (SpriteP1_SpriteDataPtrLow),x   ;
sta Collision_PtrLow				;
ldx #9							  ;
lda (SpriteP1_SpriteDataPtrLow),x   ;
sta Collision_PtrHigh			   ;

jmp (Collision_PtrLow)

 

This code compiles with dasm just fine.

 

But it is INCORRECT. To get the proper addressing mode, you must use the Y instead of the X. Something I keep forgetting to double check since dasm won't break down on me when it compiles. I just spent an hour looking at the code and the associated code around it going "There's an error here. HERE. It is obvious. It has to be or I'd have found it by now... *stares at loading of pointer* I bet it's staring me right... in... the.... eye...."

 

:ponder:

 

Anyway the basis for the real Collision Handler is now functioning for Player-to-object collisions. I can see some uses for object-object collision checks as well. That'll be easy enough to add in later. Next part to generalize is the object itself. Both it's AI routine, and it's collision routine. This step will be to rewrite the hardwired heart object so that's aware of where it is in the item list and act on the appropriate item slot. Right now it functions while hardwired to the Region 1 object slot.

 

 

 

 

 

 

 

 

 

http://www.atariage.com/forums/index.php?a...;showentry=3727

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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