God forbid I make a game by myself

Started by Chris!, August 18, 2023, 04:47:12 PM

Previous topic - Next topic

Chris!

I need help with this stupid game I'm making.
It's a fly swatting game. But every time I press fire, it displays the title screen. When I depress the fire button, it goes back to the game. If I do this three times, the game crashes. Why must I suck at this? What am I doing wrong?! Can someone please help me with this?
You cannot view this attachment. 
All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html

Chris!

Never mind. I fixed it. But I don't know how.
All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html

Chris!

I'd like to put another fly in the fly game but it seems to be really hard. Without taxing the console, how can I put another fly in the game? I attached my code.
All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html

Pickaxe Brad!

The flickering you are seeing is because you're leaving the gfx off for (practically) the entire time your code is executing.  The Odyssey¬≤ isn't over taxed, you're asking it not to draw.  See the code below:

Quotedrawscreen
   call  gfxon
   ; *EDIT* This line is the only time each frame when the O¬≤ has its graphics enabled--and it's only after all your other code for the frame is done executing.  You'll notice as you grow your program gfx will be off for longer and longer making it a growing "flicker" from the top of the screen.
   call   waitvsync   
   call  gfxoff

   ret   

My suggestion would be to use the "tables" method described by Soren in Chapter 3, "Using interrupts to change VDC registers", and don't call gfxoff unless you've maxed out what the tables can do.

I hope this helps.  It's a bit more work to do things this way, but it saves sooo much time from running down stupid display issues with the program.  Actually, I'm over stating the effort; it's just some more setup at game initialization and then LESS work during the actual running of the gameplay.
Does anyone read these signatures?  Let me know in your signature.

TedFoolery

THANK YOU THANK YOU THANK YOU Brad! The one great thing that the VP/O2 had over the Atari was that there wasn't any flicker. Using the tables method of drawing on the screen was always the key to this, but I see seldom people use it.

Pickaxe Brad!

Quote from: TedFoolery on August 24, 2023, 04:39:12 AMTHANK YOU THANK YOU THANK YOU Brad!

You're very welcome, Ted.  ;)

I can say that for my first game, I didn't use the tables.  It seemed more difficult than it actually is, but also I was having trouble consistently compiling the program because I didn't completely understand all the rules on the 256 byte boundaries and 1k boundaries (and the magic SEL MB0/MB1), etc.  I know a lot more now, but I'm still learning.  My deep dive into Pick Axe Pete's code was enlightening and humbling.  But a big takeaway from it was that gfxoff is never called.  Odyssey2 is meant to be programmed with gfxon the entire time!
Does anyone read these signatures?  Let me know in your signature.