Jump to content
IGNORED

Polarium


atari2600land

Recommended Posts

So I took another stab at making a Polarium-type game for the Atari 2600. I think I have succeeded this time. The trouble was trying to disable a movement to a square that has already been turned (as in the DS game Polarium.) While it doesn't give you a track of where you went so far, the squares do flip on and off and if you get stuck, you can just press the reset switch. What I plan to do but isn't implemented yet is to press fire when you're all done and then the game will check and see whether the rows are all on or all off and then give you a result. I want an 8k game, so I'd store the game logic in bank 0 and the different puzzles in bank 1. What we have here is a test puzzle, where all the squares are on. Move around in it using the joystick.

 

polarium1.bas.bin

polarium1.bas

Link to comment
Share on other sites

OK gang, I made it so you can move the cursor anywhere you want. Pressing fire starts the line and pressing fire once the line has begun finishes the line. The game then checks if you finished it. If you did, (for now), the background turns green. Otherwise, the puzzle begins again. There is a simple sample puzzle.

 

polarium3.bas.bin

polarium3.bas

Edited by atari2600land
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Added a second puzzle. I think there will be room for at least 20 puzzles, perhaps more. I added a second puzzle. To get to it, use the select switch to toggle between the two puzzles. I don't know if I should keep it this way or have the second puzzle only appear the first one is solved.

1line2016dec02v2.zip

Edited by atari2600land
Link to comment
Share on other sites

The point of each puzzle is to travel through it so each horizontal line is turned on or off. The line you make determines whether you turned a square on (white) or off (black). The outer border doesn't matter. To start a line (flipping each square as you go in it), press the Fire button. Note that you cannot backtrack (go through a square you've already gone through.) To end the line, press the fire button again. If all the horizontal lines in the board are the same color, then the puzzle is cleared. Note that one horizontal line can be all black and the next one can be all white. It doesn't matter, just as long as each square in each horizontal line is the same color. If not, then the board starts anew and you get infinite tries on each board.

  • Like 1
Link to comment
Share on other sites

  • 3 years later...

Cleaned up the code even more. I put new level drawing code in. With it, I can make 63 levels, but I doubt I will think up of that many. So here's what I'm thinking:

bank 1 - main game

banks 2 & 3 - level storage and level drawing code

bank 4 - level editor.

 

And just in case you're wondering, yes, I need to have the levels no bigger than 8x8, since I only have so many variables to keep track of where you've been drawing the 1 line. Well, I suppose I could go 9x8, but I'd have to rewrite the main game code a little. So we'll see if I need to go 9 x 8, but it's 8 x 8 for now. Feel free to send in your own puzzles you design and I'll put them in and see if I can solve them.

 

1line9.zip

  • Like 1
Link to comment
Share on other sites

We'll be checking out Polarium on tomorrow's (Sun May 24) ZeroPage Homebrew stream LIVE on Twitch at 11AM PT | 2PM ET | 6PM GMT! Hope everyone can watch!


Games:

 

(SET VIDEO TO 1080P60 FOR FULL QUALITY)

 

Edited by ZeroPage Homebrew
Link to comment
Share on other sites

Just so you know, the name of the game is now 1-Line. I made some more changes and added what (I hope) is a really nasty puzzle #5. I had an impossible one up that I spent a few hours trying to solve before deeming it impossible, but I made it possible with a couple of changes to it. I also added some sound effect changes. The way it looks now will probably be it, due to the fact that it looks off any other way I do it due to bB's score code and PF0.

 

1line13.zip

  • Like 1
Link to comment
Share on other sites

1 hour ago, atari2600land said:

Just so you know, the name of the game is now 1-Line. I made some more changes and added what (I hope) is a really nasty puzzle #5. I had an impossible one up that I spent a few hours trying to solve before deeming it impossible, but I made it possible with a couple of changes to it. I also added some sound effect changes. The way it looks now will probably be it, due to the fact that it looks off any other way I do it due to bB's score code and PF0.

 

Excellent! Thanks for the updated info and binary, looking forward to playing 1-Line on tomorrow's show. It'll be great to have the extra puzzle added to the game to solve.

 

- James

 

Edited by ZeroPage Homebrew
Link to comment
Share on other sites

On 5/22/2020 at 6:30 AM, atari2600land said:

And just in case you're wondering, yes, I need to have the levels no bigger than 8x8, since I only have so many variables to keep track of where you've been drawing the 1 line. Well, I suppose I could go 9x8, but I'd have to rewrite the main game code a little. So we'll see if I need to go 9 x 8, but it's 8 x 8 for now. Feel free to send in your own puzzles you design and I'll put them in and see if I can solve them.


hmm

 

you need a byte for game state
you use 2 bytes for the audio
you need 2 bytes for cursor position
you need a byte for the level (depending on how many levels, could be part of game state?)
(did I miss anything?)

 

that would leave you 20 bytes (and there might be a few others around, stack space or something)

 

assuming you keep 11 rows with a free row and column
for 16 X 9 pixels you'd need 18 bytes for pixel visited flags

 

it looks like the cursor moves in pf pixels
I think I'd keep the movement/position in pf pixels
and translate to sprite coordinates just for display

 

if the puzzle matrix was 16 x 9 and you have free space bordering
you need 18 x 11 for position or 5 and 4 bits so you'd have 3 and 4 bits
you could use for eg game state

 

you could put the puzzle matrix in the middle of the screen so you'd be
dealing with whole bytes

Link to comment
Share on other sites

11 minutes ago, atari2600land said:

How many variables do I get? I'm using a-z, and some missile's and ball's variables since I ran out of lettered ones.

well there's the aux1..aux6 variables which are part of the stack

you can probably use (some of) them if you don't go to deep on the stack

(I think the score uses some of the aux variables)

there's var44..var47  don't know but they may be available

if you're only using one sprite there maybe some associated space there you could use

 

my point was, doesn't seem like you would need that much

Link to comment
Share on other sites

@atari2600land Assuming you stick with 8x8, would you be interested in a minikernel that would give a kind of a tac map at the bottom showing what squares have been visited or not? It wouldn't be as nice as overlaying it over the play area, but there's no way to do the latter in bB without major hacking of the kernel.

Link to comment
Share on other sites

28 minutes ago, Karl G said:

@atari2600land Assuming you stick with 8x8, would you be interested in a minikernel that would give a kind of a tac map at the bottom showing what squares have been visited or not? It wouldn't be as nice as overlaying it over the play area, but there's no way to do the latter in bB without major hacking of the kernel.

not sure what you mean by overlay

you could just swap the pixel visited flags with the play field

 

and/or flicker them

 

Edited by bogax
Link to comment
Share on other sites

I got it to display a 12x8 picture, but the pictures aren't together like I want them to be. Why and how do I fix it so they are?


 asm
  ldx level        ;  ballx
  ldy x11,x        ;  level x 11 look up
  ldx #$A
  lda #>col0_dat
  sta temp4
  lda #<col0_dat
  sta temp3

loop_col0
  lda (temp3),y
  sta var0,x
  iny
  inx
  inx
  cpx #$20
  bne loop_col0
end

   return otherbank

 data x11
  0, 14, 28, 42, 56, 70
end

 data col0_dat
  %01111110, %00000000
  %01000010, %00000000
  %01110110, %00000000
  %01101110, %00000000
  %01000010, %00000000
  %01111110, %00000000
  %00000000, %00000000

  %00100100, %00000000
  %01100110, %00000000
  %00111100, %00000000
  %00100100, %00000000
  %00011000, %00000000
  %01100110, %00000000
  %00000000, %00000000

  %00111100, %00000000
  %01011010, %00000000
  %01111110, %00000000
  %01011010, %00000000
  %01100110, %00000000
  %00111100, %00000000
  %00000000, %00000000

  %01000010, %00000000
  %01111110, %00000000
  %01001010, %00000000
  %01111110, %00000000
  %01010010, %00000000
  %01111110, %00000000
  %00000000, %00000000

  %01000010, %00000000
  %00110010, %00000000
  %01011010, %00000000
  %01011010, %00000000
  %01001100, %00000000
  %01000010, %00000000
  %00000000, %00000000

  %01111111, %00000111
  %01111111, %00000111
  %01111111, %00000111
  %01111111, %00000111
  %01111111, %00000111
  %01111111, %00000111
  %00000000, %00000000
end

Link to comment
Share on other sites

I think this is what you want

 

you need to increment by 1 and write another byte

then increment by 3

 

I put some junk on the right of the first one

to show where it's going

 


 asm
  ldx level        ;  ballx
  ldy x11,x        ;  level x 11 look up
  ldx #$0A
  lda #>col0_dat
  sta temp4
  lda #<col0_dat
  sta temp3

loop_col0
  lda (temp3),y
  sta var0,x
  iny
  inx
  lda (temp3),y
  sta var0,x
  iny
  inx
  inx
  inx
  cpx #$26
  bne loop_col0
end

   return otherbank

 data x11
  0, 14, 28, 42, 56, 70
end

 data col0_dat
  %01111110, %00000000
  %01000010, %00000000
  %01110110, %11100001
  %01101110, %10000001
  %01000010, %10000001
  %01111110, %11100001
  %00000000, %00000000

  %00100100, %00000000
  %01100110, %00000000
  %00111100, %00000000
  %00100100, %00000000
  %00011000, %00000000
  %01100110, %00000000
  %00000000, %00000000

  %00111100, %00000000
  %01011010, %00000000
  %01111110, %00000000
  %01011010, %00000000
  %01100110, %00000000
  %00111100, %00000000
  %00000000, %00000000

  %01000010, %00000000
  %01111110, %00000000
  %01001010, %00000000
  %01111110, %00000000
  %01010010, %00000000
  %01111110, %00000000
  %00000000, %00000000

  %01000010, %00000000
  %00110010, %00000000
  %01011010, %00000000
  %01011010, %00000000
  %01001100, %00000000
  %01000010, %00000000
  %00000000, %00000000

  %01111111, %00000111
  %01111111, %00000111
  %01111111, %00000111
  %01111111, %00000111
  %01111111, %00000111
  %01111111, %00000111
  %00000000, %00000000
end


Edited by bogax
Link to comment
Share on other sites


  this is untested

 

  assuming a set of flags in ram consisting of 18 consecutive bytes
  (for a 16 x 9 matrix) here starting with h

  also assumes the puzzle is in the middle two byte columns

  ie the flags are for pfpixels 8..23 x 1..9 with pfpixel 7, 0 being puzzle 0, 0  

 

  visited(col, row) will return true (non zero) for a set pixel flag
  (kinda like pfread)

 

  and setvf(col, row) should set a flag

 

  the parameters are column x row in pfpixels
  and assume that the upper right corner of the puzzle matrix is at 1, 1

  (at least that's what they're meant to do, like I said, untested)

 

  dim     vfx = temp1
  dim     vfy = temp2
  dim   vfptr = temp3

  const vbase = h                ; z - 18
  const midsb = setbyte + 8


  function visited()
    vfx = vfx - 1
  vfptr = (vfy - 1) * 2
  vfptr = vfx / 8 | vfptr
  vfptr = midsb[vfx] & vbase[vfptr]  
  return

 
   function setvf()
    vfx = vfx - 1
  vfptr = (vfy - 1) * 2
  vfptr = vfx / 8 | vfptr
  vbase[vfptr] = midsb[vfx] | vbase[vfptr]  
  return

Edited by bogax
goofed the code, additional info
Link to comment
Share on other sites

2 hours ago, bogax said:

not sure what you mean by overlay

you could just swap the pixel visited flags with the play field

 

and/or flicker them

 

By overlay, I was talking about an idea mentioned by @Andrew Davie to use a quad-width sprite on top of the lay area to show what squares were visited, since the sprite pixels are the same width as playfield pixels. This isn't really feasible in bB - not only would you need to have the sprite in RAM, but you would also need to have the individual lines be as tall as the playfield pixels.

 

Flickering the playfield to accomplish the same would work, but I think it might not end up looking great.

Link to comment
Share on other sites

OK, I got a playfield of 10x8 working (12x6 including the borders), but there seems to be some sort of problem with the playfield displaying correctly on the last pfrow.

 

1line14_bas.png.5a0ee115d9bef50e937fcb3cdad8acd0.png

How do I get rid of those 5 extra pfblocks that have turned themselves on? I tried turning them off with "pfhline 0 11 31 off" but it broke the 10x8 grid code for no apparent reason.


 asm
  ldx level        ;  ballx
  ldy x11,x        ;  level x 11 look up
  ldx #$06
  lda #>col0_dat
  sta temp4
  lda #<col0_dat
  sta temp3

loop_col0
  lda (temp3),y
  sta var0,x
  iny
  inx
  lda (temp3),y
  sta var0,x
  iny
  inx
  inx
  inx
  cpx #$26
  bne loop_col0
end

   return otherbank

 data x11
  0, 16, 32, 48, 64, 80
end

 data col0_dat
  %00000001, %00000000
  %00000001, %01111110
  %00000001, %01000010
  %00000001, %01110110
  %00000001, %01101110
  %00000001, %01000010
  %00000001, %01111110
  %00000001, %00000000

  %00000001, %00000000
  %00000001, %00100100
  %00000001, %01100110
  %00000001, %00111100
  %00000001, %00100100
  %00000001, %00011000
  %00000001, %01100110
  %00000001, %00000000

  %00000001, %00000000
  %00000001, %00111100
  %00000001, %01011010
  %00000001, %01111110
  %00000001, %01011010
  %00000001, %01100110
  %00000001, %00111100
  %00000001, %00000000

  %00000001, %00000000
  %00000001, %01000010
  %00000001, %01111110
  %00000001, %01001010
  %00000001, %01111110
  %00000001, %01010010
  %00000001, %01111110
  %00000001, %00000000

  %00000001, %00000000
  %00000001, %01000010
  %00000001, %00110010
  %00000001, %01011010
  %00000001, %01011010
  %00000001, %01001100
  %00000001, %01000010
  %00000001, %00000000

  %00010000, %00000000
  %00010111, %01111111
  %00010111, %01111111
  %00010111, %01111111
  %00010111, %01111111
  %00010111, %01111111
  %00010111, %01111111
  %00010000, %00000000
end

as for functions, I don't want to put too much code I don't understand in the game.

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