Jump to content

Photo

Can somebody post the bare minimum to read paddle?


41 replies to this topic

#26 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,680 posts
  • begin 644 contest

Posted Fri Aug 5, 2005 12:56 AM

So, the timer is actually counting while the basic program is running.  At least that's the only reason I can see for such a large value.  So every 64 cycles of basic code should yield a different number.  Maybe I just didn't get lucky with my samples.  (trying that again.)

Yes, this is true.

Since I'm on Linux, Stella is basically the emulator I'm going to be running.

View Post

There is now a Linux port for z26.

#27 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,680 posts
  • begin 644 contest

Posted Fri Aug 5, 2005 1:00 AM

Still a minor problem with display, now ALL pfpixel scanline breaks are 1 pixel too high! Paddle works though, thanks for the kernel.

For everyone's information, when drawing a playfield with PF0=128, the left boundary is 31 and the right is 151, giving you a 120 pixel playfield.

Also, what do I have to do to enable the ball? Just give it an X, Y, and height? I'm assuming a height of 0 disables it.

View Post

You're right, I messed up that kernel too. I think I fixed this, so I edited the above post with what I hope to be a corrected version.

Also, on the ball, to turn it off, simply position it off of the visible screen by setting bally large enough. 100 should work.

#28 potatohead OFFLINE  

potatohead

    River Patroller

  • Topic Starter
  • 4,404 posts
  • Location:Portland, Oregon

Posted Fri Aug 5, 2005 1:53 AM

So, the timer is actually counting while the basic program is running.  At least that's the only reason I can see for such a large value.  So every 64 cycles of basic code should yield a different number.  Maybe I just didn't get lucky with my samples.  (trying that again.)

Yes, this is true.

Since I'm on Linux, Stella is basically the emulator I'm going to be running.

View Post

There is now a Linux port for z26.

View Post



Nice. I'll give this a shot at some point in the near future and give my plan b paddle idea another try. I liked supercat's idea too. Splitting the read over a few frames.

The only drawback would be the loss of instant paddle movement from extreme side to side.

However, moving 16 values at a time, per frame, doubled makes 32 pixel movement possible every frame. For almost all paddle moves, this would be really a good comprimise. The only difference the player would experience, over a full on kernel paddle read, would be a latency on extreme moves that could be as high as 1/3 second. (With the paddle value doubled that is.) For my game, that would be totally workable. Going to think his idea over a bit... I'll bet it takes two bytes of storage to implement though.

Right now, I don't need paddle support for the game. I think I probably should be working on is trimming the fat in order to add the last coupla features. I've about 300 bytes left at this point and 3 variables. If I can rewrite some things to free up another byte or two, that will be enough to allow for a power up (faster bullets) and some fast moving ooze drops to avoid while battling the ooze.

Hard to decide if the features are worth more than really intense gameplay would be with the features that exist today...

Edited by potatohead, Fri Aug 5, 2005 1:55 AM.


#29 Luigi301 OFFLINE  

Luigi301

    Moonsweeper

  • 372 posts

Posted Fri Aug 5, 2005 7:50 AM

What variable sets the ball's color?

#30 potatohead OFFLINE  

potatohead

    River Patroller

  • Topic Starter
  • 4,404 posts
  • Location:Portland, Oregon

Posted Fri Aug 5, 2005 10:48 AM

What variable sets the ball's color?

View Post


I don't think the ball is in the kernel just yet. Batari mentioned one kernel with a ball and both paddles though.

COLUMPF = [color] will work to change the color of the ball, I think.

#31 vdub_bobby OFFLINE  

vdub_bobby

    Quadrunner

  • 5,832 posts
  • Boom bam.
  • Location:Seattle, WA

Posted Fri Aug 5, 2005 1:49 PM

What variable sets the ball's color?

View Post

Ball is same color as playfield. You set both by setting the color of the playfield, with COLUPF. :)

#32 Luigi301 OFFLINE  

Luigi301

    Moonsweeper

  • 372 posts

Posted Fri Aug 5, 2005 3:15 PM

Well then the ball doesn't work either. :(

I have the following for ball code:

  ballx = 70
  bally = 50
  ballheight = 4

I inserted that before my drawscreen. The playfield obviously has a color, so I don't know why it won't show up.

#33 vdub_bobby OFFLINE  

vdub_bobby

    Quadrunner

  • 5,832 posts
  • Boom bam.
  • Location:Seattle, WA

Posted Fri Aug 5, 2005 3:26 PM

Well then the ball doesn't work either. :(

I have the following for ball code:

  ballx = 70
  bally = 50
  ballheight = 4

I inserted that before my drawscreen. The playfield obviously has a color, so I don't know why it won't show up.

View Post

Well, first of all, I think the ball only exists in the paddle kernel that batari attached in this thread - it doesn't exist in the standard bB kernel.

Also: if the ball is in the same place as a playfield block, you won't see it - since they are both the same color! ;)

#34 Luigi301 OFFLINE  

Luigi301

    Moonsweeper

  • 372 posts

Posted Fri Aug 5, 2005 10:02 PM

Yes, I'm using Batari's paddle kernel. I made the line that jumps to loading a level jump to the next line, so there is no playfield at all.

#35 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,680 posts
  • begin 644 contest

Posted Fri Aug 5, 2005 11:33 PM

Yes, I'm using Batari's paddle kernel. I made the line that jumps to loading a level jump to the next line, so there is no playfield at all.

View Post

I thought I had correctly added the ball, but I didn't :dunce:
Anyway, I found the problem. Here's the corrected kernel. I've also deleted the kernel above. Hopefully everything works this time.

Attached Files



#36 Luigi301 OFFLINE  

Luigi301

    Moonsweeper

  • 372 posts

Posted Sat Aug 6, 2005 8:09 AM

I noticed the file size shrinks each time you upload a new one... :P

Does the ball have only one thickness?

Edited by Luigi301, Sat Aug 6, 2005 8:11 AM.


#37 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,680 posts
  • begin 644 contest

Posted Sat Aug 6, 2005 5:10 PM

I noticed the file size shrinks each time you upload a new one... :P

Does the ball have only one thickness?

View Post

It has four thicknesses. In bB, you would change the ball thickness by the following:

1 pixel wide (default): CTRLPF=$01
2 pixels wide: CTRLPF=$11
4 pixels wide: CTRLPF=$21
8 pixels wide: CTRLPF=$31

#38 Luigi301 OFFLINE  

Luigi301

    Moonsweeper

  • 372 posts

Posted Sat Aug 6, 2005 6:59 PM

The ball code I'm using makes the ball appear in Stella but not in Z26, and in neither does the ball move at all.

ballinit
  n = rand
  if n < 63 then t = 1 && u = 1
  if n < 127 && n > 63 then t = 1 && u = 0
  if n < 191 && n > 127 then t = 0 && u = 1
  if n < 255 && n > 191 then t = 0 && u = 0
  goto ballmove

ballmove
  if m = 0 then goto 70
  if t = 1 then ballx = ballx + 1
  if t = 0 then ballx = ballx - 1
  if u = 1 then bally = bally + 1
  if u = 0 then bally = bally - 1
 goto 17

Why won't my ball move? M is set to 1 upon pressing fire.

Edited by Luigi301, Sat Aug 6, 2005 7:00 PM.


#39 potatohead OFFLINE  

potatohead

    River Patroller

  • Topic Starter
  • 4,404 posts
  • Location:Portland, Oregon

Posted Sat Aug 6, 2005 9:51 PM

The ball code I'm using makes the ball appear in Stella but not in Z26, and in neither does the ball move at all.

ballinit
  n = rand
  if n < 63 then t = 1 && u = 1
  if n < 127 && n > 63 then t = 1 && u = 0
  if n < 191 && n > 127 then t = 0 && u = 1
  if n < 255 && n > 191 then t = 0 && u = 0
  goto ballmove

ballmove
  if m = 0 then goto 70
  if t = 1 then ballx = ballx + 1
  if t = 0 then ballx = ballx - 1
  if u = 1 then bally = bally + 1
  if u = 0 then bally = bally - 1
 goto 17

Why won't my ball move? M is set to 1 upon pressing fire.

View Post


Can you post the whole thing?

#40 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,680 posts
  • begin 644 contest

Posted Sat Aug 6, 2005 10:40 PM

The ball code I'm using makes the ball appear in Stella but not in Z26, and in neither does the ball move at all.

ballinit
  if n < 63 then t = 1 && u = 1
  if n < 127 && n > 63 then t = 1 && u = 0
  if n < 191 && n > 127 then t = 0 && u = 1
  if n < 255 && n > 191 then t = 0 && u = 0

Why won't my ball move? M is set to 1 upon pressing fire.

View Post

I think you want to separate the statements after the "then" with a colon. If you use &&, for example on the first statement, I think it will assign t to the logical AND between 1 and u and ignore the second =. I'd try this:
ballinit
  if n < 63 then t = 1 : u = 1
  if n < 127 && n > 63 then t = 1 : u = 0
  if n < 191 && n > 127 then t = 0 : u = 1
  if n < 255 && n > 191 then t = 0 : u = 0

Edited by batari, Sat Aug 6, 2005 10:40 PM.


#41 Luigi301 OFFLINE  

Luigi301

    Moonsweeper

  • 372 posts

Posted Sun Aug 7, 2005 12:51 PM

Doesn't work either. Here's my code.

Attached Files



#42 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,680 posts
  • begin 644 contest

Posted Sun Aug 7, 2005 3:29 PM

Doesn't work either. Here's my code.

View Post

OK, that clears things up a bit.

I found a few issues in the code:
26 if o < 151 then o = 151 : if switchrightb then goto 27 : if o < 28 then o = 28 : if o > 142 then o = 142
You probably want to put these if-thens on their own lines. The last two will never be reached.
30 if switchleftb then goto 50 else goto 31
bB doesn't support "else" right now - the compiler will ignore the else.
51 if joy0fire && m = 0 then goto startball
The fire button on the paddles is actually read by joy0left and joy0right.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users