Jump to content
IGNORED

Boing Demo


CurtisP

Recommended Posts

Anyone remember the Boing Demo from the Amiga. Don't know if it's been done on the 2600 before, but I thought I'd try it in bAtari Basic.

 

So far I've defined the sprites for the ball and made it rotate. Movement and sound will come later...

Since Boing has already been done, you might want to call this one bB_Boing ("buh-buh-BOING"). :D

 

Nice rotating ball, by the way!

 

Michael

Link to comment
Share on other sites

Since Boing has already been done, you might want to call this one bB_Boing ("buh-buh-BOING"). :D

I like that, I shall rename it accordingly.

 

Nice rotating ball, by the way!

Thanks. I made it lateral, instead of diagonal, since there is so little resolution in a 16x16 area.

Link to comment
Share on other sites

Why not 18x18? BB lets you position the missiles arbitrarily, doesn't it?

 

That's true, I could use the missiles as the left and right side of the ball. But then I've already drawn the ball and it came out pretty nice. I wonder if there's something I could do with the ball...

Link to comment
Share on other sites

Looking forward to movement and sound. I hope you don't mind but here is snippet of code to help with the movement in bBasic. I wanted to point out the necessity in using the 0.0 - var format for inverting a fixed point var.

 

rem Setting up x position y position x velocity and y velocity as fixed point variables

dim xpos = a.b
dim ypos = c.d
dim xvel = e.f
dim yvel = f.g

rem Somewhere in your loop
rem update x position y velocity and y position (gravity constant is 0.8)

xpos = xpos + xspeed
yvel = yvel + 0.08
ypos = ypos + yvel

rem Bounce

if ypos < 90 then goto setPos

rem Reflect y velocity and restore y position, you must use this form instead of yvel = -yvel
yvel = 0.0 - yvel
ypos = ypos + yvel

setPos

Link to comment
Share on other sites

Looking forward to movement and sound. I hope you don't mind but here is snippet of code to help with the movement in bBasic. I wanted to point out the necessity in using the 0.0 - var format for inverting a fixed point var.

 

I don't mind at all. Thanks for the code.

Link to comment
Share on other sites

If you just modify the code starting at line 55, you can get a nice bounce. Just adding the gravity to the yvel every frame and then make sure to restore the ypos in the bounce part of the if. Here is the mod in bold text.

 

yvel = yvel + 0.08

ypos = ypos + yvel

if ypos < 23 || ypos > 80 then yvel = 0.0 - yvel: ypos = ypos + yvel: temp1 = 1

Link to comment
Share on other sites

If you just modify the code starting at line 55, you can get a nice bounce. Just adding the gravity to the yvel every frame and then make sure to restore the ypos in the bounce part of the if.

 

From what i recall the original Boing Demo didn't have gravity anyway. I think I'd rather make the ball bigger. One of the big deals on the Amiga was how large the ball was.

Link to comment
Share on other sites

That black area at the bottom of the screen was totally bothering me. Since score was turned off, I simply set pfrowheight to a high enough value (10) to make the playfield fill the screen. I then decided to use PF0 to draw in the left and right borders, and cleared the borders from my playfield definition.

 

It turns out that bAtari Basic doesn't have a hard limit on the Sprite Y values, it will keep displaying sprites as long as it's displaying playfield, so I changed my boundaries accordingly, and now I'm bouncing aroud the whole screen.

bBboing.bas

bBboing.bas.bin

Link to comment
Share on other sites

  • 3 weeks later...

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