Jump to content

Is there a trick to reset all sprites, missiles, and ball?


4 replies to this topic

#1 ONLINE  

    Visual batari Basic User

  • 20,538 posts
  • Joined: 23-April 01
  • Controlled Randomness

    Replay Value

    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Mar 14, 2010 2:52 AM

It seems batari Basic has all kinds of little hidden asm keywords that work without specifically using asm as it's described in the manual, so is there a keyword or two or more that will quickly clear the sprites and make them and the missiles and ball reset to an off-screen position? Maybe RESETCLEARALLMAGIC=0 or something like that?

Thanks.


[I should probably say that I know about reboot, but that can screw up random numbers, so I want to avoid it.]

Edited by Random Terrain, Sun Mar 14, 2010 3:17 AM.


#2  

    River Patroller

  • 4,411 posts
  • Joined: 07-August 05
  • Location:Georgia, USA

Posted Sun Mar 14, 2010 1:43 PM

View PostRandom Terrain, on Sun Mar 14, 2010 2:52 AM, said:

is there a keyword or two or more that will quickly clear the sprites and make them and the missiles and ball reset to an off-screen position?
There's no TIA register to do that. As far as I know, the quickest way to do it in batari Basic is to set their y positions to 255, all in a row:

   player0y=255:player1y=255:missile0y=255:missile1y=255:bally=255
If you want to do it from several places in your program, you can make it a subroutine:

reset_sprites
   player0y=255:player1y=255:missile0y=255:missile1y=255:bally=255
   return
(I was going to suggest setting them to 0, but part of player1 was still visible at the top of the screen, so I went with 255.)

Michael

PS: This doesn't clear their graphics, it just moves them all offscreen.

Edited by SeaGtGruff, Sun Mar 14, 2010 1:44 PM.


#3 ONLINE  

    Visual batari Basic User

  • 20,538 posts
  • Joined: 23-April 01
  • Controlled Randomness

    Replay Value

    Nonlinear
  • Location:North Carolina (USA)

Posted Mon Mar 15, 2010 1:00 AM

Thanks. I'll try that tonight or this morning or whatever this is now.

#4  

    Dragonstomper

  • 570 posts
  • Joined: 18-February 10

Posted Mon Mar 15, 2010 10:42 AM

View PostSeaGtGruff, on Sun Mar 14, 2010 1:43 PM, said:

View PostRandom Terrain, on Sun Mar 14, 2010 2:52 AM, said:

is there a keyword or two or more that will quickly clear the sprites and make them and the missiles and ball reset to an off-screen position?
There's no TIA register to do that. As far as I know, the quickest way to do it in batari Basic is to set their y positions to 255, all in a row:

   player0y=255:player1y=255:missile0y=255:missile1y=255:bally=255
If you want to do it from several places in your program, you can make it a subroutine:

reset_sprites
   player0y=255:player1y=255:missile0y=255:missile1y=255:bally=255
   return
(I was going to suggest setting them to 0, but part of player1 was still visible at the top of the screen, so I went with 255.)

Michael

PS: This doesn't clear their graphics, it just moves them all offscreen.

I haven't seen that with 0 myself, but to be honest, I have only written two programs. Does that happen in the normal res, with bankswitching, or when you go high res with the superchip?

#5  

    River Patroller

  • 4,411 posts
  • Joined: 07-August 05
  • Location:Georgia, USA

Posted Mon Mar 15, 2010 8:33 PM

View PostCliff Friedel, on Mon Mar 15, 2010 10:42 AM, said:

View PostSeaGtGruff, on Sun Mar 14, 2010 1:43 PM, said:

(I was going to suggest setting them to 0, but part of player1 was still visible at the top of the screen, so I went with 255.)
I haven't seen that with 0 myself, but to be honest, I have only written two programs. Does that happen in the normal res, with bankswitching, or when you go high res with the superchip?
I'm pretty sure that setting everything to a y position of 0 *used* to move them completely offscreen. But I'm not 100% sure what include files I'm using anymore. I mean, I know what the dates and times on them are, but I've probably tinkered with some of them, and I might need to just reinstall bB from scratch to be sure what I have. I'm using the standard kernel, with no kernel options. The date on my std_kernel.asm file is 12/28/2008, time 7:42 PM.

Michael





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users