Jump to content
IGNORED

Need help - new to basic


AeRo

Recommended Posts

Basically I'm creating a game (duh! wouldn't be in here no would I?), I created a logo screen by looking at other people's coding. Basically you see the logo screen of my game then you can push space to continue to the game. I have that part down so far and it compiles.

 

The problem is, I need some help with my game. I just need help getting started, then I can complete it. I need to make a player that is controllable by the arrow keys, and the player is constantly moving. Basically it's gonna be like a snake from the game nibbles, but not really. All I need is some example code of how to get it started (since there aren't any tutorials out there) of a moving character (non-stop moving) that is controlled by the keys and the game ends when he hits a wall or himself.

 

Any suggestions? Starting points? Here's my code of the logo screen so far:

 

COLUBK = 112

COLUPF = 68

COLUP0 = 196

programstart
gosub clear

x = 0
y = 0
end

startme
gosub clear
COLUPF = 68
gosub logo
COLUP0 = 0
COLUP1 = 0 : scorecolor = 0
500
g = g + 1
COLUBK = g : COLUP0 = g : COLUP1 = g : COLUPF = 196
drawscreen
if joy0fire then goto programstart
goto500

logo
pfpixel 1 2 on : pfpixel 2 2 on : pfpixel 3 2 on : pfpixel 4 2 on 
pfpixel 5 2 on : pfpixel 7 2 on : pfpixel 11 2 on : pfpixel 13 2 on 
pfpixel 14 2 on : pfpixel 15 2 on : pfpixel 16 2 on : pfpixel 17 2 on 
pfpixel 19 2 on : pfpixel 20 2 on : pfpixel 21 2 on : pfpixel 22 2 on 
pfpixel 23 2 on : pfpixel 25 2 on : pfpixel 26 2 on : pfpixel 27 2 on 
pfpixel 28 2 on : pfpixel 29 2 on : pfpixel 1 3 on : pfpixel 5 3 on 
pfpixel 7 3 on : pfpixel 8 3 on : pfpixel 11 3 on : pfpixel 13 3 on 
pfpixel 17 3 on : pfpixel 23 3 on : pfpixel 25 3 on : pfpixel 29 3 on 
pfpixel 1 4 on : pfpixel 7 4 on : pfpixel 9 4 on : pfpixel 11 4 on 
pfpixel 13 4 on : pfpixel 17 4 on : pfpixel 22 4 on : pfpixel 25 4 on 
pfpixel 1 5 on : pfpixel 2 5 on : pfpixel 3 5 on : pfpixel 4 5 on 
pfpixel 5 5 on : pfpixel 7 5 on : pfpixel 9 5 on : pfpixel 11 5 on 
pfpixel 13 5 on : pfpixel 14 5 on : pfpixel 15 5 on : pfpixel 16 5 on 
pfpixel 17 5 on : pfpixel 21 5 on : pfpixel 25 5 on : pfpixel 26 5 on 
pfpixel 27 5 on : pfpixel 5 6 on : pfpixel 7 6 on : pfpixel 9 6 on 
pfpixel 11 6 on : pfpixel 13 6 on : pfpixel 17 6 on : pfpixel 20 6 on 
pfpixel 25 6 on : pfpixel 1 7 on : pfpixel 5 7 on : pfpixel 7 7 on 
pfpixel 10 7 on : pfpixel 11 7 on : pfpixel 13 7 on : pfpixel 17 7 on 
pfpixel 19 7 on : pfpixel 25 7 on : pfpixel 29 7 on : pfpixel 1 8 on 
pfpixel 2 8 on : pfpixel 3 8 on : pfpixel 4 8 on : pfpixel 5 8 on 
pfpixel 7 8 on : pfpixel 11 8 on : pfpixel 13 8 on : pfpixel 17 8 on 
pfpixel 19 8 on : pfpixel 20 8 on : pfpixel 21 8 on : pfpixel 22 8 on 
pfpixel 23 8 on : pfpixel 25 8 on : pfpixel 26 8 on : pfpixel 27 8 on 
pfpixel 28 8 on : pfpixel 29 8 on
return

clear

r29 asm
ldx #47
lda #0
clearpf
sta playfield, x
dex
bpl clearpf
end
return

Link to comment
Share on other sites

If you want an example in batari Basic of a guy you move around that doesn't stop until he hits a wall, check out my work in progress called RUINS:

 

http://www.atariage.com/forums/index.php?showtopic=77015

 

I'm not the world's greatest programmer, but you should be able to learn something from it.

Link to comment
Share on other sites

Basically I'm creating a game (duh! wouldn't be in here no would I?), I created a logo screen by looking at other people's coding.  Basically you see the logo screen of my game then you can push space to continue to the game.  I have that part down so far and it compiles.

 

The problem is, I need some help with my game.  I just need help getting started, then I can complete it.  I need to make a player that is controllable by the arrow keys, and the player is constantly moving.  Basically it's gonna be like a snake from the game nibbles, but not really.  All I need is some example code of how to get it started (since there aren't any tutorials out there) of a moving character (non-stop moving) that is controlled by the keys and the game ends when he hits a wall or himself.

 

Any suggestions?  Starting points?  Here's my code of the logo screen so far:

 

COLUBK = 112

COLUPF = 68

COLUP0 = 196

programstart
gosub clear

x = 0
y = 0
end

startme
gosub clear
COLUPF = 68
gosub logo
COLUP0 = 0
COLUP1 = 0 : scorecolor = 0
500
g = g + 1
COLUBK = g : COLUP0 = g : COLUP1 = g : COLUPF = 196
drawscreen
if joy0fire then goto programstart
goto500

logo
pfpixel 1 2 on : pfpixel 2 2 on : pfpixel 3 2 on : pfpixel 4 2 on 
pfpixel 5 2 on : pfpixel 7 2 on : pfpixel 11 2 on : pfpixel 13 2 on 
pfpixel 14 2 on : pfpixel 15 2 on : pfpixel 16 2 on : pfpixel 17 2 on 
pfpixel 19 2 on : pfpixel 20 2 on : pfpixel 21 2 on : pfpixel 22 2 on 
pfpixel 23 2 on : pfpixel 25 2 on : pfpixel 26 2 on : pfpixel 27 2 on 
pfpixel 28 2 on : pfpixel 29 2 on : pfpixel 1 3 on : pfpixel 5 3 on 
pfpixel 7 3 on : pfpixel 8 3 on : pfpixel 11 3 on : pfpixel 13 3 on 
pfpixel 17 3 on : pfpixel 23 3 on : pfpixel 25 3 on : pfpixel 29 3 on 
pfpixel 1 4 on : pfpixel 7 4 on : pfpixel 9 4 on : pfpixel 11 4 on 
pfpixel 13 4 on : pfpixel 17 4 on : pfpixel 22 4 on : pfpixel 25 4 on 
pfpixel 1 5 on : pfpixel 2 5 on : pfpixel 3 5 on : pfpixel 4 5 on 
pfpixel 5 5 on : pfpixel 7 5 on : pfpixel 9 5 on : pfpixel 11 5 on 
pfpixel 13 5 on : pfpixel 14 5 on : pfpixel 15 5 on : pfpixel 16 5 on 
pfpixel 17 5 on : pfpixel 21 5 on : pfpixel 25 5 on : pfpixel 26 5 on 
pfpixel 27 5 on : pfpixel 5 6 on : pfpixel 7 6 on : pfpixel 9 6 on 
pfpixel 11 6 on : pfpixel 13 6 on : pfpixel 17 6 on : pfpixel 20 6 on 
pfpixel 25 6 on : pfpixel 1 7 on : pfpixel 5 7 on : pfpixel 7 7 on 
pfpixel 10 7 on : pfpixel 11 7 on : pfpixel 13 7 on : pfpixel 17 7 on 
pfpixel 19 7 on : pfpixel 25 7 on : pfpixel 29 7 on : pfpixel 1 8 on 
pfpixel 2 8 on : pfpixel 3 8 on : pfpixel 4 8 on : pfpixel 5 8 on 
pfpixel 7 8 on : pfpixel 11 8 on : pfpixel 13 8 on : pfpixel 17 8 on 
pfpixel 19 8 on : pfpixel 20 8 on : pfpixel 21 8 on : pfpixel 22 8 on 
pfpixel 23 8 on : pfpixel 25 8 on : pfpixel 26 8 on : pfpixel 27 8 on 
pfpixel 28 8 on : pfpixel 29 8 on
return

clear

r29 asm
ldx #47
lda #0
clearpf
sta playfield, x
dex
bpl clearpf
end
return

973889[/snapback]

 

First of all, I like your logo or title screen! However, judging by all the pfpixel commands, it looks like you used the playfield drawing tool to draw your logo and then generate the necessary pfpixel statements. You should be aware that the pf drawing routines take up a lot of machine cycles, and using a lot of pfpixel statements to draw a screen also takes up a lot of ROM. It's almost always much quicker to "poke" the desired playfield data directly into the playfield array, and it can also save a lot of ROM in some cases. Here's another version of your code, which I've modified by removing the pfpixel commands and replacing them with the necessary data and routines to draw the playfield directly. I also replaced your in-line assembly routine to clear the playfield with the equivalent bB code, to show you how you can do that in bB.

 

  include div_mul.asm

  COLUBK = $70
  COLUPF = $44
  COLUP0 = $C4

programstart
  gosub clear
  x = 0
  y = 0
end

startme
  gosub clear
  COLUPF = $44
  gosub logo
  COLUP0 = $00
  COLUP1 = $00 : scorecolor = $00

500
  g = g + 1
  COLUBK = g : COLUP0 = g : COLUP1 = g : COLUPF = $C4
  drawscreen
  if joy0fire then goto programstart
  goto 500

logo
  data logo_data
  %00000000,%00000000,%00000000,%00000000
  %00000000,%00000000,%00000000,%00000000
  %01111101,%00010111,%11011111,%01111100
  %01000101,%10010100,%01000001,%01000100
  %01000001,%01010100,%01000010,%01000000
  %01111101,%01010111,%11000100,%01110000
  %00000101,%01010100,%01001000,%01000000
  %01000101,%00110100,%01010000,%01000100
  %01111101,%00010100,%01011111,%01111100
  %00000000,%00000000,%00000000,%00000000
  %00000000,%00000000,%00000000,%00000000
end
  for r = 0 to 10
     for c = 0 to 3
        b = 4 * r
        b = b + c
        temp1 = logo_data[b]
        if c = 1 then gosub flip_it
        if c = 3 then gosub flip_it
        playfield[b] = temp1
     next
  next
  return

clear
  for b = 0 to 47
     playfield[b] = 0
  next
  return

flip_it
  temp2 = 0
  if temp1{0} then temp2{7} = 1
  if temp1{1} then temp2{6} = 1
  if temp1{2} then temp2{5} = 1
  if temp1{3} then temp2{4} = 1
  if temp1{4} then temp2{3} = 1
  if temp1{5} then temp2{2} = 1
  if temp1{6} then temp2{1} = 1
  if temp1{7} then temp2{0} = 1
  temp1 = temp2
  return

 

When your original code is compiled, there are 2002 bytes of ROM free (but you're probably getting a little more than that, because I've added some code to read joystick 1 to one of bB's include files, hence I get less ROM free than you do.) On the other hand, when the modified code is compiled, there are 2587 bytes of ROM free, so using the data statement to define the playfield pixels, and "poking" the data directly into the playfield array using two nested for..next loops, saves 585 bytes of ROM. And I think it's easier to draw the playfield using data statements, because you can more easily see what's being drawn (i.e., by imagining the 0s as blanks and the 1s as playfield pixels that are "on"). However, if you do this, you must flip the second and fourth playfield bytes, since the 2600 reads those bytes "backwards" as it's drawing the playfield, hence I'm calling flip_it to reverse the second and fourth bytes. (The alternative is to store those bytes backwards in the data statements, but that's more difficult to do, so I prefer to store the data in the way that looks natural to the reader's eye, and then use the flip_it routine to reverse the necessary bytes.)

 

As for moving the "snaze" around the screen, you first need to decide what you're going to draw it with-- playfield pixels or player/missile graphics. Assuming that the snaze can be very long, you'll probably want to draw it with playfield pixels, but that's up to you. If you draw the snaze with playfield pixels, then you can use the players and missiles for walls, or for other objects (e.g., "food" that the snaze eats, which makes it grow longer).

 

Either way, you'll want to define one or two variables to indicate and control the directions the snaze is moving in. For example, you could have one variable that can have four or eight different values, corresponding to N, S, E, and W movement (and maybe NE, SE, SW, and NW movement as well, if you want to allow the snaze to move diagonally). You would keep the movement value the same, so the snaze keeps moving in the same direction, and then change the movement value when the joystick or cursor keys are pressed. If you want to use two variables instead of one for the movement, then one variable could control the left/right direction value, and the other variable could control the up/down direction value.

 

Here is a simple example that moves a playfield pixel around:

 

  dim snaze_row = a
  dim snaze_col = b
  dim snaze_n_s = c
  dim snaze_e_w = d
  dim frame = e

  snaze_row = 5
  snaze_col = 16
  snaze_n_s = 0
  snaze_e_w = 255

  COLUBK = $04
  COLUPF = $1A

loop

  rem * plot the snaze's position (1 playfield pixel)
  pfpixel snaze_col snaze_row on

  rem * draw the screen
  frame = 0

wait

  drawscreen

  rem * update the snaze's direction from the joystick
  if joy0left then snaze_e_w = 255 : snaze_n_s = 0
  if joy0right then snaze_e_w = 1 : snaze_n_s = 0
  if joy0up then snaze_n_s = 255 : snaze_e_w = 0
  if joy0down then snaze_n_s = 1 : snaze_e_w = 0

  rem * wait a bit to slow things down
  frame = frame + 1
  if frame < 10 then goto wait

  rem * erase the snaze's last position
  pfpixel snaze_col snaze_row off

  rem * update the snaze's new position
  snaze_col = snaze_col + snaze_e_w
  snaze_row = snaze_row + snaze_n_s

  rem * if it moved "offscreen," then wrap around
  if snaze_col = 255 then snaze_col = 31
  if snaze_col = 32 then snaze_col = 0
  if snaze_row = 255 then snaze_row = 10
  if snaze_row = 11 then snaze_row = 0

  rem * keep repeating
  goto loop

 

This example assumes that there will be no diagonal movement, so moving up or down will set the left/right (e/w) movement value to 0, and moving left or right will set the up/down (n/s) movement value to 0. A movement value of 1 will add to the row or column position, moving the snaze down or right. A movement value of 255 will subtract 1 from the row or column position (because 255 is the same as -1), moving the snaze up or left.

 

Of course, this example just moves one playfield pixel around. If the snaze is more than one pixel long, things will be more tricky, because you'll need to leave a "trail" as the snaze moves around, and erase the last pixel, hence you'll need to have variables for remembering the position of the last pixel of the snaze.

 

Also, this example allows the playfield pixel to wraparound from one side of the screen to the other, but presumably you won't want to allow that in your game. Still, I hope this example helps you to see how an object such as a playfield pixel can be moved continuously in a given direction, with the joystick (or cursor keys in an emulator program) being used to steer the object around.

 

Michael Rideout

Link to comment
Share on other sites

Wow - thanks for the help. Haha, it's funny because after this post I sat down for hours and learned this language as best I could. I made code for moving the snake and had collision testing that works for a gameover sequence.

 

Thanks so much SeaGT for the help - now I have to go back through the code and clean it haha because I left in the pfpixel (well I coded all this before coming back to my thread).

 

But as you mentioned - I think the rom will be an issue with this game. Can I have unlimited included files and what format do they need to be in? Basically I need a way to make all my levels of mazes without running out of rom space. So can I have a bunch of included files which created my different levels of mazes? Is there an easier way to do this?

 

And I think working on my trailing snake will be the last thing I do/implement as it will probably give me some trouble. I'll post my code when I go through and update it with all your helps.

 

 

EDIT: I don't want the snake to grow - but I do want it to have a trailing tail like the original nibbles game. I just want it a fixed length. I don't want it to eat apples and grow, it's not the point of this game. I'm gonna make mazes that you have to get through with your snake, maybe even a key that when it collides with the key it opens the door to the next level.

Edited by AeRo
Link to comment
Share on other sites

Wow - thanks for the help.  Haha, it's funny because after this post I sat down for hours and learned this language as best I could.  I made code for moving the snake and had collision testing that works for a gameover sequence.

 

Thanks so much SeaGT for the help - now I have to go back through the code and clean it haha because I left in the pfpixel (well I coded all this before coming back to my thread).

 

But as you mentioned - I think the rom will be an issue with this game.

974256[/snapback]

 

Drawing a playfield the way I demonstrated can definitely help save ROM in many cases, as well as a whole lot of machine cycles. If you're drawing a title screen, the machine cycles might not matter much, if you're setting the playfield pixels just once and then using drawscreen in a loop without setting the playfield pixels over again during each pass through the loop. But if you need to reset/regenerate the screen each time the loop executes, the pf drawing routines can use up a lot of valuable machine cycles, leaving less time for you to do other things.

 

Can I have unlimited included files and what format do they need to be in?

974256[/snapback]

 

I'm not certain what you mean, but include files don't do any good after a game has been compiled and is running, because you can't "swap out" sections of the ROM by using different include files. It sounds like you really mean bankswitching, not include files. And no, bankswitching isn't unlimited. There are various schemes for implementing bankswitching. A month or two ago I posted a verion of bB 0.35 which allows the use of M-Network's bankswitching method, which can use about 16K of ROM and 2K of extra RAM. You might want to push your game as far as it will go in 4K of ROM to start out with, and then check out bankswitching if 4K isn't big enough to do what you want.

 

Basically I need a way to make all my levels of mazes without running out of rom space.  So can I have a bunch of included files which created my different levels of mazes?  Is there an easier way to do this?

974256[/snapback]

 

Keep in mind that the method I showed you for drawing a playfield requires only 44 bytes per screen (assuming you aren't putting anything in row 11, which is invisible anyway since it's "behind" the score bar), so you ought to be able to squeeze in several screens or mazes by storing them as data that way.

 

And I think working on my trailing snake will be the last thing I do/implement as it will probably give me some trouble.  I'll post my code when I go through and update it with all your helps.

 

 

EDIT: I don't want the snake to grow - but I do want it to have a trailing tail like the original nibbles game.  I just want it a fixed length.  I don't want it to eat apples and grow, it's not the point of this game.  I'm gonna make mazes that you have to get through with your snake, maybe even a key that when it collides with the key it opens the door to the next level.

974256[/snapback]

 

I was thinking about this last night after I posted. If the snake has a fixed length, then you can define an array to store the position of each block or segment of the snake, and use a routine to advance each block to the position occupied by the block in front of it, sort of like this:

 

  rem * this moves a snake made up of 5 playfield pixels

  dim snake_n_s = a
  dim snake_e_w = b

  dim snake_row = c
  rem * snake_row is 5 bytes-- c, d, e, f, g

  dim snake_col = h
  rem * snake_col is 5 bytes-- h, i, j, k, l

  dim frame = m
  dim speed = n

  snake_n_s = 0 : snake_e_w = 255 : speed = 15

  snake_row[0] = 5 : snake_col[0] = 16
  snake_row[1] = 5 : snake_col[1] = 17
  snake_row[2] = 5 : snake_col[2] = 18
  snake_row[3] = 5 : snake_col[3] = 19
  snake_row[4] = 5 : snake_col[4] = 20

  COLUBK = $00
  COLUPF = $C4

  rem * plot the snake's position (last 4 segments only)
  for z = 1 to 4
     pfpixel snake_col[z] snake_row[z] on
  next
  rem * don't need to draw all 5 segments each frame

loop

  rem * plot the snake's head
  pfpixel snake_col[0] snake_row[0] on

  rem * draw the screen
  frame = 0

wait

  drawscreen

  rem * update the snake's direction from the joystick
  if joy0left then snake_e_w = 255 : snake_n_s = 0
  if joy0right then snake_e_w = 1 : snake_n_s = 0
  if joy0up then snake_n_s = 255 : snake_e_w = 0
  if joy0down then snake_n_s = 1 : snake_e_w = 0

  rem * wait a bit to slow things down
  frame = frame + 1
  if frame < speed then goto wait
  rem * set speed to a lower number to speed up the snake

  rem * erase the snake's last segment
  pfpixel snake_col[4] snake_row[4] off

  rem * move the snake's segments forward
  for z = 4 to 1 step 255
     y = z - 1
     snake_col[z] = snake_col[y]
     snake_row[z] = snake_row[y]
  next
  snake_col[0] = snake_col[0] + snake_e_w
  snake_row[0] = snake_row[0] + snake_n_s

  rem * if snake moved "offscreen," then wrap around
  if snake_col[0] = 255 then snake_col[0] = 31
  if snake_col[0] = 32 then snake_col[0] = 0
  if snake_row[0] = 255 then snake_row[0] = 10
  if snake_row[0] = 11 then snake_row[0] = 0

  rem * keep repeating
  goto loop

 

Note that if you make the snake double back on itself (e.g., let it move left, then press the right arrow so it moves right), the drawing routine above will mess up, since it erases the last segment and draws the new position of the head segment, but doesn't redraw all 5 segments each frame. However, you already said you don't want the snake to be able to double back or cross over itself, so that won't be a problem with the above routine, although you would need to check the pixel for the new position of the head before you actually draw the head there, to be sure it isn't on already (which would mean that either the snake is about to run into a wall, or is about to cross over itself).

 

Michael Rideout

Link to comment
Share on other sites

OK, I'm gonna post the code I had before I read this thread to see if that helps any - it will help me ask better questions I guess. Then I will post the code with all the suggestions implemented. My original code:

 

 goto startme

programstart
 gosub clear

 for g = 0 to 11
 pfhline 0 g 31 offa
 next g

 pfpixel 25 6 on

 score = 10000

 drawscreen : COLUBK = 246
 dim spritex = a
 dim spritey = b

 COLUPF = 14
 player0x = 10 : player0y = 10

 player0:
 %00000100
 %00001110
 %00111111
 %00111101
 %00101110
 %01100100
 %01000000
 %11000000
end

gameloop
 gosub clear
 scorecolor = 196
 COLUP0 = 196
 score = score - 1
 drawscreen

 if joy0up && player0y > 10 then player0y = player0y - 1
 if joy0down && player0y < 89 then player0y = player0y + 1
 if joy0left && player0x > 15 then player0x = player0x - 1
 if joy0right && player0x <167 then player0x = player0x + 1
 if joy0fire then score = score + 1

 if collision(player0,playfield) then goto gameover

 goto gameloop

gameover
 drawscreen : COLUBK = 246
 for g = 0 to 11
 pfhline 0 g 31 offa
 next g
 gosub goverlogo
goverloop
 AUDV1 = 5 : AUDC1 = 7 : AUDF1 = rand : AUDV0 = 0
 COLUPF = 14 : COLUBK = 246
 COLUP0 = 246
 COLUP1 = 246 : scorecolor = 246
 drawscreen
 f = f + 1
 if f < 60 then goto goverloop
 score = 0 : AUDV1 = 0
 if joy0up then goto startme
 goto goverloop

startme
 gosub clear
 COLUPF = 68
 for g = 0 to 11
 pfhline 0 g 31 offa
 next g
 gosub logo
 COLUP0 = 246
 COLUP1 = 246 : scorecolor = 246
coloring
 g = 246
 COLUBK = g : COLUP0 = g : COLUP1 = g : COLUPF = 196
 drawscreen
 if joy0fire then drawscreen : goto programstart
 goto coloring

logo
 pfpixel 1 2 on : pfpixel 2 2 on : pfpixel 3 2 on : pfpixel 4 2 on 
 pfpixel 5 2 on : pfpixel 7 2 on : pfpixel 11 2 on : pfpixel 13 2 on 
 pfpixel 14 2 on : pfpixel 15 2 on : pfpixel 16 2 on : pfpixel 17 2 on 
 pfpixel 19 2 on : pfpixel 20 2 on : pfpixel 21 2 on : pfpixel 22 2 on 
 pfpixel 23 2 on : pfpixel 25 2 on : pfpixel 26 2 on : pfpixel 27 2 on 
 pfpixel 28 2 on : pfpixel 29 2 on : pfpixel 1 3 on : pfpixel 5 3 on 
 pfpixel 7 3 on : pfpixel 8 3 on : pfpixel 11 3 on : pfpixel 13 3 on 
 pfpixel 17 3 on : pfpixel 23 3 on : pfpixel 25 3 on : pfpixel 29 3 on 
 pfpixel 1 4 on : pfpixel 7 4 on : pfpixel 9 4 on : pfpixel 11 4 on 
 pfpixel 13 4 on : pfpixel 17 4 on : pfpixel 22 4 on : pfpixel 25 4 on 
 pfpixel 1 5 on : pfpixel 2 5 on : pfpixel 3 5 on : pfpixel 4 5 on 
 pfpixel 5 5 on : pfpixel 7 5 on : pfpixel 9 5 on : pfpixel 11 5 on 
 pfpixel 13 5 on : pfpixel 14 5 on : pfpixel 15 5 on : pfpixel 16 5 on 
 pfpixel 17 5 on : pfpixel 21 5 on : pfpixel 25 5 on : pfpixel 26 5 on 
 pfpixel 27 5 on : pfpixel 5 6 on : pfpixel 7 6 on : pfpixel 9 6 on 
 pfpixel 11 6 on : pfpixel 13 6 on : pfpixel 17 6 on : pfpixel 20 6 on 
 pfpixel 25 6 on : pfpixel 1 7 on : pfpixel 5 7 on : pfpixel 7 7 on 
 pfpixel 10 7 on : pfpixel 11 7 on : pfpixel 13 7 on : pfpixel 17 7 on 
 pfpixel 19 7 on : pfpixel 25 7 on : pfpixel 29 7 on : pfpixel 1 8 on 
 pfpixel 2 8 on : pfpixel 3 8 on : pfpixel 4 8 on : pfpixel 5 8 on 
 pfpixel 7 8 on : pfpixel 11 8 on : pfpixel 13 8 on : pfpixel 17 8 on 
 pfpixel 19 8 on : pfpixel 20 8 on : pfpixel 21 8 on : pfpixel 22 8 on 
 pfpixel 23 8 on : pfpixel 25 8 on : pfpixel 26 8 on : pfpixel 27 8 on 
 pfpixel 28 8 on : pfpixel 29 8 on
 return

goverlogo
 pfpixel 0 3 on : pfpixel 1 3 on : pfpixel 2 3 on : pfpixel 4 3 on 
 pfpixel 5 3 on : pfpixel 6 3 on : pfpixel 8 3 on : pfpixel 10 3 on 
 pfpixel 12 3 on : pfpixel 13 3 on : pfpixel 14 3 on : pfpixel 16 3 on 
 pfpixel 17 3 on : pfpixel 18 3 on : pfpixel 20 3 on : pfpixel 22 3 on 
 pfpixel 24 3 on : pfpixel 25 3 on : pfpixel 26 3 on : pfpixel 28 3 on 
 pfpixel 29 3 on : pfpixel 30 3 on : pfpixel 0 4 on : pfpixel 2 4 on 
 pfpixel 6 4 on : pfpixel 8 4 on : pfpixel 9 4 on : pfpixel 10 4 on 
 pfpixel 12 4 on : pfpixel 14 4 on : pfpixel 16 4 on : pfpixel 18 4 on 
 pfpixel 20 4 on : pfpixel 22 4 on : pfpixel 24 4 on : pfpixel 26 4 on 
 pfpixel 28 4 on : pfpixel 30 4 on : pfpixel 0 5 on : pfpixel 1 5 on 
 pfpixel 2 5 on : pfpixel 4 5 on : pfpixel 5 5 on : pfpixel 6 5 on 
 pfpixel 8 5 on : pfpixel 10 5 on : pfpixel 12 5 on : pfpixel 13 5 on 
 pfpixel 14 5 on : pfpixel 16 5 on : pfpixel 18 5 on : pfpixel 20 5 on 
 pfpixel 22 5 on : pfpixel 24 5 on : pfpixel 25 5 on : pfpixel 26 5 on 
 pfpixel 28 5 on : pfpixel 2 6 on : pfpixel 4 6 on : pfpixel 6 6 on 
 pfpixel 8 6 on : pfpixel 10 6 on : pfpixel 12 6 on : pfpixel 16 6 on 
 pfpixel 18 6 on : pfpixel 20 6 on : pfpixel 22 6 on : pfpixel 24 6 on 
 pfpixel 28 6 on : pfpixel 0 7 on : pfpixel 1 7 on : pfpixel 2 7 on 
 pfpixel 4 7 on : pfpixel 5 7 on : pfpixel 6 7 on : pfpixel 8 7 on 
 pfpixel 10 7 on : pfpixel 12 7 on : pfpixel 13 7 on : pfpixel 14 7 on 
 pfpixel 16 7 on : pfpixel 17 7 on : pfpixel 18 7 on : pfpixel 21 7 on 
 pfpixel 24 7 on : pfpixel 25 7 on : pfpixel 26 7 on : pfpixel 28 7 on
 return

clear

r29 asm
 ldx #47
 lda #0
clearpf
 sta playfield, x
 dex
 bpl clearpf
end
 return

 

As you can see I figured out a better clearing method (like the one you showed me in the new code) but I didn't delete the clear subroutine. I used:

 

for g = 0 to 11
pfhline 0 g 31 offa
next g

 

I turned one pixel on to demonstrate the collision qualities of the snake. When the snake collides it goes to a gameover sequence (you get out by pushing up I think - I did this because if you held down spacebar it would restart the game quickly because it goes back to the logo screen sequence).

 

And as you see I used the player0 method of constructing the character - I didn't know if there was a way to make a snake with this that would act like the snake you gave in the example above.

 

Also the snake can't go offscreen:

if joy0up && player0y > 10 then player0y = player0y - 1
if joy0down && player0y < 89 then player0y = player0y + 1
if joy0left && player0x > 15 then player0x = player0x - 1
if joy0right && player0x <167 then player0x = player0x + 1

 

But I admit, I do like the way you showed above where the snake just wraps, could make for some harder levels if I don't put borders in places.

 

As you can see the ROM space is very limited in this style because of the use of pfpixels, so I appreciate showing me the other method.

 

 

 

 

Now, I'll post the code with you suggestions and show you the errors I get, and maybe you can point me in the right direction if I don't figure it out again.

 

 goto startme

programstart
 gosub clear
 x = 0
 y = 0

 score = 10000

 rem ** this moves a snake made up of 5 playfield pixels

 dim snake_n_s = a
 dim snake_e_w = b

 dim snake_row = c
 rem ** snake_row is 5 bytes -- c, d, e, f, g

 dim snake_col = h
 rem ** snake_col is 5 bytes -- h, i, j, k, l

 dim frame = m
 dim speed = n

 snake_n_s = 0 : snake_e_w = 255 : speed = 15

 snake_row[0] = 5 : snake_col[0] = 16
 snake_row[1] = 5 : snake_col[1] = 17
 snake_row[2] = 5 : snake_col[2] = 18
 snake_row[3] = 5 : snake_col[3] = 19
 snake_row[4] = 5 : snake_col[4] = 20

 COLUBK = $00
 COLUPF = $C4

 rem ** plot the snake's position
 for z = 1 to 4
  pfpixel snake_col[z] snake_row[z] on
 next
 rem ** don't need to draw all segments each frame
end

gameloop
 rem ** snake's head
 pfpixel snake_col[0] snake_row[0] on

 rem ** draw the screen
 frame = 0

wait
 drawscreen

 if joy0left then snake_e_w = 255 : snake_n_s = 0
 if joy0right then snake_e_w = 1 : snake_n_s = 0
 if joy0up then snake_n_s = 255 : snake_e_w = 0
 if joy0down then snake_n_s = 1 : snake_e_w = 0

 rem ** slowing things down
 frame = frame + 1
 if frame < speed then goto wait
 rem ** set spped to a lower number to speed up the snake
 rem ** useful for harder levels in the future

 rem ** now wee need to erase the snake's last segment
 pfpixel snake_col[4] snake_row[4] off

rem ** move snake's segments
 for z = 4 to 1 step 255
  y = z - 1
  snake_col[z] = snake_col[y]
  snake_row[z] = snake_col[y]
 next
 snake_col[0] = snake_col[0] + snake_e_w
 snake_row[0] = snake_row[0] + snake_n_s

 rem ** snake wrap
 if snake_col[0] = 255 then snake_col[0] = 31
 if snake_col[0] = 32 then snake_col[0] = 0
 if snake_row[0] = 255 then snake_row[0] = 10
 if snake_row[0] = 11 then snake_row[0] = 0

 goto gameloop

startme
 gosub clear
 COLUPF = $44
 gosub logo
 COLUP0 = $00
 COLUP1 = $00 : scorecolor = $00

coloring
 g = g + 1
 COLUBK = g : COLUP0 = g : COLUP1 = g : COLUPF = $C4
 drawscreen
 if joy0fire then goto programstart
 goto coloring

logo
 data logo_data
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
 %01111101,%00010111,%11011111,%01111100
 %01000101,%10010100,%01000001,%01000100
 %01000001,%01010100,%01000010,%01000000
 %01111101,%01010111,%11000100,%01110000
 %00000101,%01010100,%01001000,%01000100
 %00000101,%00110100,%01010000,%01000100
 %01111101,%00010100,%01011111,%01111100
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
end
 for r = 0 to 10
  for c = 0 to 3
   b = 4 * r
   b = b + c
   temp1 = logo_data[b]
   if c = 1 then gosub flip_it
   if c = 3 then gosub flip_it
   playfield[b] = temp1
  next
 next
 return

 rem ** clears the screen
clear
 for b = 0 to 47
  playfield[b] = 0
 next
 return

flip_it
 temp2 = 0
 if temp1{0} then temp2{7} = 1
 if temp1{1} then temp2{6} = 1
 if temp1{2} then temp2{5} = 1
 if temp1{3} then temp2{4} = 1
 if temp1{4} then temp2{3} = 1
 if temp1{5} then temp2{2} = 1
 if temp1{6} then temp2{1} = 1
 if temp1{7} then temp2{0} = 1
 temp1 = temp2
 return

 

The program works fine, until you use the snake for a little bit. The snake continues to grow and after a few seconds the screen just freaks out (I guess it's because the snake continues to grow). The last segment isn't turning off, although it is instructed to through the pfpixel off command.

 

I was also wondering if it was possible to make this snake without the pfpixel, to make it 'skinnier' as with a sprite or something.

 

I had no idea how to use the collision detection with this if I'm using pfpixel - it was simpler with the method in my first code. Because of this, I didn't implement my gameover sequence.

 

Oh, and I do like the color changing thing in the beginning ;)

 

What is the generally accepted or best method for moving level to level? Say my snake's head hits a certain pixel (the end of the maze) then move to the next level - all the while implementing different speeds as the level gets harder.

Link to comment
Share on other sites

And as you see I used the player0 method of constructing the character - I didn't know if there was a way to make a snake with this that would act like the snake you gave in the example above.

975110[/snapback]

 

I couldn't think of a decent way to use a player for the snake, since I figured you'd want the snake to move around and change shape/directions kind of like the way it does in my second example. To do something similar with a player, you'll need to redefine the player shape a whole bunch-- which is doable, but could be very tedious to program because of all the possible shapes. Using a player does offer the advantage that the pixels can be smaller, though.

 

I'll see if I can put together an example that uses a player for the snake, but I can't do it tonight.

 

Also the snake can't go offscreen:

if joy0up && player0y > 10 then player0y = player0y - 1
if joy0down && player0y < 89 then player0y = player0y + 1
if joy0left && player0x > 15 then player0x = player0x - 1
if joy0right && player0x <167 then player0x = player0x + 1

 

But I admit, I do like the way you showed above where the snake just wraps, could make for some harder levels if I don't put borders in places.

975110[/snapback]

 

Well, I expected that you wouldn't want to use wraparound; I just used it in my example because I didn't have any borders/walls, and I was really trying to show how you can program a shape to keep moving in a particular direction until you use the joystick (or cursor control keys in an emulator) to steer it in a different direction.

 

Now, I'll post the code with you suggestions and show you the errors I get, and maybe you can point me in the right direction if I don't figure it out again.

 

 goto startme

programstart
 gosub clear
 x = 0
 y = 0

 score = 10000

 rem ** this moves a snake made up of 5 playfield pixels

 dim snake_n_s = a
 dim snake_e_w = b

 dim snake_row = c
 rem ** snake_row is 5 bytes -- c, d, e, f, g

 dim snake_col = h
 rem ** snake_col is 5 bytes -- h, i, j, k, l

 dim frame = m
 dim speed = n

 snake_n_s = 0 : snake_e_w = 255 : speed = 15

 snake_row[0] = 5 : snake_col[0] = 16
 snake_row[1] = 5 : snake_col[1] = 17
 snake_row[2] = 5 : snake_col[2] = 18
 snake_row[3] = 5 : snake_col[3] = 19
 snake_row[4] = 5 : snake_col[4] = 20

 COLUBK = $00
 COLUPF = $C4

 rem ** plot the snake's position
 for z = 1 to 4
  pfpixel snake_col[z] snake_row[z] on
 next
 rem ** don't need to draw all segments each frame
end

gameloop
 rem ** snake's head
 pfpixel snake_col[0] snake_row[0] on

 rem ** draw the screen
 frame = 0

wait
 drawscreen

 if joy0left then snake_e_w = 255 : snake_n_s = 0
 if joy0right then snake_e_w = 1 : snake_n_s = 0
 if joy0up then snake_n_s = 255 : snake_e_w = 0
 if joy0down then snake_n_s = 1 : snake_e_w = 0

 rem ** slowing things down
 frame = frame + 1
 if frame < speed then goto wait
 rem ** set spped to a lower number to speed up the snake
 rem ** useful for harder levels in the future

 rem ** now wee need to erase the snake's last segment
 pfpixel snake_col[4] snake_row[4] off

rem ** move snake's segments
 for z = 4 to 1 step 255
  y = z - 1
  snake_col[z] = snake_col[y]
  snake_row[z] = snake_col[y]
 next
 snake_col[0] = snake_col[0] + snake_e_w
 snake_row[0] = snake_row[0] + snake_n_s

 rem ** snake wrap
 if snake_col[0] = 255 then snake_col[0] = 31
 if snake_col[0] = 32 then snake_col[0] = 0
 if snake_row[0] = 255 then snake_row[0] = 10
 if snake_row[0] = 11 then snake_row[0] = 0

 goto gameloop

startme
 gosub clear
 COLUPF = $44
 gosub logo
 COLUP0 = $00
 COLUP1 = $00 : scorecolor = $00

coloring
 g = g + 1
 COLUBK = g : COLUP0 = g : COLUP1 = g : COLUPF = $C4
 drawscreen
 if joy0fire then goto programstart
 goto coloring

logo
 data logo_data
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
 %01111101,%00010111,%11011111,%01111100
 %01000101,%10010100,%01000001,%01000100
 %01000001,%01010100,%01000010,%01000000
 %01111101,%01010111,%11000100,%01110000
 %00000101,%01010100,%01001000,%01000100
 %00000101,%00110100,%01010000,%01000100
 %01111101,%00010100,%01011111,%01111100
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
end
 for r = 0 to 10
  for c = 0 to 3
   b = 4 * r
   b = b + c
   temp1 = logo_data[b]
   if c = 1 then gosub flip_it
   if c = 3 then gosub flip_it
   playfield[b] = temp1
  next
 next
 return

 rem ** clears the screen
clear
 for b = 0 to 47
  playfield[b] = 0
 next
 return

flip_it
 temp2 = 0
 if temp1{0} then temp2{7} = 1
 if temp1{1} then temp2{6} = 1
 if temp1{2} then temp2{5} = 1
 if temp1{3} then temp2{4} = 1
 if temp1{4} then temp2{3} = 1
 if temp1{5} then temp2{2} = 1
 if temp1{6} then temp2{1} = 1
 if temp1{7} then temp2{0} = 1
 temp1 = temp2
 return

 

The program works fine, until you use the snake for a little bit.  The snake continues to grow and after a few seconds the screen just freaks out (I guess it's because the snake continues to grow).  The last segment isn't turning off, although it is instructed to through the pfpixel off command.

975110[/snapback]

 

I see a number of problems right away.

 

First, I can't get it to compile as is because you need to include the div_mul.asm file. Add this line at the very beginning of your code:

 

  include div_mul.asm

 

(If you got it to compile, then you may have simply omitted that line when you were copying the code into your post.)

 

Next, you have a typo right here:

 

  rem ** move snake's segments
  for z = 4 to 1 step 255
     y = z - 1
     snake_col[z] = snake_col[y]
     snake_row[z] = snake_col[y]
  next

 

In the line that says "snake_row[z] = snake_col[y]", the second "col" should be "row," like this:

 

  rem ** move snake's segments
  for z = 4 to 1 step 255
     y = z - 1
     snake_col[z] = snake_col[y]
     snake_row[z] = snake_row[y]
  next

 

That's the reason it's freaking out, since snake_col can go up to 31, but snake_row should go up to only 10, so setting snake_row[z] equal to snake_col[y] puts the wrong value in snake_row[z], and that value can be much too large. Fix that line, and the snake will move around correctly.

 

Also, I see that you're using b, c, and g in your code, but in the sample code that I'd posted, those variables are being used for other things. It turns out that this is okay, because you aren't using them for different things at the same time. But in general, you should try not to reuse variables like that unless you're sure there won't be any conflicts. In other words, don't use b, c, and g during the actual game play if you're using them for storing other values (e.g., b is used for snake_e_w, c is used for snake_row[0], and g is used for snake_row[4]). This is my fault for not picking other letters to use in my examples, letters that you weren't already using, or that weren't used for other things in my logo screen example. As I said, in this case it's okay, but just be careful when you reuse variables for multiple purposes in the same program.

 

I was also wondering if it was possible to make this snake without the pfpixel, to make it 'skinnier' as with a sprite or something.

975110[/snapback]

 

Yes, but it will be trickier and more tedious to do. As I said, I'll try to put together an example, tomorrow night at the earliest.

 

I had no idea how to use the collision detection with this if I'm using pfpixel - it was simpler with the method in my first code.  Because of this, I didn't implement my gameover sequence.

975110[/snapback]

 

If you're going to use pfpixel to draw both the snake and the walls of the maze, then you'll have to "peek" ahead using the pfread function before you move the snake's head into a new location, like this:

 

rem ** move snake's segments
 for z = 4 to 1 step 255
  y = z - 1
  snake_col[z] = snake_col[y]
  snake_row[z] = snake_col[y]
 next
 snake_col[0] = snake_col[0] + snake_e_w
 snake_row[0] = snake_row[0] + snake_n_s

rem ** is there something there already?
z = snake_col[0] : y = snake_row[0]
if pfread(z,y) then goto gameover

 

Note that this check is being done after the new position of the snake's head has been calculated, but before the snake's head has actually been drawn at the new position, so if the pfpixel at the new position is already on, then it means the snake is about to collide either with itself or with a wall.

 

Oh, and I do like the color changing thing in the beginning ;)

 

What is the generally accepted or best method for moving level to level?  Say my snake's head hits a certain pixel (the end of the maze) then move to the next level - all the while implementing different speeds as the level gets harder.

975110[/snapback]

 

Yes, I like the flashing colors, too!

 

As for moving from one level to the next, that's up to how you want the game to work, as well as what the goal is. For example, if the primary goal is to navigate the maze without the snake hitting a wall or crossing over itself, then you probably need a secondary goal, too. For example, you mentioned reaching and touching a particular wall or section of wall, which (if you do that) you might want to draw with a player or missile, so it can be a different color than the rest of the maze. Or, you could have an opening in the maze wall, and the snake has to get through the maze and go through the opening to enter the next "room." Or, if you're going to draw both the snake and the maze with pfpixels, then you might use the players and missiles to draw objects that are scattered around the maze, and the snake is supposed to collect (or collide with and "eat") all of the objects without hitting a wall (or itself) in order to "clear" the current maze and advance to the next maze.

 

To go from one level to the next, you could just clear the screen once the current maze has been completed successfully, and draw the next maze, repositioning the snake to the "starting" location for the new level. Also, besides speeding up the game from one level to the next, you might want to keep the same speed for a few levels before speeding up, and have some other kind of difficulty increase, such as starting with a short snake, and adding another segment every level or so to make the snake longer so it's harder to keep it from crossing over itself.

 

Michael Rideout

Link to comment
Share on other sites

If you're going to use pfpixel to draw both the snake and the walls of the maze, then you'll have to "peek" ahead using the pfread function before you move the snake's head into a new location, like this:

 

rem ** move snake's segments
 for z = 4 to 1 step 255
  y = z - 1
  snake_col[z] = snake_col[y]
  snake_row[z] = snake_col[y]
 next
 snake_col[0] = snake_col[0] + snake_e_w
 snake_row[0] = snake_row[0] + snake_n_s

rem ** is there something there already?
z = snake_col[0] : y = snake_row[0]
if pfread(z,y) then goto gameover

975241[/snapback]

 

Sorry, I included the typo in that code. It should be:

 

rem ** move snake's segments
 for z = 4 to 1 step 255
  y = z - 1
  snake_col[z] = snake_col[y]
  snake_row[z] = snake_row[y] : rem ** typo was in this line
 next
 snake_col[0] = snake_col[0] + snake_e_w
 snake_row[0] = snake_row[0] + snake_n_s

rem ** is there something there already?
z = snake_col[0] : y = snake_row[0]
if pfread(z,y) then goto gameover

 

Michael Rideout

Link to comment
Share on other sites

I think that's my next task, learning how to make the sprites move differently (don't know if I worded that correctly). I saw some games where when you move the character, it 'turns' in that direction.

 

I'm assuming that making this snake is gonna be similar. I was wondering if more than one sprite could be added on to form this snake. If so, I think the way at going at it would be let's say I have 5 segments, making something similar to your flip routine, I would flip the sprite as it is turned a certain way, keeping the other sprites intact until the last one is deleted and the first one is updated. Hopefully that's the right way at looking at it, and the way I will try to go at it.

 

Oh and, when making the sprite for example if I have something like:

 

 %00011000
 %00011000
 %00011000
 %00011000
 %00011000
 %00011000
 %00011000
 %00011000

 

For collision testing, are the 0's counted as something? For example, the column of 1's are running against the wall, would the 0's next to the 1's be counted into the collision? Or is it the 1's only that make up the sprite for collision testing? I hope I worded that correctly. If so, I think it should 'snake' around the wall perfectly then (get as close to it without touching it and not being considered a collision).

Link to comment
Share on other sites

I think that's my next task, learning how to make the sprites move differently (don't know if I worded that correctly).  I saw some games where when you move the character, it 'turns' in that direction.

 

I'm assuming that making this snake is gonna be similar.  I was wondering if more than one sprite could be added on to form this snake.  If so, I think the way at going at it would be let's say I have 5 segments, making something similar to your flip routine, I would flip the sprite as it is turned a certain way, keeping the other sprites intact until the last one is deleted and the first one is updated.  Hopefully that's the right way at looking at it, and the way I will try to go at it.

 

For collision testing, are the 0's counted as something?  For example, the column of 1's are running against the wall, would the 0's next to the 1's be counted into the collision?  Or is it the 1's only that make up the sprite for collision testing?  I hope I worded that correctly.  If so, I think it should 'snake' around the wall perfectly then (get as close to it without touching it and not being considered a collision).

975258[/snapback]

Only the 1's are counted in a collision.

 

Also, you can combine sprites - for a snake, you could have both players and missiles, I would imagine - it's just a matter of creating the right sprites and imposing limitations on how quickly the snake can turn. Normally a snake game requires bitmapped graphics, which are pretty coarse in bB as you have seen.

Edited by batari
Link to comment
Share on other sites

UPDATE:

 

I thought I would give y'all an update on the current status of this development.

 

Basically the snake moves using the pfpixels. I tried making a playing field with more pfpixels, but I guess since the snake is called using it - it will only display the playingfield and not the snake.

 

I was then forced to use player sprites and missiles to coordinate the playing field for mazes. But that in itself became a daunting task: lining up sprites where I have gaps with the invisible pfpixels so the snake can pass through them - and limited number of walls I'm allowed to create (2 players and 2 missiles).

 

I think I'm gonna resort back to a stagnate snake using the player sprite (but make it turn directions it's goin in) until I can figure out a way to make the player sprite snake-like.

 

Also I'm slowly implementing levels. I plan on using one of the missiles to make a key to unlock a door in the maze. When the player collides with the key it opens a door, and when the player collides with the door it moves to the next level by adding +1 to the level variable. I think that's the best way to move level to level.

 

Currently you push space to begin the game and up to get out of the gameover sequence. The score slowly declines (I'll probably make it slower in the future) because you're limited to how much time you have to get out of the maze. If you push fire during the game it'll take you to a blank screen, just used it to test or not if I could make a second level (worked correctly).

 

Few questions:

 

How do I make it if say the head of the snake collides with a certain pixel (the pixel will be turned OFF) - which is the door to go to the next level? I know how to make it go to the next level, but how do I set up the if - then statement? If collides(player0, a certain pixel) then blah blah blah

 

 

Below is my code for criticism/contributions/skepticism/hate mail/wacky posts/etc...:

 

 include div_mul.asm

 COLUBK = $70
 COLUPF = $44
 COLUP0 = $C4

 rem ** this is so I can get level to level
 rem ** if statements for levels located in whatLevel
 dim level = o
 level = 1

 score = 0

 rem ** goes to the logo screen
 goto startme

programstart
 gosub clear
 x = 0
 y = 0

 score = score + 100

 rem ** this moves a snake made up of 5 playfield pixels

 dim snake_n_s = a
 dim snake_e_w = b

 dim snake_row = c
 rem ** snake_row is 5 bytes -- c, d, e, f, g

 dim snake_col = h
 rem ** snake_col is 5 bytes -- h, i, j, k, l

 dim frame = m
 dim speed = n

 snake_n_s = 0 : snake_e_w = 255 : speed = 15

 rem ** snake's starting point
 snake_row[0] = 1 : snake_col[0] = 27
 snake_row[1] = 1 : snake_col[1] = 28
 snake_row[2] = 1 : snake_col[2] = 29
 snake_row[3] = 1 : snake_col[3] = 30
 snake_row[4] = 1 : snake_col[4] = 31

 COLUBK = 246
 COLUPF = 196

 rem ** plot the snake's position
 for z = 1 to 4
  pfpixel snake_col[z] snake_row[z] on
 next
 rem ** don't need to draw all segments each frame
end

 rem ** this checks what the current level number
 rem ** is set to and goes the correct level
whatLevel
 if level = 1 then goto Level1
 rem ** if level = 2 then goto Level2
 rem ** if level = ..... etc....
end

Level1

 rem ** snake's head
 pfpixel snake_col[0] snake_row[0] on

 rem ** draw the screen
 frame = 0

 gosub Level1map

wait
 drawscreen

 if joy0left then snake_e_w = 255 : snake_n_s = 0
 if joy0right then snake_e_w = 1 : snake_n_s = 0
 if joy0up then snake_n_s = 255 : snake_e_w = 0
 if joy0down then snake_n_s = 1 : snake_e_w = 0

 rem ** slowing things down
 frame = frame + 1
 if frame < speed then goto wait
 score = score - 1
 rem ** set spped to a lower number to speed up the snake
 rem ** useful for harder levels in the future

 rem ** now wee need to erase the snake's last segment
 pfpixel snake_col[4] snake_row[4] off

 rem ** move snake's segments
 for z = 4 to 1 step 255
  y = z - 1
  snake_col[z] = snake_col[y]
  snake_row[z] = snake_row[y]
 next
 snake_col[0] = snake_col[0] + snake_e_w
 snake_row[0] = snake_row[0] + snake_n_s

 rem ** collision for snake and player0
 if collision(player0,playfield) then goto gameover

 rem ** if fire then gameover sequence
 if joy0fire then level = 2
 if level = 2 then goto programstart

 rem ** snake wrap
 if snake_col[0] = 255 then snake_col[0] = 31
 if snake_col[0] = 32 then snake_col[0] = 0
 if snake_row[0] = 255 then snake_row[0] = 10
 if snake_row[0] = 11 then snake_row[0] = 0

 goto Level1

 rem ** gameover sequence
gameover
 drawscreen : COLUBK = 246
 gosub clear
 gosub goverlogo
goverloop
 AUDV1 = 5 : AUDC1 = 7 : AUDF1 = rand : AUDV0 = 0
 COLUPF = 14 : COLUBK = 246
 COLUP0 = 246 : COLUP1 = 246 : scorecolor = 14
 drawscreen
 f = f + 1
 if f < 60 then goto goverloop
 score = score : AUDV1 = 0
 if joy0up then goto startme
 goto goverloop

 rem ** logo screen sequence
startme
 gosub clear
 COLUPF = $44
 gosub logo
 COLUP0 = $00
 COLUP1 = $00 : scorecolor = $00

coloring
 g = g + 1
 COLUBK = g : COLUP0 = g : COLUP1 = g : COLUPF = $C4
 drawscreen
 if joy0fire then goto programstart
 goto coloring

 rem ** pfpixels for logo
logo
 data logo_data
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
 %01111101,%00010111,%11011111,%01111100
 %01000101,%10010100,%01000001,%01000100
 %01000001,%01010100,%01000010,%01000000
 %01111101,%01010111,%11000100,%01110000
 %00000101,%01010100,%01001000,%01000100
 %00000101,%00110100,%01010000,%01000100
 %01111101,%00010100,%01011111,%01111100
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
end
 for r = 0 to 10
  for c = 0 to 3
   b = 4 * r
   b = b + c
   temp1 = logo_data[b]
   if c = 1 then gosub flip_it
   if c = 3 then gosub flip_it
   playfield[b] = temp1
  next
 next
 return

 rem ** pfpixels for gameover logo
goverlogo
 data gover_data
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
 %11101110,%10101110,%11101010,%11101110
 %10100010,%11101010,%10101010,%10101010
 %11101110,%10101110,%10101010,%11101000
 %00101010,%10101000,%10101010,%10001000
 %11101110,%10101110,%11100100,%11101000
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
end
 for r = 0 to 10
  for c = 0 to 3
   b = 4 * r
   b = b + c
   temp1 = gover_data[b]
   if c = 1 then gosub flip_it
   if c = 3 then gosub flip_it
   playfield[b] = temp1
  next
 next
 return

Level1map
 COLUP0 = 14
 player0x = 40
 player0y = 80
 player0:
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
end
 return

Level2map
 COLUP0 = 14
 player0x = 80
 player0y = 80
 player0:
 %11111111
 %11111111
 %11111111
 %00000000
 %00000000
 %00000000
 %00000000
 %00000000
 %00000000
 %11111111
end
 return

 rem ** clears the screen
clear
 for g = 0 to 11
  pfhline 0 g 31 offa
 next g
 return

flip_it
 temp2 = 0
 if temp1{0} then temp2{7} = 1
 if temp1{1} then temp2{6} = 1
 if temp1{2} then temp2{5} = 1
 if temp1{3} then temp2{4} = 1
 if temp1{4} then temp2{3} = 1
 if temp1{5} then temp2{2} = 1
 if temp1{6} then temp2{1} = 1
 if temp1{7} then temp2{0} = 1
 temp1 = temp2
 return

 

And I attached the bin file for people to test. And offer any ideas...

snazev3.bas.bin

Link to comment
Share on other sites

UPDATE:

 

I thought I would give y'all an update on the current status of this development.

 

Basically the snake moves using the pfpixels.  I tried making a playing field with more pfpixels, but I guess since the snake is called using it - it will only display the playingfield and not the snake.

976588[/snapback]

 

What you'd need to do, if you want to use pfpixels for both the snake and the maze, is draw the maze first, before you get into the drawscreen loop, and then draw the snake inside the screen-drawing loop. For example, notice how in the following section of code you are gosubbing to draw the logo screen (by which I mean setting the bytes of the playfield equal to the desired values to create the logo text), before you actually get into the drawscreen loop:

 

startme
  gosub clear : rem <----- this is where you're clearing the screen
  COLUPF = $44
  gosub logo : rem <------ and this is where you're "drawing" the title logo
  COLUP0 = $00
  COLUP1 = $00 : scorecolor = $00

coloring
  g = g + 1
  COLUBK = g : COLUP0 = g : COLUP1 = g : COLUPF = $C4
  drawscreen : rem <----- but you don't actually draw the screen until here
  if joy0fire then goto programstart
  goto coloring

 

If you clear the screen, draw the maze, draw the last four segments of the snake, and then get into the drawscreen loop, you shouldn't have any problems using the pfpixels for both the maze and the snake. Of course, when you position the snake for the start of the maze on each level, you want to be sure the snake isn't already colliding with a wall.

 

I was then forced to use player sprites and missiles to coordinate the playing field for mazes.  But that in itself became a daunting task: lining up sprites where I have gaps with the invisible pfpixels so the snake can pass through them - and limited number of walls I'm allowed to create (2 players and 2 missiles).

 

I think I'm gonna resort back to a stagnate snake using the player sprite (but make it turn directions it's goin in) until I can figure out a way to make the player sprite snake-like.

976588[/snapback]

 

I've been working on an example of drawing a snake with player0, but it's tricky. I started out thinking I would try to define all possible configurations for the player0 data, but that will take up a lot of ROM to define all the variations, plus the ifs for all the variations will require a lot of code. So now I'm working on a routine which defines the player0 data as an 8-byte array in RAM, and calculates what the data should be, based on the direction that each segment of the snake is moving in. As you can imagine, it's tricky, but I've almost got it working the way I want-- except there is a lot of screen flickering, so it appears that the routine is too long. I plan to try splitting it into two or four sections, split across two or four frames, to see if that helps.

 

Also I'm slowly implementing levels.  I plan on using one of the missiles to make a key to unlock a door in the maze.  When the player collides with the key it opens a door, and when the player collides with the door it moves to the next level by adding +1 to the level variable.  I think that's the best way to move level to level.

 

Currently you push space to begin the game and up to get out of the gameover sequence.  The score slowly declines (I'll probably make it slower in the future) because you're limited to how much time you have to get out of the maze.  If you push fire during the game it'll take you to a blank screen, just used it to test or not if I could make a second level (worked correctly).

 

Few questions:

 

How do I make it if say the head of the snake collides with a certain pixel (the pixel will be turned OFF) - which is the door to go to the next level?  I know how to make it go to the next level, but how do I set up the if - then statement?  If collides(player0, a certain pixel) then blah blah blah

976588[/snapback]

 

You can't test for collision between a player pixel and a playfield pixel if the pfpixel is turned off, so you'll need to use a different method of detecting when the snake has moved through the maze exit.

 

One way you could do it is to check the snake's position. For example, if you know the exit is in column 0 of the playfield array, and in rows 4 and 5, then you could check to see if the snake's head is in column 0, row 4 or row 5.

 

Another way you could do it is to leave the playfield alone (i.e., don't open the exit door by turning off any pfpixels), and instead use player1 or missile1 to draw the exit, positioning it on top of the pfpixels where the exit is, and check for a collision between player0 and player1, or between player0 and missile1. You could also use missile0, but if you use player1 or missile1, you can set COLUP1 to the same color as COLUBK, so it looks like the pfpixels for the exit have been erased even though they are still turned on. Of course, in your loop you'll probably be checking for a collision between player0 and player1 (or missile1) for something else, like to see if the snake is eating something or collecting the key, but you could use a flag to determine whether or not the exit has been revealed. If the collision occurs but the flag is off, then the snake is collecting something rather than touching the exit. But when the snake touches the key, then turn on the flag that says the exit is now available, draw the exit with player1 or missile1, and when another collision occurs go to the next level if the flag is on.

 

Michael Rideout

Link to comment
Share on other sites

The flagging you recommended works beautifully - I implemented it into the code. I made the "key" (player1) that you get to open the door disappear after you collide into it, and the door (missile1) appear when the key is touched/disappears. I never would have thought of it this way - thanks so much for the help.

 

I tried implementing playfieldpixels - but the screen would either be black or flicker. I'm guessing because the drawscreen isn't looped through fast enough. Anyway, here's my code where my 'flag' implementations are made (thanks for the help with that ;) ):

 

 include div_mul.asm

 COLUBK = $70
 COLUPF = $44
 COLUP0 = $C4

 rem ** this is so I can get level to level
 rem ** if statements for levels located in whatLevel
 dim level = o
 level = 1

 rem ** checks to see if collision with key
 rem ** if key = 1 then door will open
 dim keyflag = p

 score = 0

 rem ** goes to the logo screen
 goto startme

programstart
 gosub clear
 x = 0
 y = 0

 score = score + 100
 keyflag = 0

 rem ** this moves a snake made up of 5 playfield pixels

 dim snake_n_s = a
 dim snake_e_w = b

 dim snake_row = c
 rem ** snake_row is 5 bytes -- c, d, e, f, g

 dim snake_col = h
 rem ** snake_col is 5 bytes -- h, i, j, k, l

 dim frame = m
 dim speed = n

 snake_n_s = 0 : snake_e_w = 255 : speed = 15

 rem ** snake's starting point
 snake_row[0] = 1 : snake_col[0] = 27
 snake_row[1] = 1 : snake_col[1] = 28
 snake_row[2] = 1 : snake_col[2] = 29
 snake_row[3] = 1 : snake_col[3] = 30
 snake_row[4] = 1 : snake_col[4] = 31

 COLUBK = 246
 COLUPF = 196

 rem ** plot the snake's position
 for z = 1 to 4
  pfpixel snake_col[z] snake_row[z] on
 next
 rem ** don't need to draw all segments each frame
end

 rem ** this checks what the current level number
 rem ** is set to and goes the correct level
whatLevel
 if level = 1 then goto Level1
 rem ** if level = 2 then goto Level2
 rem ** if level = ..... etc....
end

Level1

 rem ** snake's head
 pfpixel snake_col[0] snake_row[0] on

 rem ** draw the screen
 frame = 0

 gosub Level1map
 if keyflag = 0 then gosub keymap
 if keyflag = 1 then gosub player1off

wait
 drawscreen
 COLUP1 = 130

 if joy0left then snake_e_w = 255 : snake_n_s = 0
 if joy0right then snake_e_w = 1 : snake_n_s = 0
 if joy0up then snake_n_s = 255 : snake_e_w = 0
 if joy0down then snake_n_s = 1 : snake_e_w = 0

 rem ** slowing things down
 frame = frame + 1
 if frame < speed then goto wait
 score = score - 1
 rem ** set spped to a lower number to speed up the snake
 rem ** useful for harder levels in the future

 rem ** now wee need to erase the snake's last segment
 pfpixel snake_col[4] snake_row[4] off

 rem ** move snake's segments
 for z = 4 to 1 step 255
  y = z - 1
  snake_col[z] = snake_col[y]
  snake_row[z] = snake_row[y]
 next
 snake_col[0] = snake_col[0] + snake_e_w
 snake_row[0] = snake_row[0] + snake_n_s

 rem ** collision for snake and player0
 if collision(player0,playfield) then goto gameover

 rem ** collision for snake and key and door
 if collision(player1,playfield) then keyflag = 1
 if keyflag = 1 then gosub doorOpen
 if collision(missile1,playfield) then goto Level2

 rem ** if fire then gameover sequence
 if joy0fire then level = 2
 if level = 2 then goto programstart

 rem ** snake wrap
 if snake_col[0] = 255 then snake_col[0] = 31
 if snake_col[0] = 32 then snake_col[0] = 0
 if snake_row[0] = 255 then snake_row[0] = 10
 if snake_row[0] = 11 then snake_row[0] = 0

 goto Level1

Level2
 drawscreen : COLUBK = 246
 gosub clear
 gosub Level2map
 gosub player0off
 gosub player1off
 gosub missile1off
level2loop
 drawscreen
 if joy0fire then goto programstart
 goto level2loop

 rem ** gameover sequence
gameover
 drawscreen : COLUBK = 246
 gosub clear
 gosub player0off
 gosub player1off
 gosub missile1off
 gosub goverlogo
goverloop
 AUDV1 = 5 : AUDC1 = 7 : AUDF1 = rand : AUDV0 = 0
 COLUPF = 14 : COLUBK = 246
 COLUP0 = 246 : COLUP1 = 246 : scorecolor = 14
 drawscreen
 f = f + 1
 if f < 60 then goto goverloop
 AUDV1 = 0
 if joy0up then score = 0
 if joy0up then goto startme
 goto goverloop

 rem ** logo screen sequence
startme
 gosub clear
 COLUPF = $44
 gosub logo
 COLUP0 = 14
 COLUP1 = 130 : scorecolor = $00

coloring
 g = g + 1
 COLUBK = g : COLUP0 = g : COLUP1 = g : COLUPF = $C4
 drawscreen
 if joy0fire then goto programstart
 goto coloring

 rem ** pfpixels for logo
logo
 data logo_data
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
 %01111101,%00010111,%11011111,%01111100
 %01000101,%10010100,%01000001,%01000100
 %01000001,%01010100,%01000010,%01000000
 %01111101,%01010111,%11000100,%01110000
 %00000101,%01010100,%01001000,%01000100
 %00000101,%00110100,%01010000,%01000100
 %01111101,%00010100,%01011111,%01111100
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
end
 for r = 0 to 10
  for c = 0 to 3
   b = 4 * r
   b = b + c
   temp1 = logo_data[b]
   if c = 1 then gosub flip_it
   if c = 3 then gosub flip_it
   playfield[b] = temp1
  next
 next
 return

 rem ** pfpixels for gameover logo
goverlogo
 data gover_data
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
 %11101110,%10101110,%11101010,%11101110
 %10100010,%11101010,%10101010,%10101010
 %11101110,%10101110,%10101010,%11101000
 %00101010,%10101000,%10101010,%10001000
 %11101110,%10101110,%11100100,%11101000
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
end
 for r = 0 to 10
  for c = 0 to 3
   b = 4 * r
   b = b + c
   temp1 = gover_data[b]
   if c = 1 then gosub flip_it
   if c = 3 then gosub flip_it
   playfield[b] = temp1
  next
 next
 return

Level2map
 data leveltwo_data
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00001110
 %00000000,%00000000,%00000000,%00010001
 %10000111,%10100101,%11101000,%00000001
 %10000100,%00100101,%00001000,%00000010
 %10000111,%00100101,%11001000,%00000100
 %10000100,%00100101,%00001000,%00001000
 %11110111,%10011001,%11101111,%00010000
 %00000000,%00000000,%00000000,%00011111
 %00000000,%00000000,%00000000,%00000000
 %00000000,%00000000,%00000000,%00000000
end
 for r = 0 to 10
  for c = 0 to 3
   b = 4 * r
   b = b + c
   temp1 = leveltwo_data[b]
   if c = 1 then gosub flip_it
   if c = 3 then gosub flip_it
   playfield[b] = temp1
  next
 next
 return

doorOpen
 missile1x = 159
 missile1y = 32
 missile1height = 10
 return

Level1map
 player0x = 31
 player0y = 88
 player0:
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %00000000
 %00000000
 %00000000
 %00000000
 %00000000
 %00000000
 %00000000
 %00000000
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
 %11111111
end
 return

keymap
 player1x = 40
 player1y = 58
 player1:
 %00000000
 %00000000
 %00000000
 %00000000
 %10100111
 %10100101
 %11111101
 %00000111
end
 return

player0off
 player0:
 %00000000
end
 return

player1off
 player1:
 %00000000
end
 return

missile1off
 missile1height = 0
 return

 rem ** clears the screen
clear
 for g = 0 to 11
  pfhline 0 g 31 offa
 next g
 return

flip_it
 temp2 = 0
 if temp1{0} then temp2{7} = 1
 if temp1{1} then temp2{6} = 1
 if temp1{2} then temp2{5} = 1
 if temp1{3} then temp2{4} = 1
 if temp1{4} then temp2{3} = 1
 if temp1{5} then temp2{2} = 1
 if temp1{6} then temp2{1} = 1
 if temp1{7} then temp2{0} = 1
 temp1 = temp2
 return

 

I think instead of using missile1 for the door, I'm also going to use player1 for the door. Instead of going to the subroutine of player1off, I'll make one for the door (with different coordinates) so I make a 'realistic' looking door. I'll go back and change that and edit this post with the changes if successful.

 

Thanks for all the help - it's really coming along!

Link to comment
Share on other sites

WOO HOO!!! Major update!!!

 

I have all the maps drawn and implemented into the code. Only missing 2 minor (well major) things in the code - I have it in there but it doesn't seem to work.

 

When the snake collides with itself or any other pfpixel it goes to gameover - however when I implement the code, it automatically goes to gameover. I think because while it's updating, it thinks one of it's segments is running to itself - I think the update lags. So I tried to slow it down by putting in a wait routine, that just made the snake stay a live 2 moves longer. Here's the code I used:

 

 rem ** move snake's segments
 for z = 4 to 1 step 255
  y = z - 1
  snake_col[z] = snake_col[y]
  snake_row[z] = snake_row[y]
 next
 snake_col[0] = snake_col[0] + snake_e_w
 snake_row[0] = snake_row[0] + snake_n_s

 rem ** collision for snake (doesn't work)
 u = snake_col[0] : t = snake_row[0]
 if pfread(u,t) then goto gameover

 

Maybe it's just because it's implemented in the wrong place.

 

Another issue: I want it so that if the score reaches 0, then it goes to the gameover routine. Easy if statement eh? No. I put it what I thought would be the correct statement, but when the game starts it goes directly to gameover with a score of 99!!?!?!?! Here's the code I used:

 

 rem ** collision for snake and key and door
 if collision(player1,playfield) then keyflag = 1
 if keyflag = 1 then gosub doorOpen
 if collision(player0,playfield) then goto nextLevel

 rem ** score of 0 then gameover (doesn't work)
 if score = 0 then goto gameover

 rem ** if fire then gameover sequence
 if joy0fire then score = score + 1

 

With all that said, I'm very pleased at the pace this is coming (although I spent countless hours on it), but I'm pleased because this is my first game created!

 

Oh yea - I got the pfpixels to work - I implemented in the top of the code and inserted a drawscreen (no blinking anymore!). There are 10 levels I think - when you get to the 10th, it repeats the 1st but slightly faster. Each time you finish a set it speeds up!

 

FUTURE UPDATES:

 

I plan on using the missiles for the snake to "eat" and upon eating it has a temporary speed change and maybe a possible turn collision with the playing field off (temporarily).

 

I attached the .bas file and the .bin file so y'all can look at it and tell me what to improve upon.

 

thanks guys for all the help (especially SeaGTScruff!!).

snazev5.bas.bin

snazev5.bas

Edited by AeRo
Link to comment
Share on other sites

Update:

 

I finally figured out the collision! using snake_col[0] and snake_row[0], it was continually updating itself and causing the pfread function to believe it was colliding when it was updating/erasing - which is understandable. So I replaced the 0, with z in my function:

 

 for z = 4 to 1 step 255
  y = z - 1
  snake_col[z] = snake_col[y]
  snake_row[z] = snake_row[y]
 next
 snake_col[0] = snake_col[0] + snake_e_w
 snake_row[0] = snake_row[0] + snake_n_s

 rem ** snake collision
 u = snake_col[z] : t = snake_row[z]
 if !pfread(u,t) then goto gameover

 

 

Now all I have to do is figure out how to get to gameover when the score = 0......

 

 

I'll post my updated game later on, so now you can actually play a working game!

Link to comment
Share on other sites

Now all I have to do is figure out how to get to gameover when the score = 0......

978876[/snapback]

Someone else just asked a similar question about the score. In your case, you could detect score=0 right after you subtract 1.

 

score=score-1:if score=$99 then goto gameover

 

See the other topic for an explanation as to why this works.

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