Jump to content
IGNORED

Ball help


atari2600land

Recommended Posts

I'm making a game where a bird drops the ball on top of a wall. I got the ball in after a few hours BUT the ball still goes and draws itself even after it lands on the wall, making it look like this:

bert12a.png.d151797c921b9175c5f4b03b09f823bd.png

It does this no matter whether I try to set ENABL to 0 or not. Not only that, the ball height is only supposed to be 4 pixels tall and not stretched like that. Why is it doing this? What am I doing wrong? (Keep in mind that if you decide to help and download the asm file, it is actually under 1,000 lines. The rest is data.)

 

bert12a.asm

Link to comment
Share on other sites

The problem is with setting of VDELBL. The branch to skip setting VDELBL is never taken since you do a clc earlier. I'm not sure what you were going for there, but commenting out the "stx VDELBL" line allows the ball to appear the expected height.

 

Draw_Ball:		
    ; prime ENABL so ball can appear on topmost scanline of Arena
    ; prep ball's Y position for 2LK 
        lda PlayerY+4       ; get the balls's Y position
        clc
       ; adc #1              ; add 1 to compensate for priming of ball        
       ; lsr                 ; divide by 2 for the 2LK position
        sta Temp            ; save for position calculations
        bcs NoDelayBL        ; if carry is set we don't need Vertical Delay
        ldx #1              ; preload X for setting VDELPx        
        stx VDELBL          ; carry was clear, so set Vertical Delay

bert12a.thumb.png.1d29558eea5bb12790c0f71f53138bef.png

 

Link to comment
Share on other sites

I want the ball to land on the wall, though. So I commented out that part and set the value to stop it at 4 instead of 5 and I get this:

bert12a_1.png.38250034a7e20a5eadc36ff2968101cd.png

 


        lda PlayerY+4
        cmp #4
        beq MMMM

        lda PlayerY+4
        sbc #1                ;     make Ball fall.
        sta PlayerY+4

        lda PlayerY+4
        cmp #4
        bne MMMM

 

 

Link to comment
Share on other sites

  • 3 years later...
50 minutes ago, freshbrood said:

Another question about the ball:

 

Does it ALWAYS get drawn BEHIND every other object on the screen? (unless you specifically set the p0 and p1 sprites to appear behind the playfield blocks? 

Yes; the ball and playfield have the same priority, which is lower than the player and missile objects unless bit 2 is set in CTRLPF.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

17 minutes ago, freshbrood said:

Thanks Karl. 

 

In short, is there ANY way to see the ball (if only even a pixel or two) along the very eges of the drawn screen if the pfblocks and background colors are the same?

No. You wouldn't see the playfield, either, though. I don't see a purpose of such a setup unless the playfield/ball were given priority,and it was used to hide players or whatnot. Otherwise, everything else gets drawn over it.  I suppose it could be used for an invisible maze since you can still test for collisions.

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   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...