How to prevent projectile and "medusa head" slowdowns

User avatar
Posts: 185
Joined: Thu Sep 06, 2018 3:51 am

Re: How to prevent projectile and "medusa head" slowdowns

Post by chronicleroflegends » Thu May 16, 2019 2:54 pm

WillElm wrote:
Wed May 15, 2019 12:50 am
chronicleroflegends wrote:
Wed Apr 03, 2019 12:44 am

checkforhorizontalcollision4pt ( just comment out the code for middle left and middle right)
What exactly am I gonna comment out here? I got rid of everything from the left middle comment to the doRightHorColCheck label, and also got rid of what I thought was the same corresponding code for the right. This is the code I got rid of

It didn't seem to hurt anything, but I also can't tell if it made any difference in my game.

I hope this isn't too ridiculous. I've learned a good bit of asm in my short time, mostly to do with movement and variables, but I'm having a tough time following most collision related stuff.
This is the block of code for middle left for example: (commented out)

Code: Select all

;;;;; left middle
	; LDA Object_bottom,x
    ; SEC
    ; SBC Object_top,x
    ; LSR 
    ; STA temp3 ;; temp 3 now equals half of the height of the object, so top+temp3 = mid point vertically.
    ; LDA xHold_hi
    ; CLC
    ; ADC Object_left,x
    ; STA tileX

    ; LDA Object_y_hi,x
    ; CLC
    ; ADC Object_top,x
    ; CLC
    ; ADC temp3
    ; STA tileY
    ; JSR GetTileAtPosition
    ;;JSR DetermineCollisionTable
	  ; LDA #$00
	; STA temp
	; DetermineCollisionTableOfPoints temp
    ; STA collisionPoint4
    ; JSR CheckForCollision
    ; LDA tile_solidity
	; AND #%00000001
    ; BEQ +
    ; JMP HandleSolidCollision ;; hit a solid so won't update position.
; +
    	; LDA tile_solidity
	; AND #%00000010
	; BEQ +
	; LDA Object_physics_byte,x
	; AND #%00000010
	; BNE +
	; JSR DoLadderStuff
; +
	; JMP doneWithHorColCheck
~Do you believe in legends? ~
My Games: Nix: The Paradox Relic
Posts: 75
Joined: Wed Mar 20, 2019 3:56 am

Re: How to prevent projectile and "medusa head" slowdowns

Post by WillElm » Thu May 16, 2019 10:02 pm

thanks, looks like my instincts were right for once. I meant to paste the left one into the first code box in my last post.

I just A/B compared, and it has a very slight effect on performance and every little bit counts. Right now my game has very intermittent slowdown, but I feel like it affects gameplay as much as more consistent slowdown, because it's very sudden starts and stops.
Posts: 63
Joined: Thu Jun 13, 2019 3:51 am

Re: How to prevent projectile and "medusa head" slowdowns

Post by Razzie.P » Wed Jul 24, 2019 1:57 am

Thanks for this! Now that I've finished my rough build, I'm going back to work on the polish and details, and this seems like a great place to start. I'm having a bit of trouble wrapping my head around how I can apply this to my specific game situation, though, so any help you can offer would be greatly appreciated in a thread I created here to avoid cluttering this tutorial!
Post Reply