Jump to content
IGNORED

Writing More of My First Lines of Code in Batari Basic - Night Driver Arcade Mini Game


Recommended Posts

NIGHT DRIVER ARCADE MINIGAME

 

Spoiler

image.jpeg.3e003d3823b6959f57bbb854dd858845.jpeg

Phosphor effect was not used to capture this screenshot.  

  • For this minigame, turn phosphor off.  There is no flicker.  
  • Use the paddle controller.  
  • Press F2/Reset to start over.

It's not a playable game yet, but you can turn the steering wheel and press down on the accelerator pedal on the floor and watch the road turn.  

 

Latest Version

minigame_0.04.bas.bin The game timer in the lower right hand corner has now been activated.  Press F2/Reset to start over.  

 

Version History

Spoiler

v 0.03  Batari's split 3-digit score has been activated on the bottom of the screen.  

v 0.02  missile1 was used to draw the accelerator pedal, eliminating the flicker.  

v 0.01  the road turns; the player controls the steering wheel and accelerator pedal with paddle controller.  There is flicker.  

  • Like 2
Link to comment
Share on other sites

PLANNING OUT THE MINI GAME

 

Spoiler

My current thoughts about how the mini game would work internally.  

 

Spoiler

Road-Speed of Car-Acceleration mechanism

2 bytes 8.8 fixed decimal format - speed of car (0-100)

Note: this speed of car (0-100) is not calibrated to the speed of car in the arcade (0-350).  

We are not trying to match up the speed of car in this mini game to the speed of car in the arcade version.

In 1 sec., let the car accelerate "10" whatever that means.  
60 fps
"10" / 60 = 0.167/frame
Each frame that the player holds the paddle button down, add 0.167 to speed of car.
After 60 frames/1 sec., the car will have increased its speed by "10," whatever that means.

If the player were to hold down the paddle button and not crash for 10 seconds, the car would then have accelerated to a speed of "100," whatever that means.  

-------------------------------------------------------------------------------------

They say human reaction time can be as fast as 200-250 ms.  
60 fps
200 ms = .2*60=12 frames
250 ms = .25*60=15 frames
That is, the fastest reaction times that are humanly possible are in this range.  

------------------------------------------------------------------------------------

When a new section of road is shown on the screen, set a timer to 100 (max speed of car) + 15 (min. time for human reflexes) = 115 frames.  Then, subtract the current speed of car.  That will be the amount of time in frames that the player will have to turn the steering wheel to the correct position.  

Ex.  A new section of road is displayed.  The timer is set to 115.  Suppose the speed of car currently is 50.  Then 50 is subtracted from the timer, leaving the timer with 115-50=65 frames.  At 60 fps, this is about 1.08 seconds.  

-----------------------------------------------------------------------------------

The player will have this much time to do whatever he or she wants while the timer is counting down.  The player can turn the paddle and press and release the paddle button however he or she likes.  When the timer reaches zero, the program will check to see if the steering wheel is turned correctly to match the section of road being displayed on the screen.  

YES
- The player scores a point.  Increment the odometer by one.  
- Perhaps play a sound such as a bell ringing sound.
- Display a new section of road.
- Again, set the timer to 115 and subtract the new current value of speed of car.
- Again, allow the player to do as he or she pleases while this timer counts down.
- Again, when this timer gets to zero, check to see if the steering wheel is turned to correctly match the section of road being displayed.  
- Repeat

NO
- The player's car crashes.
- Map the bits of the P1 sprite to all 1's, making an 8x16 rectangle.  Center it in the middle of the arcade cabinet "screen."  
- It will appear to be all white.  Flash it on and off a few times.
- Play a crashing sound.
- Set the speed of car to zero.
- Note: All during this time, the game clock keeps counting down.  That's the real punishment for crashing in this game - nothing bad happens to your car.  You just lose time.

- Return the "screen" of the arcade cabinet to normal.  Display again the same section of road.  Set the timer to 115-0 (the car has come to a complete stop)=115 (approx. 1.92 seconds) and resume play.  
- Now, the player must accelerate the car from zero back up to a competitive speed to try to "get back in the game."

 

  • Like 1
Link to comment
Share on other sites

ATTRACT MODE DEMO

 

Spoiler

image.jpeg.731c70b83b29a95cc6c4b915668369e3.jpeg

Phosphor effect was not used to capture this screenshot.  

  • For this minigame, turn phosphor off.  There is no flicker.  
  • Use the paddle controller.  
  • Press the paddle button to exit Attract Mode and enter Game Mode.  

 

Demo Features:

  • The game starts in Attract Mode.  The background colors cycle around to prevent your tube TV from burning in the image of the arcade cabinet permanently onto the screen.  During the Attract Mode, you can't play, but you can turn the wheel and press down on the accelerator pedal.  
  • Press the paddle button to exit Attract Mode and enter the Game Mode.  In Game Mode, the background is black and the game timer counts down from 100 to 0.  You can't play yet, but you can turn the wheel and press down on the accelerator pedal.  
  • When the game timer reaches 0, the game will automatically exit Game Mode and re-enter Attract Mode.  The cycle then repeats.  

 

I'm not sure that I want these kinds of rotating colors to be in the final version of this mini game.  Right now, I just explore it as a possibility.  

 

minigame_0.04_attract.bas.bin

  • Like 1
Link to comment
Share on other sites

RE-ORGANIZING THE CODE

 

Spoiler

The above Attract Mode demo works, but the code is a mess.  I have a plan to re-organize the code to make it easier for me to keep it free from errors.  

 

Details

Spoiler

Beware: this forum software may eat the space characters on the left margin.  

 

There will be two Main Loops.  One for Attract Mode and another for Game Mode.  The condition for exiting Attract Mode will be to press (and release) the Game Reset switch on your Atari 2600 console.  The condition for exiting Game Mode and re-entering Attract Mode will be when the game timer runs down to zero.  The sprite bit-map definitions can be located in a separate Subroutines section.  Code in the Attract Mode and Game Mode main loops could both access those sprite bit maps by using Gosub and Return statements.  

 

Batari Basic psuedo-code follows: 

Spoiler

 

__Attract_Mode_Intro

 

 rem set and clear variables used in Attract Mode

 

 

__Attract_Mode_Main_Loop

 

 if switchreset then goto __Game_Mode_Intro

 

 if paddle <25 then gosub __Steering_Wheel_Left

 

 goto __Attract_Mode_Main_Loop

 

 

__Game_Mode_Intro

 

 rem set and clear variables used in Game Mode

 

 

__Game_Mode_Main_Loop

 

 if _game_timer=0 then goto __Attract_Mode_Intro

 

 if paddle <25 then gosub __Steering_Wheel_Left

 

 goto  __Game_Mode_Main_Loop

 

 

 rem ******************  Subroutines ****************** 

 

__Steering_Wheel_Left

 

   player0: 
        %00011000
        %00100100
        %01000010
        %10100001
        %10011001
        %10011001
        %10011001
        %10000101
        %01000010
        %00100100
        %00011000
        %00000000
end

 

 return

 

__Steering_Wheel_Center

 

 return

 

__Steering_Wheel_Right

 

return

 

__Road_Left_Turn_Section

 

 player1:
        %01000000
        %00000000
        %01000000
        %00000000
        %10000000
        %00000000
        %00000000
        %00000000
        %00000001
        %00000000
        %00000010
        %00000000
        %00001000
        %00000000
        %00100000
        %10000000
end

 

return

 

__Road_Straight_Section

 

return

 

__Road_Right_Turn_Section

 

return


By organizing the code in this way, I hope to make it easier for me to follow the logic of the program and let me be less likely to make errors when programming it.  

 

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

PICO-8 TINY TV AND PICO ARCADE

 

Spoiler

This mini game is inspired by the TINY TV games for PICO-8...  

 

TINY BREAKOUT

Spoiler

image.jpeg.4ef3c7a8a0656449c3ca9324ce695113.jpeg Tiny Breakout

Play Tiny Breakout in your browser here.

 

See more TINY TV JAM games for PICO-8 here.  

 

...and by the PICO ARCADE.  

Spoiler

pico_arcade.p8_0.gif

 

Play PICO ARCADE in your browser here.

 

See more #ARCADE games for PICO-8 here.  

 

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