Jump to content
IGNORED

Possible to change playfield color based on P0 position?


Recommended Posts

Imagine Pac-Man, but the maze is invisible when a level starts. Unlike games that feature a "flashlight" that only lights up a small area around the player, I'm trying to permanently reveal the maze as the player moves through it. Can this be done without collisions? I have an idea to start each level with the PF color set to black so it matches the background, and then use a routine that will permanently change the PF color to a visible option within x number of scanlines and PF pixels of the player's position. First of all, I don't know if this is possible. Second, I'm not sure how I'd go about writing such code. Any tips would be much appreciated!

Link to comment
Share on other sites

Could not be done by playfield color.   Could oossibly be done by drawing / notdrawing playfield in selected areas.  Maze would necessarily be based purely on coordinates.  This would require extra RAM and bankswitching at least, and possibly DPC+ or some ARM scheme.

 

I think its possible but extremenly difficult, probably best for a very experienced 2600 programmer.  

Link to comment
Share on other sites

19 hours ago, glurk said:

Could not be done by playfield color.   Could oossibly be done by drawing / notdrawing playfield in selected areas.  Maze would necessarily be based purely on coordinates.  This would require extra RAM and bankswitching at least, and possibly DPC+ or some ARM scheme.

 

I think its possible but extremenly difficult, probably best for a very experienced 2600 programmer.  

I may have found a possible workaround using the approach taken by the creator of this game. However, it's written in bB and I don't know what's happening in the code. I'm wondering if I could start each level with the entire maze area being one solid color, and then as the player moves, the walkable space is "painted" black, revealing the open pathways. Similar to the way the player in the game I linked to paints the screen green. Does this seem more doable?

Link to comment
Share on other sites

It is possible to change the color of the playfield mid-scanline. You can see that in Congo Bongo, the section circled in cyan draws the playfield in 3 different colors :

 

CongoBongo(1983)(SEGA)_dbg_f6be382e.thumb.png.83b1dbacad0c2a7b84861da4d3338743.png

In Stella's Debug Color Mode the playfield is drawn in purple.

CongoBongo(1983)(SEGA)_dbg_f6be65c1.thumb.png.18b924189a9b9440c7b0d2546176530e.png

 

it is, however, a rather advanced technique and subject to timing limitations, so I wouldn't recommend it.

 

What you could do is use RAM to store how the playfield is drawn. By modifying the values in RAM as the player moves around you'd be able to reveal the maze. This would be similar to how Surround uses the playfield to draw the trails left behind each player:

 

Surround(1977)(Atari)_dbg_f6c814ec.thumb.png.49b166cc2db166d443ad5134ba637892.png

Surround(1977)(Atari)_dbg_f6c835ee.thumb.png.e152dbb6ac7f1ab3f79c6fa249862c23.png

Link to comment
Share on other sites

6 hours ago, SpiceWare said:

 

 

What you could do is use RAM to store how the playfield is drawn. By modifying the values in RAM as the player moves around you'd be able to reveal the maze. This would be similar to how Surround uses the playfield to draw the trails left behind each player:

 

 

 

I reached out to Oscar Toledo on X last night to get his input and he actually suggested something very similar. Great minds think alike eh?!

 

Unfortunately, I haven't been able to find any noob-friendly tutorials on this topic, but my understanding is that a template of blank playfield tiles would need to be created in RAM. Then, in ROM you would store the "drawn" playfield tiles that would replace the blanks upon the player entering a blank area. However, I'm struggling to wrap my brain around how the player triggers that transfer of data from ROM to RAM.

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